Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Incomplete
-
3.0.3
-
None
-
None
-
Java 1.6 update 24, x64
Windows 7 x64
Description
Issue initially posted on aether-user mailing list in topic "Aether, plugin maven-metadata.xml, and server authentication" from today (May 13th 2011). Unfortunatelly I couldn't find mailing list archive to post a reference.
I tried to build https://github.com/SpringSource/spring-data-commons from environment configured to use a mirror of central repository which requires authentication. POMs in the project configure executions of maven-compiler-plugin, maven-sources-plugin, and maven-surefire-plugin but without specifying version of these plugins. Mavan build prints warnings that plugin versions should be set, but continues only to fail with [1]. Because AuthorizationException is reported I thought it was authentication issue.
Then I checked-out aether 1.11 (Maven 3.0.3 uses it) and debugged. I placed a breakpoint in WagonRepositoryConnector, in get method, within loop over metadataDownloads. When build starts, and plugins (metadata) are about to be resolved, 3 threads appear paused in debugger - it seems Maven starts them, one for each plugin repository (2 configured in pom and third is central) to download plugin metadata in parallel from the repositories. If I let just one thread at a time to continue plugin maven-metadata.xml file gets downloaded from mirror-of-central and build is successful (so it's not security/authentication/credentials issue).
Then Benjamin Bentmann suggested that I try setting aether.metadataResolver.threads=1. After that, resolving metadata and plugins passes well, which made me conclude this is concurrency issue. Setting aether.metadataResolver.threads=2 build also passes. For aether.metadataResolver.threads=3 build fails. From https://issues.sonatype.org/browse/AETHER-26 it seems default is 4 threads in pool.
When testing before build I first delete org/apache/maven/plugins directory in local repo to force version resolving from remote repo to reproduce the bug.
When build fails in local repo in org/apache/maven/plugins/maven-comiler-plugin only resolver-status.properties file is available.
On Benjamins suggestion I also tried using asynchttp connector and it worked well.
[1] Maven build error stack trace
c:\Users\s.slavic\spring-data-commons>mvn clean verify -U -X Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100) Maven home: d:\java\maven\apache-maven-3.0.3\bin\.. Java version: 1.6.0_24, vendor: Sun Microsystems Inc. Java home: d:\java\jdk\jdk1.6.0_24-x64\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows" [INFO] Error stacktraces are turned on. [DEBUG] Reading global settings from d:\java\maven\apache-maven-3.0.3\bin\..\conf\settings.xml [DEBUG] Reading user settings from C:\Users\s.slavic\.m2\settings.xml [DEBUG] Using local repository at C:\Users\s.slavic\.m2\repository [DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for C:\Users\s.slavic\.m2\repository [INFO] Scanning for projects... [DEBUG] org.springframework.build.aws:org.springframework.build.aws.maven:jar:3.1.0.RELEASE: [DEBUG] commons-httpclient:commons-httpclient:jar:3.1:compile [DEBUG] commons-logging:commons-logging:jar:1.0.4:compile [DEBUG] commons-codec:commons-codec:jar:1.2:compile [DEBUG] net.java.dev.jets3t:jets3t:jar:0.8.0:compile [DEBUG] com.jamesmurty.utils:java-xmlbuilder:jar:0.4:compile [DEBUG] org.codehaus.plexus:plexus-utils:jar:1.1:runtime [DEBUG] Created new class realm maven.api [DEBUG] Importing foreign packages into class realm maven.api [DEBUG] Imported: org.apache.maven.wagon.events < plexus.core [DEBUG] Imported: org.sonatype.aether.transfer < plexus.core [DEBUG] Imported: org.apache.maven.exception < plexus.core [DEBUG] Imported: org.sonatype.aether.metadata < plexus.core [DEBUG] Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core [DEBUG] Imported: org.sonatype.aether.collection < plexus.core [DEBUG] Imported: org.sonatype.aether.version < plexus.core [DEBUG] Imported: org.apache.maven.monitor < plexus.core [DEBUG] Imported: org.apache.maven.wagon.repository < plexus.core [DEBUG] Imported: org.apache.maven.repository < plexus.core [DEBUG] Imported: org.apache.maven.wagon.resource < plexus.core [DEBUG] Imported: org.codehaus.plexus.logging < plexus.core [DEBUG] Imported: org.apache.maven.profiles < plexus.core [DEBUG] Imported: org.sonatype.aether.repository < plexus.core [DEBUG] Imported: org.apache.maven.classrealm < plexus.core [DEBUG] Imported: org.apache.maven.execution < plexus.core [DEBUG] Imported: org.sonatype.aether.artifact < plexus.core [DEBUG] Imported: org.sonatype.aether.spi < plexus.core [DEBUG] Imported: org.apache.maven.reporting < plexus.core [DEBUG] Imported: org.apache.maven.usability < plexus.core [DEBUG] Imported: org.codehaus.plexus.container < plexus.core [DEBUG] Imported: org.codehaus.plexus.component < plexus.core [DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core [DEBUG] Imported: org.apache.maven.wagon.authentication < plexus.core [DEBUG] Imported: org.apache.maven.lifecycle < plexus.core [DEBUG] Imported: org.codehaus.plexus.classworlds < plexus.core [DEBUG] Imported: org.sonatype.aether.graph < plexus.core [DEBUG] Imported: org.sonatype.aether.* < plexus.core [DEBUG] Imported: org.apache.maven.settings < plexus.core [DEBUG] Imported: org.codehaus.classworlds < plexus.core [DEBUG] Imported: org.sonatype.aether.impl < plexus.core [DEBUG] Imported: org.apache.maven.wagon.* < plexus.core [DEBUG] Imported: org.apache.maven.toolchain < plexus.core [DEBUG] Imported: org.sonatype.aether.deployment < plexus.core [DEBUG] Imported: org.apache.maven.wagon.observers < plexus.core [DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core [DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core [DEBUG] Imported: org.apache.maven.configuration < plexus.core [DEBUG] Imported: org.apache.maven.cli < plexus.core [DEBUG] Imported: org.sonatype.aether.installation < plexus.core [DEBUG] Imported: org.codehaus.plexus.context < plexus.core [DEBUG] Imported: org.apache.maven.wagon.authorization < plexus.core [DEBUG] Imported: org.apache.maven.project < plexus.core [DEBUG] Imported: org.apache.maven.rtinfo < plexus.core [DEBUG] Imported: org.codehaus.plexus.lifecycle < plexus.core [DEBUG] Imported: org.codehaus.plexus.configuration < plexus.core [DEBUG] Imported: org.apache.maven.artifact < plexus.core [DEBUG] Imported: org.apache.maven.model < plexus.core [DEBUG] Imported: org.apache.maven.* < plexus.core [DEBUG] Imported: org.apache.maven.wagon.proxy < plexus.core [DEBUG] Imported: org.sonatype.aether.resolution < plexus.core [DEBUG] Imported: org.apache.maven.plugin < plexus.core [DEBUG] Imported: org.codehaus.plexus.* < plexus.core [DEBUG] Imported: org.codehaus.plexus.personality < plexus.core [DEBUG] Populating class realm maven.api [DEBUG] Created new class realm extension>org.springframework.build.aws:org.springframework.build.aws.maven:3.1.0.RELEAS E [DEBUG] Importing foreign packages into class realm extension>org.springframework.build.aws:org.springframework.build.aw s.maven:3.1.0.RELEASE [DEBUG] Imported: < maven.api [DEBUG] Populating class realm extension>org.springframework.build.aws:org.springframework.build.aws.maven:3.1.0.RELEASE [DEBUG] Included: org.springframework.build.aws:org.springframework.build.aws.maven:jar:3.1.0.RELEASE [DEBUG] Included: commons-httpclient:commons-httpclient:jar:3.1 [DEBUG] Included: commons-logging:commons-logging:jar:1.0.4 [DEBUG] Included: commons-codec:commons-codec:jar:1.2 [DEBUG] Included: net.java.dev.jets3t:jets3t:jar:0.8.0 [DEBUG] Included: com.jamesmurty.utils:java-xmlbuilder:jar:0.4 [DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:1.1 [DEBUG] Extension realms for project org.springframework.data:spring-data-commons-dist:pom:1.1.0.BUILD-SNAPSHOT: [ClassR ealm[extension>org.springframework.build.aws:org.springframework.build.aws.maven:3.1.0.RELEASE, parent: sun.misc.Launche r$AppClassLoader@32f4a24a]] [DEBUG] Created new class realm project>org.springframework.data:spring-data-commons-dist:1.1.0.BUILD-SNAPSHOT [DEBUG] Populating class realm project>org.springframework.data:spring-data-commons-dist:1.1.0.BUILD-SNAPSHOT [DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[project>org.springframework.data:spring-data-comm ons-dist:1.1.0.BUILD-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]] [DEBUG] org.springframework.build.aws:org.springframework.build.aws.maven:jar:3.1.0.RELEASE: [DEBUG] commons-httpclient:commons-httpclient:jar:3.1:compile [DEBUG] commons-logging:commons-logging:jar:1.0.4:compile [DEBUG] commons-codec:commons-codec:jar:1.2:compile [DEBUG] net.java.dev.jets3t:jets3t:jar:0.8.0:compile [DEBUG] com.jamesmurty.utils:java-xmlbuilder:jar:0.4:compile [DEBUG] org.codehaus.plexus:plexus-utils:jar:1.1:runtime [DEBUG] Extension realms for project org.springframework.data:spring-data-commons-parent:pom:1.1.0.BUILD-SNAPSHOT: [Clas sRealm[extension>org.springframework.build.aws:org.springframework.build.aws.maven:3.1.0.RELEASE, parent: sun.misc.Launc her$AppClassLoader@32f4a24a]] [DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[project>org.springframework.data:spring-data-comm ons-dist:1.1.0.BUILD-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]] [DEBUG] Extension realms for project org.springframework.data:spring-data-commons-core:jar:1.1.0.BUILD-SNAPSHOT: [ClassR ealm[extension>org.springframework.build.aws:org.springframework.build.aws.maven:3.1.0.RELEASE, parent: sun.misc.Launche r$AppClassLoader@32f4a24a]] [DEBUG] Looking up lifecyle mappings for packaging jar from ClassRealm[project>org.springframework.data:spring-data-comm ons-dist:1.1.0.BUILD-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]] [WARNING] [WARNING] Some problems were encountered while building the effective model for org.springframework.data:spring-data-com mons-parent:pom:1.1.0.BUILD-SNAPSHOT [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 254, colu mn 12 [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 273, colu mn 12 [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. @ line 288, column 12 [WARNING] [WARNING] Some problems were encountered while building the effective model for org.springframework.data:spring-data-com mons-core:jar:1.1.0.BUILD-SNAPSHOT [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ org.springfram ework.data:spring-data-commons-parent:1.1.0.BUILD-SNAPSHOT, C:\Users\s.slavic\spring-data-commons\spring-data-commons-pa rent\pom.xml, line 254, column 12 [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ org.springfram ework.data:spring-data-commons-parent:1.1.0.BUILD-SNAPSHOT, C:\Users\s.slavic\spring-data-commons\spring-data-commons-pa rent\pom.xml, line 273, column 12 [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. @ org.springframew ork.data:spring-data-commons-parent:1.1.0.BUILD-SNAPSHOT, C:\Users\s.slavic\spring-data-commons\spring-data-commons-pare nt\pom.xml, line 288, column 12 [WARNING] [WARNING] Some problems were encountered while building the effective model for org.springframework.data:spring-data-com mons-dist:pom:1.1.0.BUILD-SNAPSHOT [WARNING] The expression ${pom.version} is deprecated. Please use ${project.version} instead. [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. @ line 285, co lumn 12 [WARNING] 'reporting.plugins.plugin.version' for org.codehaus.mojo:jxr-maven-plugin is missing. @ line 289, column 12 [WARNING] 'reporting.plugins.plugin.version' for org.codehaus.mojo:jdepend-maven-plugin is missing. @ line 319, column 1 2 [WARNING] 'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-pmd-plugin is missing. @ line 323, colum n 12 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] ------------------------------------------------------------------------ [INFO] Reactor Build Order: [INFO] [INFO] Spring Data Commons Parent [INFO] Spring Data Commons Core [INFO] Spring Data Commons Distribution [DEBUG] === REACTOR BUILD PLAN ================================================ [DEBUG] Project: org.springframework.data:spring-data-commons-parent:pom:1.1.0.BUILD-SNAPSHOT [DEBUG] Tasks: [clean, verify] [DEBUG] Style: Regular [DEBUG] ----------------------------------------------------------------------- [DEBUG] Project: org.springframework.data:spring-data-commons-core:jar:1.1.0.BUILD-SNAPSHOT [DEBUG] Tasks: [clean, verify] [DEBUG] Style: Regular [DEBUG] ----------------------------------------------------------------------- [DEBUG] Project: org.springframework.data:spring-data-commons-dist:pom:1.1.0.BUILD-SNAPSHOT [DEBUG] Tasks: [clean, verify] [DEBUG] Style: Regular [DEBUG] ======================================================================= [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Spring Data Commons Parent 1.1.0.BUILD-SNAPSHOT [INFO] ------------------------------------------------------------------------ [DEBUG] Resolving plugin version for org.apache.maven.plugins:maven-compiler-plugin [DEBUG] Could not find metadata org.apache.maven.plugins:maven-compiler-plugin/maven-metadata.xml in local (C:\Users\s.s lavic\.m2\repository) [DEBUG] [DEBUG] Using connector WagonRepositoryConnector with priority 0 for https://repo.foo-bar.com/content/groups/mirro r-of-central as s.slavic Using connector WagonRepositoryConnector with priority 0 for http://repository.springsource.com/maven/bundles/release [DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://maven.springframework.org/release Downloading: http://repository.springsource.com/maven/bundles/release/org/apache/maven/plugins/maven-compiler-plugin/mav en-metadata.xml Downloading: https://repo.foo-bar.com/content/groups/mirror-of-central/org/apache/maven/plugins/maven-compiler-plugin/mave n-metadata.xml Downloading: http://maven.springframework.org/release/org/apache/maven/plugins/maven-compiler-plugin/maven-metadata.xml [DEBUG] Reading resolution tracking file C:\Users\s.slavic\.m2\repository\org\apache\maven\plugins\maven-compiler-plugin \resolver-status.properties [DEBUG] Writing resolution tracking file C:\Users\s.slavic\.m2\repository\org\apache\maven\plugins\maven-compiler-plugin \resolver-status.properties [DEBUG] Reading resolution tracking file C:\Users\s.slavic\.m2\repository\org\apache\maven\plugins\maven-compiler-plugin \resolver-status.properties [DEBUG] Writing resolution tracking file C:\Users\s.slavic\.m2\repository\org\apache\maven\plugins\maven-compiler-plugin \resolver-status.properties [DEBUG] Reading resolution tracking file C:\Users\s.slavic\.m2\repository\org\apache\maven\plugins\maven-compiler-plugin \resolver-status.properties [DEBUG] Writing resolution tracking file C:\Users\s.slavic\.m2\repository\org\apache\maven\plugins\maven-compiler-plugin \resolver-status.properties [DEBUG] Could not find metadata org.apache.maven.plugins:maven-compiler-plugin/maven-metadata.xml in repository.plugin.s pringsource.release (http://repository.springsource.com/maven/bundles/release) [DEBUG] Could not find metadata org.apache.maven.plugins:maven-compiler-plugin/maven-metadata.xml in repository.springfr amework.maven.release (http://maven.springframework.org/release) [WARNING] Could not transfer metadata org.apache.maven.plugins:maven-compiler-plugin/maven-metadata.xml from/to foo-bar-mi rror-central (https://repo.foo-bar.com/content/groups/mirror-of-central): Access denied to: https://repo.foo-bar.com/content /groups/mirror-of-central/org/apache/maven/plugins/maven-compiler-plugin/maven-metadata.xml org.sonatype.aether.transfer.MetadataTransferException: Could not transfer metadata org.apache.maven.plugins:maven-compi ler-plugin/maven-metadata.xml from/to foo-bar-mirror-central (https://repo.foo-bar.com/content/groups/mirror-of-central): Ac cess denied to: https://repo.foo-bar.com/content/groups/mirror-of-central/org/apache/maven/plugins/maven-compiler-plugin/m aven-metadata.xml at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$3.wrap(WagonRepositoryConnector.java:932) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$3.wrap(WagonRepositoryConnector.java:923) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:695) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:689) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.get(WagonRepositoryConnector.java:445) at org.sonatype.aether.impl.internal.DefaultMetadataResolver$ResolveTask.run(DefaultMetadataResolver.java:567) at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:64) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: org.apache.maven.wagon.authorization.AuthorizationException: Access denied to: https://repo.foo-bar.com/content /groups/mirror-of-central/org/apache/maven/plugins/maven-compiler-plugin/maven-metadata.xml at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:119) at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116) at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88) at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61) at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:608) ... 4 more [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Spring Data Commons Parent ........................ FAILURE [1.764s] [INFO] Spring Data Commons Core .......................... SKIPPED [INFO] Spring Data Commons Distribution .................. SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.229s [INFO] Finished at: Fri May 13 17:45:42 CEST 2011 [INFO] Final Memory: 5M/490M [INFO] ------------------------------------------------------------------------ [ERROR] Error resolving version for plugin 'org.apache.maven.plugins:maven-compiler-plugin' from the repositories [local (C:\Users\s.slavic\.m2\repository), repository.plugin.springsource.release (http://repository.springsource.com/maven/bu ndles/release), repository.springframework.maven.release (http://maven.springframework.org/release), foo-bar-mirror-centra l (https://repo.foo-bar.com/content/groups/mirror-of-central)]: Plugin not found in any plugin repository -> [Help 1] org.apache.maven.plugin.version.PluginVersionResolutionException: Error resolving version for plugin 'org.apache.maven.p lugins:maven-compiler-plugin' from the repositories [local (C:\Users\s.slavic\.m2\repository), repository.plugin.springs ource.release (http://repository.springsource.com/maven/bundles/release), repository.springframework.maven.release (http ://maven.springframework.org/release), foo-bar-mirror-central (https://repo.foo-bar.com/content/groups/mirror-of-central)]: Plugin not found in any plugin repository at org.apache.maven.plugin.version.internal.DefaultPluginVersionResolver.selectVersion(DefaultPluginVersionResol ver.java:237) at org.apache.maven.plugin.version.internal.DefaultPluginVersionResolver.resolveFromRepository(DefaultPluginVers ionResolver.java:149) at org.apache.maven.plugin.version.internal.DefaultPluginVersionResolver.resolve(DefaultPluginVersionResolver.ja va:97) at org.apache.maven.lifecycle.internal.LifecyclePluginResolver.resolveMissingPluginVersions(LifecyclePluginResol ver.java:72) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLif ecycleExecutionPlanCalculator.java:110) at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLif ecycleExecutionPlanCalculator.java:129) at org.apache.maven.lifecycle.internal.BuilderCommon.resolveBuildPlan(BuilderCommon.java:92) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) 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:597) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) [ERROR] [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginVersionResolutionException