title: Failed while enforcing Artifactory artifact resolver
body: <p>Disclaimer: I can't post the full <code>pom.xml</code> file of my project here due to nondisclosure restrictions. However I extracted relevant portions to illustrate the problem that I'm running into. My organization has recently purchased Artifactory and I'm working to integrate an automated CI/CD build pipeline in Gitlab, so I've been trying to follow along with <a href="https://jfrog.com/blog/gitlab-and-artifactory-on-your-mark-get-set-build/" rel="nofollow noreferrer">the official tutorial on the JFrog website</a>.</p>
  
  <p>The command that the pipeline fails on is where it actually calls maven (via the JFrog CLI):</p>
  
  <pre><code>./jfrog rt mvn "clean compile install package -DskipTests" configuration.yml --build-name=gitlabci-maven-artifactory --build-number=$CI_JOB_ID
  </code></pre>
  
  <p>The error message that shows up looks something like this. And it actually just hangs after this point; the JFrog CLI doesn't return with an exit codes, so I end up having to kill the Gitlab pipeline.</p>
  
  <pre><code>$ ./jfrog rt mvn "clean compile install package -DskipTests" configuration.yml --build-name=gitlabci-maven-artifactory --build-number=$CI_JOB_ID
  [Info] Running Mvn...
  [Info] Downloading jfrog/jfrog-jars/org/jfrog/buildinfo/build-info-extractor-maven3/2.9.2/build-info-extractor-maven3-2.9.2-uber.jar
  [Info] [1]: 206 Partial Content...
  [Info] [0]: 206 Partial Content...
  [Info] [2]: 206 Partial Content...
  [Info] Done downloading.
  [Info] Downloaded 1 artifact.
  ...
  [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Scanning for projects...
  [main] INFO org.jfrog.build.extractor.maven.BuildInfoRecorder - Initializing Artifactory Build-Info Recording
  [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - 
  [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - -------------------&lt; com.mydomain:myproject &gt;-------------------
  [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - Building MyProject 1.0.0
  [main] INFO org.apache.maven.cli.event.ExecutionEventLogger - --------------------------------[ jar ]---------------------------------
  [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.schedule (BeanScheduler.java:151)
      at org.eclipse.sisu.plexus.PlexusLifecycleManager.manage (PlexusLifecycleManager.java:147)
      at org.eclipse.sisu.plexus.PlexusBeanBinder.afterInjection (PlexusBeanBinder.java:72)
      at com.google.inject.internal.MembersInjectorImpl.notifyListeners (MembersInjectorImpl.java:119)
      at com.google.inject.internal.ConstructorInjector.provision (ConstructorInjector.java:115)
      at com.google.inject.internal.ConstructorInjector.access$000 (ConstructorInjector.java:32)
      at com.google.inject.internal.ConstructorInjector$1.call (ConstructorInjector.java:89)
      at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:115)
      at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:133)
      at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:68)
      at com.google.inject.internal.ConstructorInjector.construct (ConstructorInjector.java:87)
      at com.google.inject.internal.ConstructorBindingImpl$Factory.get (ConstructorBindingImpl.java:267)
      at com.google.inject.internal.InjectorImpl$2$1.call (InjectorImpl.java:1016)
      at com.google.inject.internal.InjectorImpl.callInContext (InjectorImpl.java:1103)
      at com.google.inject.internal.InjectorImpl$2.get (InjectorImpl.java:1012)
      at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1051)
      at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
      at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:81)
      at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:53)
      at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:65)
      at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:115)
      at org.eclipse.sisu.bean.BeanScheduler$CycleActivator.onProvision (BeanScheduler.java:230)
      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:97)
      at org.eclipse.aether.internal.impl.DefaultArtifactResolver.artifactResolving (DefaultArtifactResolver.java:640)
      at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:254)
      at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:224)
      at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:201)
      at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom (DefaultArtifactDescriptorReader.java:261)
      at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor (DefaultArtifactDescriptorReader.java:192)
      at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor (DefaultRepositorySystem.java:253)
      at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve (DefaultPluginDependenciesResolver.java:103)
      at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor (DefaultMavenPluginManager.java:181)
      at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor (DefaultMavenPluginManager.java:286)
      at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor (DefaultBuildPluginManager.java:244)
      at org.apache.maven.lifecycle.internal.DefaultLifecycleMappingDelegate.calculateLifecycleMappings (DefaultLifecycleMappingDelegate.java:115)
      at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateLifecycleMappings (DefaultLifecycleExecutionPlanCalculator.java:265)
      at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateMojoExecutions (DefaultLifecycleExecutionPlanCalculator.java:216)
      at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:126)
      at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:144)
      at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan (BuilderCommon.java:96)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:110)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
      at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:498)
      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:4189)
      at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263)
      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.schedule (BeanScheduler.java:151)
      at org.eclipse.sisu.plexus.PlexusLifecycleManager.manage (PlexusLifecycleManager.java:147)
      at org.eclipse.sisu.plexus.PlexusBeanBinder.afterInjection (PlexusBeanBinder.java:72)
      at com.google.inject.internal.MembersInjectorImpl.notifyListeners (MembersInjectorImpl.java:119)
      at com.google.inject.internal.ConstructorInjector.provision (ConstructorInjector.java:115)
      at com.google.inject.internal.ConstructorInjector.access$000 (ConstructorInjector.java:32)
      at com.google.inject.internal.ConstructorInjector$1.call (ConstructorInjector.java:89)
      at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:115)
      at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:133)
      at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:68)
      at com.google.inject.internal.ConstructorInjector.construct (ConstructorInjector.java:87)
      at com.google.inject.internal.ConstructorBindingImpl$Factory.get (ConstructorBindingImpl.java:267)
      at com.google.inject.internal.InjectorImpl$2$1.call (InjectorImpl.java:1016)
      at com.google.inject.internal.InjectorImpl.callInContext (InjectorImpl.java:1103)
      at com.google.inject.internal.InjectorImpl$2.get (InjectorImpl.java:1012)
      at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1051)
      at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
      at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:81)
      at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:53)
      at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:65)
      at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:115)
      at org.eclipse.sisu.bean.BeanScheduler$CycleActivator.onProvision (BeanScheduler.java:230)
      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:97)
      at org.eclipse.aether.internal.impl.DefaultArtifactResolver.artifactResolving (DefaultArtifactResolver.java:640)
      at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:254)
      at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:224)
      at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:201)
      at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom (DefaultArtifactDescriptorReader.java:261)
      at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor (DefaultArtifactDescriptorReader.java:192)
      at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor (DefaultRepositorySystem.java:253)
      at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve (DefaultPluginDependenciesResolver.java:103)
      at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor (DefaultMavenPluginManager.java:181)
      at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor (DefaultMavenPluginManager.java:286)
      at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor (DefaultBuildPluginManager.java:244)
      at org.apache.maven.lifecycle.internal.DefaultLifecycleMappingDelegate.calculateLifecycleMappings (DefaultLifecycleMappingDelegate.java:115)
      at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateLifecycleMappings (DefaultLifecycleExecutionPlanCalculator.java:265)
      at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateMojoExecutions (DefaultLifecycleExecutionPlanCalculator.java:216)
      at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:126)
      at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan (DefaultLifecycleExecutionPlanCalculator.java:144)
      at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan (BuilderCommon.java:96)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:110)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
      at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:498)
      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)
  [main] WARNING org.eclipse.aether.internal.impl.DefaultRepositoryEventDispatcher - Failed to dispatch repository event to org.jfrog.build.extractor.maven.resolver.ArtifactoryEclipseRepositoryListener: null
  Downloading from central: http://repo1.maven.org/maven2/org/springframework/boot/spring-boot-maven-plugin/2.0.1.RELEASE/spring-boot-maven-plugin-2.0.1.RELEASE.pom
  Progress (1): 4.1/4.8 kB
  Progress (1): 4.8 kB    
  
  Downloaded from central: http://repo1.maven.org/maven2/org/springframework/boot/spring-boot-maven-plugin/2.0.1.RELEASE/spring-boot-maven-plugin-2.0.1.RELEASE.pom (4.8 kB at 226 kB/s)
  </code></pre>
  
  <p>In my POM file, I am referencing the Maven Central repo along with Artifactory as <code>libs-release</code> and <code>libs-snapshot</code>. I use <code>libs-release-local</code> and <code>libs-snapshot-local</code> in the <code>&lt;distributionManagement&gt;</code> section. It seems like it's downloading all the dependencies OK; however I'm not sure why it's getting hung on this <code>ArtifactoryEclipseArtifactResolver</code> bit.</p>
  
  <p>I'm not really sure how to proceed. This seems pretty clearly like a problem with the JFrog CLI (or perhaps the way I'm invoking it), as I can run regular Maven on my local system and get everything working. But I'm not sure how to fix this and get the CI/CD working.</p>