Offline Maven 2

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>

Comments

3 Responses to “Offline Maven 2”

  1. Nicolaas Matthijs on February 23rd, 2008 3:25 pm

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

  2. Ian Boston on February 24th, 2008 11:38 am

    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.

  3. Matthew Buckett on March 18th, 2008 10:54 am

    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”

Leave a Reply




This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

You must read and type the 5 chars within 0..9 and A..F, and submit the form.

  

Oh no, I cannot read this. Please, generate a