Maven 2 & 3

-o makes build fail for snapshot plugins

Details

  • Complexity:
    Intermediate
  • Number of attachments :
    0

Description

I've set the maven-eclipse-plugin version to 2.3-SNAPSHOT in my root pom.

When I run without -o, the build works fine. All 1000000 non-deployed snapshot artifacts are resolved 1000000 times from all of my 100000 remote repo's so the build takes ages.

After a succesful build, I run with -o and the build fails:

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: org.apache.maven.plugins
ArtifactId: maven-eclipse-plugin
Version: 2.3-SNAPSHOT

Reason: System is offline.

  org.apache.maven.plugins:maven-eclipse-plugin:pom:2.3-SNAPSHOT



NOTE: Maven is executing in offline mode. Any artifacts not already in your local
repository will be inaccessible.


[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Unable to build project for plugin 'org.apache.maven.plugins:maven-eclipse-plugin': POM 'org.apache.maven.
plugins:maven-eclipse-plugin' not found in repository: System is offline.

  org.apache.maven.plugins:maven-eclipse-plugin:pom:2.3-SNAPSHOT


        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1269)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1517)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:381)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:135)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:393)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:182)
        at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:746)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:394)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.InvalidPluginException: Unable to build project for plugin 'org.apache.maven.plugins:maven-eclipse-plugin': POM 'org.apache.mav
en.plugins:maven-eclipse-plugin' not found in repository: System is offline.

  org.apache.maven.plugins:maven-eclipse-plugin:pom:2.3-SNAPSHOT


        at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:266)
        at org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:184)
        at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:164)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1252)
        ... 15 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.apache.maven.plugins:maven-eclipse-plugin' not found in repository: System is offline.

  org.apache.maven.plugins:maven-eclipse-plugin:pom:2.3-SNAPSHOT


        at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:522)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:227)
        at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:250)
        ... 18 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: System is offline.

  org.apache.maven.plugins:maven-eclipse-plugin:pom:2.3-SNAPSHOT


        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:140)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:65)
        at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:476)
        ... 20 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Mon Dec 11 12:11:50 CET 2006
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
FATAL ERROR: Unable to configure the Maven application
Error stacktrace:
org.apache.maven.reactor.MavenExecutionException: Unable to build project for plugin 'org.apache.maven.plugins:maven-eclipse-plugin': POM 'org.apache.maven.plugin
s:maven-eclipse-plugin' not found in repository: System is offline.

  org.apache.maven.plugins:maven-eclipse-plugin:pom:2.3-SNAPSHOT


        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:194)
        at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:746)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:394)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.lifecycle.LifecycleExecutionException: Unable to build project for plugin 'org.apache.maven.plugins:maven-eclipse-plugin': POM 'org.ap
ache.maven.plugins:maven-eclipse-plugin' not found in repository: System is offline.

  org.apache.maven.plugins:maven-eclipse-plugin:pom:2.3-SNAPSHOT


        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1269)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1517)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:381)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:135)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:393)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:182)
        ... 10 more
Caused by: org.apache.maven.plugin.InvalidPluginException: Unable to build project for plugin 'org.apache.maven.plugins:maven-eclipse-plugin': POM 'org.apache.mav
en.plugins:maven-eclipse-plugin' not found in repository: System is offline.

  org.apache.maven.plugins:maven-eclipse-plugin:pom:2.3-SNAPSHOT


        at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:266)
        at org.apache.maven.plugin.DefaultPluginManager.verifyVersionedPlugin(DefaultPluginManager.java:184)
        at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:164)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1252)
        ... 15 more
Caused by: org.apache.maven.project.ProjectBuildingException: POM 'org.apache.maven.plugins:maven-eclipse-plugin' not found in repository: System is offline.

  org.apache.maven.plugins:maven-eclipse-plugin:pom:2.3-SNAPSHOT


        at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:522)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:227)
        at org.apache.maven.plugin.DefaultPluginManager.checkRequiredMavenVersion(DefaultPluginManager.java:250)
        ... 18 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: System is offline.

  org.apache.maven.plugins:maven-eclipse-plugin:pom:2.3-SNAPSHOT


        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:140)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:65)
        at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:476)
        ... 20 more

Note: we may also want to fix the -X since the stacktrace is duplicated.

Issue Links

Activity

Hide
Jörg Hohwiller added a comment -

I am struggling with this problem under maven 2.0.5.
Has anything happened so far? Is there a patch or workaround for this problem?

Show
Jörg Hohwiller added a comment - I am struggling with this problem under maven 2.0.5. Has anything happened so far? Is there a patch or workaround for this problem?
Hide
Nathan McDonald added a comment -

Am having the same problem with maven 2.0.6

Show
Nathan McDonald added a comment - Am having the same problem with maven 2.0.6
Hide
Matthias Weßendorf added a comment -

I see an offline issue in 206 as well.
Not with plugins, but with regular dependencies.

Used to work in 204

