On 26/02/2011, at 1:41 PM, Mark wrote: > How can I configure maven to first check all the default repositories and if > a jar is not found THEN check our corporate repo (Archiva)? > > I've added the following to settings.xml however It tries to connect to this > repo first, not last. > > <id>Foo</id> > <url>http://my.company.com:8080/archiva/repository/internal/</url> > <releases> > <enabled>true</enabled> > </releases> > <snapshots> > <enabled>true</enabled> > </snapshots>
It depends where you've declared this, but generally due to inheritance rules this is going to take precedence over the built in ones. The only solution is to redeclare the default repository above the declaration you've given: <repository> <id>central</id> <url>http://repo1.maven.org/maven2</url> ... </repository> <repository> <id>Foo</id> <url>http://my.company.com:8080/archiva/repository/internal/</url> ... </repository> A better solution is to run a copy of Archiva on your own machine, and point your builds there for everything. You can then use proxy rules to direct only requests for corporate artifacts to the corporate repository, and take that connector offline when you're not on the VPN (as well as controlling timeouts). > > This repo will also only be available if I am connected to our VPN. Is there > also a way to configure a connect timeout so it doesn't hang for minutes when > Im not connected to the VPN? https://brettporter.wordpress.com/2009/06/16/configuring-maven-http-connections/ Cheers, Brett -- Brett Porter [email protected] http://brettporter.wordpress.com/ http://au.linkedin.com/in/brettporter --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
