Maven repos order when using profiles
ozizka Dec 17, 2010 10:13 AMHi,
I have some issues with setting Maven repos order correctly.
I have settings.xml (see below) with two profiles which set some repos.
Then if I run `mvn -s ../../../settings.xml help:effective-pom -Pmavenhoe-repo,jboss-repos` ,
I would expect the repos to be in the order respective to the order of profiles they are defined in.
However, they are merged into this order:
<repositories> <repository> <id>jboss</id> <url>https://repository.jboss.org/nexus/content/groups/public</url> </repository> <repository> <id>mavenhoe</id> <url>http://localhost:17283/jars?mvnPath=</url> </repository> <repository> <id>central</id> <name>Maven Repository Switchboard</name> <url>http://repo1.maven.org/maven2</url> </repository> </repositories>
(Setting both <activeByDefault>'s to true leads to the same order.)
How does Maven figure out this order?
Could someone please hint how to get the mavenhoe repo at the very top?
Thanks,
Ondra
<profiles> <!-- Mavenhoe fake repository --> <profile> <id>mavenhoe-repo</id> <activation><activeByDefault>false</activeByDefault></activation> <repositories> <repository> <id>mavenhoe</id> <url>http://localhost:17283/jars?mvnPath=</url> </repository> </repositories> </profile> <!-- JBoss repos --> <profile> <id>jboss-repos</id> <activation><activeByDefault>false</activeByDefault></activation> <!-- JBoss release and snapshot repos --> <repositories> <repository> <id>jboss</id> <url>https://repository.jboss.org/nexus/content/groups/public</url> <releases> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </snapshots> </repository> </repositories> <!-- JBoss release and snapshot repos *for plugins* --> <pluginRepositories> <pluginRepository> <id>jboss-plugins</id> <url>https://repository.jboss.org/nexus/content/groups/public</url> <releases> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles>