org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error retrieving previous build number for artifact '$PROJECT:$SUBPROJECT:pom': repository metadata for: 'snapshot $PROJECT:$SUBPROJECT:$VERSION-SNAPSHOT' could not be retrieved from repository: $M2_REPO due to an error: While configuring wagon for '$M2_REPO': Unable to apply wagon configuration.

Jenkins JIRA | Costin Caraivan | 7 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Hello, I'm trying to configure the timeout settings of the Maven used by Hudson. These are the settings: <configuration> <wagonProvider>lightweight</wagonProvider> <timeout>120000</timeout> </configuration> Maven version used, 2.2.1. If I use the "Build section -> Goals and options", and use Maven to deploy directly, Maven picks up the config correctly. If, however, I want everything deployed at the end, using "Deploy artifacts to Maven repository", the build fails: ERROR: Error retrieving previous build number for artifact '$PROJECT:$SUBPROJECT:pom': repository metadata for: 'snapshot $PROJECT:$SUBPROJECT:$VERSION-SNAPSHOT' could not be retrieved from repository: $M2_REPO due to an error: While configuring wagon for '$M2_REPO': Unable to apply wagon configuration. org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error retrieving previous build number for artifact '$PROJECT:$SUBPROJECT:pom': repository metadata for: 'snapshot $PROJECT:$SUBPROJECT:$VERSION-SNAPSHOT' could not be retrieved from repository: $M2_REPO due to an error: While configuring wagon for '$M2_REPO': Unable to apply wagon configuration. at org.apache.maven.artifact.transform.SnapshotTransformation.transformForDeployment(SnapshotTransformation.java:106) at org.apache.maven.artifact.transform.DefaultArtifactTransformationManager.transformForDeployment(DefaultArtifactTransformationManager.java:78) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:71) at hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:119) at hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:79) at hudson.maven.RedeployPublisher.perform(RedeployPublisher.java:96) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:480) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:466) at hudson.maven.MavenModuleSetBuild$RunnerImpl.post2(MavenModuleSetBuild.java:590) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:438) at hudson.model.Run.run(Run.java:1140) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:300) at hudson.model.ResourceController.execute(ResourceController.java:93) at hudson.model.Executor.run(Executor.java:122) Caused by: org.apache.maven.artifact.repository.metadata.RepositoryMetadataResolutionException: repository metadata for: 'snapshot $PROJECT:$SUBPROJECT:$VERSION-SNAPSHOT' could not be retrieved from repository: $M2_REPO due to an error: While configuring wagon for '$M2_REPO': Unable to apply wagon configuration. at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolveAlways(DefaultRepositoryMetadataManager.java:352) at org.apache.maven.artifact.transform.SnapshotTransformation.resolveLatestSnapshotBuildNumber(SnapshotTransformation.java:161) at org.apache.maven.artifact.transform.SnapshotTransformation.transformForDeployment(SnapshotTransformation.java:100) ... 14 more Caused by: org.apache.maven.artifact.manager.WagonConfigurationException: While configuring wagon for '$M2_REPO': Unable to apply wagon configuration. at org.apache.maven.artifact.manager.DefaultWagonManager.configureWagon(DefaultWagonManager.java:1004) at org.apache.maven.artifact.manager.DefaultWagonManager.configureWagon(DefaultWagonManager.java:980) at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:400) at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifactMetadataFromDeploymentRepository(DefaultWagonManager.java:379) at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.getArtifactMetadataFromDeploymentRepository(DefaultRepositoryMetadataManager.java:380) at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolveAlways(DefaultRepositoryMetadataManager.java:348) ... 16 more Caused by: org.codehaus.plexus.component.configurator.ComponentConfigurationException: Cannot find setter nor field in org.apache.maven.wagon.providers.http.LightweightHttpWagon for 'wagonProvider' at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.<init>(ComponentValueSetter.java:68) at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:134) at org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:56) at org.codehaus.plexus.component.configurator.AbstractComponentConfigurator.configureComponent(AbstractComponentConfigurator.java:54) at org.codehaus.plexus.component.configurator.AbstractComponentConfigurator.configureComponent(AbstractComponentConfigurator.java:47) at org.apache.maven.artifact.manager.DefaultWagonManager.configureWagon(DefaultWagonManager.java:993) ... 21 more

    Jenkins JIRA | 7 years ago | Costin Caraivan
    org.apache.maven.artifact.deployer.ArtifactDeploymentException: Error retrieving previous build number for artifact '$PROJECT:$SUBPROJECT:pom': repository metadata for: 'snapshot $PROJECT:$SUBPROJECT:$VERSION-SNAPSHOT' could not be retrieved from repository: $M2_REPO due to an error: While configuring wagon for '$M2_REPO': Unable to apply wagon configuration.

    Root Cause Analysis

    1. org.codehaus.plexus.component.configurator.ComponentConfigurationException

      Cannot find setter nor field in org.apache.maven.wagon.providers.http.LightweightHttpWagon for 'wagonProvider'

      at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.<init>()
    2. Plexus
      AbstractComponentConfigurator.configureComponent
      1. org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.<init>(ComponentValueSetter.java:68)
      2. org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:134)
      3. org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:56)
      4. org.codehaus.plexus.component.configurator.AbstractComponentConfigurator.configureComponent(AbstractComponentConfigurator.java:54)
      5. org.codehaus.plexus.component.configurator.AbstractComponentConfigurator.configureComponent(AbstractComponentConfigurator.java:47)
      5 frames
    3. Maven
      DefaultArtifactDeployer.deploy
      1. org.apache.maven.artifact.manager.DefaultWagonManager.configureWagon(DefaultWagonManager.java:993)
      2. org.apache.maven.artifact.manager.DefaultWagonManager.configureWagon(DefaultWagonManager.java:980)
      3. org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:400)
      4. org.apache.maven.artifact.manager.DefaultWagonManager.getArtifactMetadataFromDeploymentRepository(DefaultWagonManager.java:379)
      5. org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.getArtifactMetadataFromDeploymentRepository(DefaultRepositoryMetadataManager.java:380)
      6. org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolveAlways(DefaultRepositoryMetadataManager.java:348)
      7. org.apache.maven.artifact.transform.SnapshotTransformation.resolveLatestSnapshotBuildNumber(SnapshotTransformation.java:161)
      8. org.apache.maven.artifact.transform.SnapshotTransformation.transformForDeployment(SnapshotTransformation.java:100)
      9. org.apache.maven.artifact.transform.DefaultArtifactTransformationManager.transformForDeployment(DefaultArtifactTransformationManager.java:78)
      10. org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:71)
      10 frames
    4. Legacy Maven 2 job type Plugin
      MavenAggregatedArtifactRecord.deploy
      1. hudson.maven.reporters.MavenArtifactRecord.deploy(MavenArtifactRecord.java:119)
      2. hudson.maven.reporters.MavenAggregatedArtifactRecord.deploy(MavenAggregatedArtifactRecord.java:79)
      2 frames
    5. Hudson Maven Embedder
      RedeployPublisher.perform
      1. hudson.maven.RedeployPublisher.perform(RedeployPublisher.java:96)
      1 frame
    6. Hudson
      AbstractBuild$AbstractRunner.performAllBuildStep
      1. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      2. hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:480)
      3. hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:466)
      3 frames
    7. Hudson Maven Embedder
      MavenModuleSetBuild$RunnerImpl.post2
      1. hudson.maven.MavenModuleSetBuild$RunnerImpl.post2(MavenModuleSetBuild.java:590)
      1 frame
    8. Hudson
      Run.run
      1. hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:438)
      2. hudson.model.Run.run(Run.java:1140)
      2 frames
    9. Hudson Maven Embedder
      MavenModuleSetBuild.run
      1. hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:300)
      1 frame
    10. Hudson
      Executor.run
      1. hudson.model.ResourceController.execute(ResourceController.java:93)
      2. hudson.model.Executor.run(Executor.java:122)
      2 frames