Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-6574

add better error handling when the nexusUrl contains an obviously wrong value

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Build Tooling, Staging
    • Labels:
      None
    • Environment:
      1.6.1
    • Sprint:
      Sprint 16

      Description

      It is very common for users to give the wrong URL to the required nexus-staging-maven-plugin parameter nexusUrl.

      Typically this fails with a seemingly unrelated error message. Example:

      [DEBUG] Configuring mojo 'org.sonatype.plugins:nexus-staging-maven-plugin:1.6.1:deploy' with basic configurator -->
      [DEBUG]   (f) artifact = com.ccadllc.bundles:lucene:bundle:4.5.0
      [DEBUG]   (f) attachedArtifacts = [com.ccadllc.bundles:lucene:java-source:sources:4.5.0]
      [DEBUG]   (f) autoDropAfterRelease = true
      [DEBUG]   (f) autoReleaseAfterClose = false
      [DEBUG]   (f) detectBuildFailures = true
      [DEBUG]   (f) keepStagingRepositoryOnCloseRuleFailure = true
      [DEBUG]   (f) keepStagingRepositoryOnFailure = true
      [DEBUG]   (f) mavenSession = org.apache.maven.execution.MavenSession@1cdfd19
      [DEBUG]   (f) mojoExecution = org.sonatype.plugins:nexus-staging-maven-plugin:1.6.1:deploy {execution: default}
      [DEBUG]   (f) nexusUrl = https://localhost:8081/nexus/service/local/staging/deploy/maven2/
      [DEBUG]   (f) offline = false
      [DEBUG]   (f) packaging = bundle
      [DEBUG]   (f) pluginArtifactId = nexus-staging-maven-plugin
      [DEBUG]   (f) pluginGroupId = org.sonatype.plugins
      [DEBUG]   (f) pluginVersion = 1.6.1
      [DEBUG]   (f) pomFile = /home/user/development/bundles/lucene/pom.xml
      [DEBUG]   (f) serverId = bundles-releases
      [DEBUG]   (f) sslAllowAll = true
      [DEBUG]   (f) sslInsecure = false
      [DEBUG]   (f) stagingProfileId = fa9605f3c35a4
      [DEBUG]   (f) stagingProgressPauseDurationSeconds = 3
      [DEBUG]   (f) stagingProgressTimeoutMinutes = 5
      [DEBUG] -- end configuration --
      [DEBUG] Parameters{pluginGav='org.sonatype.plugins:nexus-staging-maven-plugin:1.6.1', deferredDirectoryRoot=/home/user/development/bundles/lucene/target/nexus-staging/deferred, stagingDirectoryRoot=/home/user/development/bundles/lucene/target/nexus-staging/staging, nexusUrl='https://localhost/nexus/service/local/staging/deploy/maven2/', serverId='bundles-releases', keepStagingRepositoryOnCloseRuleFailure=true, keepStagingRepositoryOnFailure=false, skipStagingRepositoryClose=false, autoReleaseAfterClose=false, autoDropAfterRelease=true, stagingProfileId='null', stagingRepositoryId='null', stagingActionMessages=org.sonatype.nexus.maven.staging.StagingActionMessages@ab7af2, tags=null, stagingProgressTimeoutMinutes=5, stagingProgressPauseDurationSeconds=3, sslInsecure=false, sslAllowAll=true}
      [DEBUG] Parameters{pluginGav='org.sonatype.plugins:nexus-staging-maven-plugin:1.6.1', deferredDirectoryRoot=/home/user/development/bundles/lucene/target/nexus-staging/deferred, stagingDirectoryRoot=/home/user/development/bundles/lucene/target/nexus-staging/staging, nexusUrl='https://localhost/nexus/service/local/staging/deploy/maven2/', serverId='bundles-releases', keepStagingRepositoryOnCloseRuleFailure=true, keepStagingRepositoryOnFailure=true, skipStagingRepositoryClose=false, autoReleaseAfterClose=false, autoDropAfterRelease=true, stagingProfileId='fa9605f3c35a4', stagingRepositoryId='null', stagingActionMessages=org.sonatype.nexus.maven.staging.StagingActionMessages@ab7af2, tags=null, stagingProgressTimeoutMinutes=5, stagingProgressPauseDurationSeconds=3, sslInsecure=false, sslAllowAll=true}
      [INFO] Performing local staging (local stagingDirectory="/home/user/development/bundles/lucene/target/nexus-staging/staging")...
      [main] INFO org.sonatype.nexus.maven.staging.remote.RemoteNexus -  + Using server credentials "bundles-releases" from Maven settings.
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 7.520s
      [INFO] Finished at: Thu May 08 13:43:13 EDT 2014
      [INFO] Final Memory: 13M/490M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.1:deploy (default) on project lucene: Execution default of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.1:deploy failed: Nexus connection problem to URL [https://localhost/nexus/service/local/staging/deploy/maven2/ ]: Cannot find a matching staging profile -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.1:deploy (default) on project lucene: Execution default of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.1:deploy failed: Nexus connection problem to URL [https://localhost/nexus/service/local/staging/deploy/maven2/ ]: Cannot find a matching staging profile
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      	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:320)
      	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:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:616)
      	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)
      Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.1:deploy failed: Nexus connection problem to URL [https://localhost/nexus/service/local/staging/deploy/maven2/ ]: Cannot find a matching staging profile
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      	... 19 more
      Caused by: java.lang.IllegalArgumentException: Nexus connection problem to URL [https://localhost/nexus/service/local/staging/deploy/maven2/ ]: Cannot find a matching staging profile
      	at org.sonatype.nexus.maven.staging.remote.RemoteNexus.createNexusClient(RemoteNexus.java:210)
      	at org.sonatype.nexus.maven.staging.remote.RemoteNexus.<init>(RemoteNexus.java:104)
      	at org.sonatype.nexus.maven.staging.deploy.strategy.AbstractStagingDeployStrategy.createRemoteNexus(AbstractStagingDeployStrategy.java:56)
      	at org.sonatype.nexus.maven.staging.deploy.strategy.StagingDeployStrategy.deployPerModule(StagingDeployStrategy.java:73)
      	at org.sonatype.nexus.maven.staging.deploy.DeployMojo.execute(DeployMojo.java:192)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      	... 20 more
      Caused by: org.sonatype.nexus.client.core.exception.NexusClientErrorResponseException: Cannot find a matching staging profile
      	at org.sonatype.nexus.client.rest.jersey.JerseyNexusClient.convertIf400WithErrorMessage(JerseyNexusClient.java:257)
      	at org.sonatype.nexus.client.rest.jersey.JerseyNexusClient.convertIfKnown(JerseyNexusClient.java:292)
      	at org.sonatype.nexus.client.rest.jersey.JerseyNexusClient.convert(JerseyNexusClient.java:268)
      	at org.sonatype.nexus.client.rest.jersey.JerseyNexusClient.getStatus(JerseyNexusClient.java:157)
      	at org.sonatype.nexus.client.internal.rest.AbstractNexusClient.initializeConnection(AbstractNexusClient.java:87)
      	at org.sonatype.nexus.client.rest.jersey.JerseyNexusClient.<init>(JerseyNexusClient.java:91)
      	at org.sonatype.nexus.client.rest.jersey.NexusClientFactoryImpl.createFor(NexusClientFactoryImpl.java:123)
      	at org.sonatype.nexus.maven.staging.remote.RemoteNexus.createNexusClient(RemoteNexus.java:191)
      	... 25 more
      [ERROR] 
      

      We should do a better job validating this URL value.

        Attachments

          Activity

            People

            Assignee:
            plynch Peter Lynch
            Reporter:
            plynch Peter Lynch
            Last Updated By:
            Peter Lynch
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                tigCommentSecurity.panel-title