Ever tried to run maven 2 with no network and Snapshots, after midnight…. its hard because it likes to check for updates of snapshots. The following in ~/.m2/settings.xml might help.
<?xml version="1.0"?> <settings> <profiles> <profile> <repositories> <repository> <id>local-repository</id> <url>file:////Users/ieb/.m2/repository</url> </repository> </repositories> <id>local-offline</id> </profile> </profiles> <activeProfiles> <activeProfile>local-offline</activeProfile> </activeProfiles> </settings>
When I’m developing offline I just use
mvn -o clean install … Is that a valid solution too?
Yes -o will prevent maven looking for artifacts in remote repositories, but a 00:00 local time, it still checks for SNAPSHOT artifacts even with -o.
The hack allows maven to use your local repository as a remote repository. When there is no IP connectivity, it discovers that this is the only repo to work…. and all the SNAPSHOTS are upto date.
I found to be able to build sakai offline I also had to say to use my local repository as a plugin repository as the sakai plugin currently is a SNAPSHOT verstion.
Example of my settings.xml
local-offline
local-plugin-repository
Local Offline Plugin Repository
file:///C:/Documents and Settings/Matthew/.m2/repository
true
local-repository
Local Offline Repository
file:///C:/Documents and Settings/Matthew/.m2/repository
Which I then activate with “mvn -Plocal-offline”
I a config almost the same as yours, but I still have problems with plugins update!
For some how plugins from maven are try to search for update, and my build box have no Internet access and the build is broking.
My settings:
blaProfile
blaRepo
file://${bla.3rdParty.home}/maven/.m2/repository
default
blaRepo
file://${bla.3rdParty.home}/maven/.m2/repository
default
blaProfile