maven - multiple repository lookup configuration -
i'm using maven v3.0.1 projects. i've projects depends on artifacts corporate remote repository. had local archiva repository in company hold local artifacts, not in corporate remote repository.
i make settings.xml in such way projects, lookup specified artifact first in corporate remote repository, if not found there, artifact in local archiva repository.
i added local repository in <repository>
tag , enabled profile <activeprofile>
. looking not happening expected. on analysis found mirrorof
setting plays role there. following settings.xml.
<?xml version="1.0" encoding="utf-8"?> <settings> <mirrors> <mirror> <id>nexus</id> <mirrorof>*</mirrorof> <url>http://corporate-repo:8081/nexus/content/groups/public</url> </mirror> </mirrors> <profiles> <profile> <id>nexus</id> <repositories> <repository> <id>central</id> <url>http://central</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> <updatepolicy>daily</updatepolicy> </snapshots> </repository> <repository> <id>spring-snapshot</id> <name>spring maven snapshot repository</name> <url>http://repo.springsource.org/libs-snapshot</url> </repository> <repository> <id>internal</id> <name>local release repository</name> <url>http://local-repo:8081/repository/internal</url> </repository> </repositories> <pluginrepositories> <pluginrepository> <id>central</id> <url>http://central</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> <updatepolicy>daily</updatepolicy> </snapshots> </pluginrepository> </pluginrepositories> </profile> </profiles> <activeprofiles> <activeprofile>nexus</activeprofile> </activeprofiles> </settings>
how can modify settings.xml lookup required ? whether way provide 2 urls in mirrorof
settings. tried
<mirror> <id>nexus</id> <mirrorof>*</mirrorof> <url>http://corporate-repo:8081/nexus/content/groups/public,http://local-repo:8081/repository/internal</url> </mirror>
no errors in xml parsing, lookup not working. can 1 shed light on how resolve issue
i experimented lot of options , resolved tweaking mirrorof settings <mirrorof>*,!internal</mirrorof>
so mirror settings are,
<mirrors> <mirror> <id>nexus</id> <mirrorof>*,!internal</mirrorof> <url>http://corporate-repo:8081/nexus/content/groups/public</url> </mirror> </mirrors>
*
ensures request except internal repo !internal
lookup in corporate repo. internal repo, in local-repo configured repository id internal
Comments
Post a Comment