Question: I have Maven2 project. All dependencies except one are downloaded from public repository <http://repo.maven.apache.org/maven2/>. 

But I have 1 dependency which I need to download from internal company's repository (we use Sonatype Nexus to store this dependency).

Also, I don't want to create full copy of public repo on my internal repo.

At this moment I have in pom.xml:

```
<url>http://maven.apache.org</url>

```

and

```
<repositories>
    <repository>
        <id>thirdparty</id>
        <url>http://<my_nexus_server_ip>:8081/nexus/content/repositories/thirdparty</url>
    </repository>
</repositories>

```

So, during build I see a lot of trash messages (in this case first line is a trash):

```
Downloading: http://<my_nexus_server_ip>:8081/nexus/content/repositories/thirdparty/ant/ant/1.6.5/ant-1.6.5.pom
Downloading: http://repo.maven.apache.org/maven2/ant/ant/1.6.5/ant-1.6.5.pom
Downloaded: http://repo.maven.apache.org/maven2/ant/ant/1.6.5/ant-1.6.5.pom (861 B at 3.2 KB/sec)  

```

I want to clearly point Maven for which dependency it have to use internal repository and ignore it for others dependencies (and point that for others dependencies Maven2 have to use public repository).

Could you please help to implement such behavior in Maven?

Thanks In Advance!

Answer: 
According to [this answer](https://stackoverflow.com/a/3168956/91497), it is not possible to set a specific repository for for some of the declared dependencies.
You need to configure the public repository group in Nexus to be used the only one in your Maven builds like the following:

```
<settings>
  <mirrors>
    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://localhost:8081/nexus/content/groups/public</url>
    </mirror>
  </mirrors>
  <profiles>
    <profile>
      <id>nexus</id>
      <!--Enable snapshots for the built in central repo to direct -->
      <!--all requests to nexus via the mirror -->
      <repositories>
        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
  <activeProfiles>
    <!--make the profile active all the time -->
    <activeProfile>nexus</activeProfile>
  </activeProfiles>
</settings>

```

You have to setup a separate repository in nexus like you described a repo called `ThirdParty` and add this repository into the configuration of the public repository group. Furthermore you need to upload the one dependency into that particular repository. Apart from that you should have to use the **release** and **SNAPSHOT** repository which means you need to configuration your distributionManagement accordingly in your company master pom file.