Uploaded image for project: 'Jenkins Artifactory Plug-in'
  1. Jenkins Artifactory Plug-in
  2. HAP-954

Maven builds fail with ComponentLookupException when having a maven extensions.xml file in project

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.5.0
    • Component/s: Maven3
    • Labels:
      None

      Description

      Have the following in .mvn/extensions.xml in my project:

      <?xml version="1.0" encoding="UTF-8"?>
      <extensions>
      	<extension>
      		<groupId>io.takari.maven</groupId>
      		<artifactId>takari-smart-builder</artifactId>
      		<version>0.5.0</version>
      	</extension>
      	<extension>
      		<groupId>io.takari.aether</groupId>
      		<artifactId>takari-concurrent-localrepo</artifactId>
      		 <version>0.0.7</version>
      	</extension>
      	<extension>
      		<groupId>io.takari.aether</groupId>
      		<artifactId>aether-connector-okhttp</artifactId>
      		<version>1.0.1-alpha</version>
      	</extension>	
      </extensions>
      

      This is needed for thread-safe multithreaded multi-module builds. These extensions would normally only be invoked passing --builder smart when invoking mvn.

      With artifactory plugin, I get the following exception just by having that file present but not invoking --builder smart

      [eature_jenkins-staged-build-ODERDWEQO2CZLFQ55CNVTN5HSO6IA557XQUPPEP6WCBJFNOHFLXA] $ /opt/java_1.8_64/bin/java -classpath /opt/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.3.9/boot/plexus-classworlds-2.5.2.jar -Dmaven.home=/opt/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.3.9 -DbuildInfoConfig.propertiesFile=/tmp/buildInfo2408750196954894694.properties -Dm3plugin.lib=/opt/jenkins/cache/artifactory-plugin/2.12.0 -Dclassworlds.conf=/tmp/classworlds2689192953410105179conf -Dmaven.multiModuleProjectDirectory=/opt/jenkins/workspace/eature_jenkins-staged-build-ODERDWEQO2CZLFQ55CNVTN5HSO6IA557XQUPPEP6WCBJFNOHFLXA -Xmx1024m org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml clean install -DskipTests -Pci -U -Dmaven.repo.local=.repository
      [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Scanning for projects...
      [main] ERROR org.jfrog.build.extractor.maven.resolver.ArtifactoryEclipseRepositoryListener - Failed while enforcing Artifactory artifact resolver
      org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException
            role: org.jfrog.build.extractor.maven.resolver.ArtifactoryEclipseArtifactResolver
        roleHint: 
      	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:267)
      	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:243)
      	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:237)
      	at org.jfrog.build.extractor.maven.resolver.ArtifactoryEclipseRepositoryListener.enforceArtifactoryResolver(ArtifactoryEclipseRepositoryListener.java:71)
      	at org.jfrog.build.extractor.maven.resolver.ArtifactoryEclipseRepositoryListener.contextualize(ArtifactoryEclipseRepositoryListener.java:258)
      	at org.eclipse.sisu.plexus.PlexusLifecycleManager.contextualize(PlexusLifecycleManager.java:282)
      	at org.eclipse.sisu.plexus.PlexusLifecycleManager.activate(PlexusLifecycleManager.java:203)
      	at org.eclipse.sisu.bean.BeanScheduler$Pending.activate(BeanScheduler.java:156)
      	at org.eclipse.sisu.bean.BeanScheduler$Activator.onProvision(BeanScheduler.java:185)
      	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:126)
      	at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
      	at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)
      	at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
      	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
      	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
      	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
      	at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
      	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
      	at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
      	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
      	at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
      	at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
      	at org.eclipse.sisu.wire.EntrySetAdapter$ValueIterator.next(EntrySetAdapter.java:102)
      	at org.eclipse.aether.internal.impl.DefaultRepositoryEventDispatcher.dispatch(DefaultRepositoryEventDispatcher.java:91)
      	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.artifactResolving(DefaultArtifactResolver.java:662)
      	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:276)
      	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
      	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
      	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:294)
      	at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:193)
      	at org.apache.maven.model.building.DefaultModelBuilder.importDependencyManagement(DefaultModelBuilder.java:1192)
      	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:455)
      	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:421)
      	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:620)
      	at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:411)
      	at org.apache.maven.graph.DefaultGraphBuilder.collectProjects(DefaultGraphBuilder.java:419)
      	at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor(DefaultGraphBuilder.java:410)
      	at org.apache.maven.graph.DefaultGraphBuilder.build(DefaultGraphBuilder.java:83)
      	at org.apache.maven.DefaultMaven.buildGraph(DefaultMaven.java:491)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:219)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
      	at java.lang.reflect.Method.invoke(Method.java:507)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      Caused by: java.util.NoSuchElementException
      	at java.util.Collections$EmptyIterator.next(Collections.java:4200)
      	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
      	... 52 more
      

      Removing the .mvn/extensions.xml file allows the build to proceed, but I can't then do multi-threaded multi-module builds.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                yahavi Yahav Itzhak
                Reporter:
                jon.gunnip Jon Gunnip
              • Votes:
                3 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: