Maven Mirror - how to bypass if mirror host is not available?
maven, vpn
Solution
Try running the build in off-line mode when not connected to the VPN
mvn -o clean package
Another option is to have a second Maven settings file for use when you're connected to a different network:
mvn -s $HOME/.m2/settings-alternative.xml clean package
In this case I'd also recommend specifying an alternative local repository location (within the settings file), so as to avoid build confusion.
Problem
I have a maven mirror repository (Archiva) e.g. ``` <settings> <mirrors> <mirror> <id>archiva</id> <mirrorOf>*</mirrorOf> <url>http://myMirrorHost:8080/archiva/repository/internal</url> </mirror> </mirrors> ... ``` However this is behind a VPN, and sometimes I rather not use it / can't connect to the VPM The issue is when building outside the VPN, I get this error myMirrorHost: Unknown host myMirrorHost -> [Help 1] When I would like it instead to timeout / not use the mirror if not found Is that possible?