Show
Matthias Weßendorf added a comment - I see an offline issue in 206 as well. Not with plugins, but with regular dependencies. Used to work in 204
Hide
Martin Degenhardt added a comment -

The Problem is a real showblocker. But there is a workaround:

settings.xml
...
		<profile>
			<id>offline</id>
	
			<repositories>
				<repository>
					<id>central</id>
					<url>
						http://not.important.org
					</url>
					<releases>
						<updatePolicy>never</updatePolicy>
					</releases>
					<snapshots>
						<updatePolicy>never</updatePolicy>
					</snapshots>
				</repository>
			</repositories>

			<pluginRepositories>
				<pluginRepository>
					<id>central</id>
					<url>
						http://not.important.org
					</url>
					<releases>
						<updatePolicy>never</updatePolicy>
					</releases>
					<snapshots>
						<updatePolicy>never</updatePolicy>
					</snapshots>
				</pluginRepository>
			</pluginRepositories>
		</profile>

Then, activate the profile with mvn -Poffline but do not activate the "offline" mode. This should prevent Maven from using the repositories.

Show
Martin Degenhardt added a comment - The Problem is a real showblocker. But there is a workaround:
settings.xml
...
		<profile>
			<id>offline</id>
	
			<repositories>
				<repository>
					<id>central</id>
					<url>
						http://not.important.org
					</url>
					<releases>
						<updatePolicy>never</updatePolicy>
					</releases>
					<snapshots>
						<updatePolicy>never</updatePolicy>
					</snapshots>
				</repository>
			</repositories>

			<pluginRepositories>
				<pluginRepository>
					<id>central</id>
					<url>
						http://not.important.org
					</url>
					<releases>
						<updatePolicy>never</updatePolicy>
					</releases>
					<snapshots>
						<updatePolicy>never</updatePolicy>
					</snapshots>
				</pluginRepository>
			</pluginRepositories>
		</profile>
Then, activate the profile with mvn -Poffline but do not activate the "offline" mode. This should prevent Maven from using the repositories.
Hide
John Casey added a comment -

I've just added an integration test to Maven's suite that attempts to capture this failure condition, but I haven't been able to reproduce the problem yet. I've tried mainly with 2.0.9 and 2.0.7.

The integration test projects are here:

http://svn.apache.org/repos/asf/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-2695-offlinePluginSnapshots

And the JUnit TestCase controller is here:

http://svn.apache.org/repos/asf/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng2695OfflinePluginSnapshotsTest.java

If this is still a problem, can someone post a sample project that will reproduce the problem, along with any specific details about expressing it? If not, I'm going to close this CANNOT_REPRODUCE, as I feel like this integration test does a decent job of covering the basic use case surrounding plugin snapshots and offline mode.

Show
John Casey added a comment - I've just added an integration test to Maven's suite that attempts to capture this failure condition, but I haven't been able to reproduce the problem yet. I've tried mainly with 2.0.9 and 2.0.7. The integration test projects are here: http://svn.apache.org/repos/asf/maven/core-integration-testing/trunk/core-integration-tests/src/test/resources/mng-2695-offlinePluginSnapshots And the JUnit TestCase controller is here: http://svn.apache.org/repos/asf/maven/core-integration-testing/trunk/core-integration-tests/src/test/java/org/apache/maven/integrationtests/MavenITmng2695OfflinePluginSnapshotsTest.java If this is still a problem, can someone post a sample project that will reproduce the problem, along with any specific details about expressing it? If not, I'm going to close this CANNOT_REPRODUCE, as I feel like this integration test does a decent job of covering the basic use case surrounding plugin snapshots and offline mode.
Hide
John Casey added a comment -

As mentioned above, I cannot reproduce this error. I've added an integration test to the suite attempting to reproduce, but it may not capture the full scenario in play here.

If you can provide a test case that fails for this issue, reopen it and I'll take another look.

Show
John Casey added a comment - As mentioned above, I cannot reproduce this error. I've added an integration test to the suite attempting to reproduce, but it may not capture the full scenario in play here. If you can provide a test case that fails for this issue, reopen it and I'll take another look.
Hide
John Casey added a comment -

Adding fix-for for both 2.0.10 and 2.1.0-M1, since 2.1.0-M1 will actually be released first and may not incorporate all of the eventual issue fixes released in 2.0.10.

Show
John Casey added a comment - Adding fix-for for both 2.0.10 and 2.1.0-M1, since 2.1.0-M1 will actually be released first and may not incorporate all of the eventual issue fixes released in 2.0.10.
Hide
Benjamin Bentmann added a comment - - edited

The existing IT has been updated to produce the issue, see MNG-3314 for a proposed patch.

Show
Benjamin Bentmann added a comment - - edited The existing IT has been updated to produce the issue, see MNG-3314 for a proposed patch.
Hide
Brian Fox added a comment -

patch applied, tests pass

Show
Brian Fox added a comment - patch applied, tests pass

People

Vote (10)
Watch (7)

Dates

  • Created:
    Updated:
    Resolved: