Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

download dependecy only form a specific repository with maven [duplicate]

Tags:

maven

Possible Duplicate:
How to set order of repositories in Maven settings.xml

I'm using an internal maven repository for a project, and when I specify a dependency I'd like that maven looks this dependency only in the internal repository and not in the public repositories. Example:

<repositories>
 ...
 <myrepository...>
 <publicrepo...>
</repositories>

[..]


<dependency>
        <groupId>imygroupid</groupId>
        <artifactId>myartifactId</artifactId>
        <version>1.0-SNAPSHOT</version>
</dependency>

If I build the maven project I can see that maven try to download the artifact myartifactId from all public repository I specified in the pom. Is there a way to specify that all artifacts with groupId should be find in the internal repository and not in the other?

This will solve some performance problem during the build task.

like image 541
flavio Avatar asked Nov 05 '22 11:11

flavio


2 Answers

I think the only way to do this is with repository managers like Nexus or Archiva

like image 176
Dmitry B. Avatar answered Nov 09 '22 08:11

Dmitry B.


You may find some clues here : How to set order of repositories in Maven settings.xml

The order of repositories seems to be inverse order of declaration in settings.xml

like image 33
Jean-Rémy Revy Avatar answered Nov 09 '22 08:11

Jean-Rémy Revy