Maven offline - problem with mvn-plugins

rafa.ferreira picture rafa.ferreira · Aug 7, 2009 · Viewed 14.4k times · Source

I'm using maven in my project and I need to run the build in a non-internet-access machine.

When I test my project build everything is working, but when I run the build in a future moment, the maven try to update the mvn-plugins and this sht* is broking my build.

My config file: settings.xml from mvn.

    <profile>
      <id>blaProfile</id>
      <repositories>
        <repository>
          <id>blaRepo</id>
          <url>file://${bla.3rdParty.home}/maven/.m2/repository</url>
          <layout>default</layout>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>blaRepo</id>
          <url>file://${bla.3rdParty.home}/maven/.m2/repository</url>
          <layout>default</layout>
        </pluginRepository>
      </pluginRepositories>
    </profile>

  <activeProfiles>
    <activeProfile>blaProfile</activeProfile>
  </activeProfiles>

And I ran my maven is with the params:

mvn -npu -bla.3rdParty.home="$(THE_CORRECT_PATH)" package

I saw that maven try to update some mvn-plugins for some time, but the option:

-npu,--no-plugin-updates      Suppress upToDate check for any relevant

Should work for this updates.

Well waiting some help on that!

Thanks in advance!


UPDATE(1):
What I'm looking at, is that I could use the setting:

<usePluginRegistry>true</usePluginRegistry>

Inside my settings.xml and with this, I'll have a plugin-registry.xml inside ${user.home}/.m2 that I can config and force the maven plugins versions.

But it's not working! :(

Answer

hohonuuli picture hohonuuli · Aug 7, 2009

Before you go offline run the following:

mvn dependency:go-offline

That will download all your dependencies and plugins that you need to build your project into ~/.m2/repository.

Once you've run that you can now build your project offline using the '-o' flag:

mvn install -o