You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Morgan Rachell <mr...@cri-solutions.com> on 2006/06/13 21:32:59 UTC
[m2] How to override a mirror in local settings
I have maven-proxy running on an internal server. I have also updated
the parent pom.xml to include this:
<repositories>
<repository>
<id>central</id>
<name>Internal Mirror of Central Repository</name>
<url>http://reposerver:9999/repository</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Internal Mirror of Central Repository</name>
<url>http://reposerver:9999/repository</url>
</pluginRepository>
</pluginRepositories>
So now the project pom has defined which "central" repository to use.
However, I noticed that if I put a <mirror> entry in my local maven2
settings.xml config, then maven will go straight to the mirror instead
of to the internal repo. I suppose this is by design, but I don't want
developers to be able to override the project setting - at least not
for this project. Is there a way to force maven to ignore a <mirror>
setting from a parent pom?
Thanks
Morgan
Re: [m2] How to override a mirror in local settings
Posted by Thorsten Heit <th...@xtramind.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Morgan,
> I have maven-proxy running on an internal server. I have also updated
> the parent pom.xml to include this:
>
> <repositories>
> <repository>
> <id>central</id>
> <name>Internal Mirror of Central Repository</name>
> <url>http://reposerver:9999/repository</url>
> </repository>
> </repositories>
> <pluginRepositories>
> <pluginRepository>
> <id>central</id>
> <name>Internal Mirror of Central Repository</name>
> <url>http://reposerver:9999/repository</url>
> </pluginRepository>
> </pluginRepositories>
I'm also using maven-proxy on an internal server, but I don't use any
repository settings in my pom.xml; instead I have the following entries
in my settings.xml:
<mirrors>
<mirror>
<id>bender</id>
<name>internal mirror of http://repo1.maven.org/maven2/</name>
<url>http://myserver:9999/repository</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>bender</id>
<name>internal mirror of http://repo1.maven.org/maven2/</name>
<url>http://myserver:9999/repository</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>tlc</id>
<name>TLC Snapshot Development Repository</name>
<url>http://commons.ucalgary.ca/pub/m2-snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>apache.snapshots</id>
<name>Apache Development Repository</name>
<url>http://cvs.apache.org/maven-snapshot-repository</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>bender</id>
<name>internal mirror of http://repo1.maven.org/maven2/</name>
<url>http://myserver:9999/repository</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>tlc-snapshots</id>
<name>TLC Snapshot Development Repository</name>
<url>http://commons.ucalgary.ca/pub/m2-snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>snapshots-codehaus-org</id>
<name>Snapshots of maven plugins at codehaus.org</name>
<url>http://snapshots.maven.codehaus.org/maven2</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<!--<updatePolicy>always</updatePolicy>-->
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
Using these settings Maven accesses everything apart from the snapshot
repos via my maven-proxy. If you're behind a firewall, don't forget to
add a corresponding <proxy>...</proxy> entry into your settings.xml so
that Maven can download optional snapshots.
HTH
Thorsten
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
iD8DBQFEj9q/QvObkgCcDe0RAljkAKCCcuB7WsBoGYm/XWx7Dje3W0CJtQCfVAvD
wjQ1MsEXEZ1K9XCoelLRCjA=
=jrDr
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org