Offline Maven 2

22 02 2008

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>

Advertisements

Actions

Information

4 responses

23 02 2008
Nicolaas Matthijs

When I’m developing offline I just use
mvn -o clean install … Is that a valid solution too?

24 02 2008
Ian Boston

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.

18 03 2008
Matthew Buckett

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”

7 08 2009
Rafael Ferreira

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




%d bloggers like this: