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

nexus-staging-maven-plugin: proxying to https host fails with ProxyInfo and BaseUrl protocols does not align!

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8
    • Fix Version/s: 2.8.1
    • Component/s: Build Tooling, Staging
    • Labels:
      None
    • Environment:
      nexus-staging-maven-plugin 1.5 and 1.6

      Description

      1. Nexus at https://localhost:8443
      2. use the regular maven-deploy-plugin to deploy to a local directory.
        https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-plugin#image-upload
      3. configure Maven settings.xml to have a proxy like:
         <proxy>
              <id>debug</id>
              <active>true</active>
              <protocol>http</protocol>
              <host>spunge.local</host>
              <port>8888</port>     
        <nonProxyHosts>fakehost</nonProxyHosts>
            </proxy>
        

        and setup a proxy that can proxy a tunnel to https hosts ( Charles Proxy )

      4. execute nexus-staging:deploy-staged-repository to the https://localhost:8443 instance
      5. build fails with
        > ./mvn nexus-staging:deploy-staged-repository -DnexusUrl=https://localhost:8443/nexus -DrepositoryDirectory=/Users/plynch/project/altDeployRepo -DstagingProfileId=1364e809b8f892e8 -DserverId=dist-release -e
        Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T13:37:52-04:00)
        Maven home: /Volumes/OSX/app/maven/latest
        Java version: 1.8.0, vendor: Oracle Corporation
        Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre
        Default locale: en_US, platform encoding: UTF-8
        OS name: "mac os x", version: "10.9.2", arch: "x86_64", family: "mac"
        [INFO] Error stacktraces are turned on.
        [INFO] Scanning for projects...
        [INFO] Inspecting build with total of 1 modules...
        [INFO] Not installing Nexus Staging features:
        [INFO]  * Preexisting staging related goal bindings found in 1 modules.
        [INFO] 
        [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
        [INFO]                                                                         
        [INFO] ------------------------------------------------------------------------
        [INFO] Building staging-test 1.0
        [INFO] ------------------------------------------------------------------------
        [INFO] 
        [INFO] --- nexus-staging-maven-plugin:1.6:deploy-staged-repository (default-cli) @ staging-test-project ---
        [INFO] Staging remotely locally deployed repository...
        [INFO]  + Using server credentials "dist-snapshot" from Maven settings.
        [INFO]  + Using "debug" HTTP Proxy from Maven settings
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD FAILURE
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 0.895 s
        [INFO] Finished at: 2014-04-14T14:42:55-04:00
        [INFO] Final Memory: 12M/305M
        [INFO] ------------------------------------------------------------------------
        [ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6:deploy-staged-repository (default-cli) on project staging-test-project: Execution default-cli of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6:deploy-staged-repository failed: Nexus connection problem to URL [https://localhost:8443/nexus ]: ProxyInfo and BaseUrl protocols does not align! -> [Help 1]
        org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6:deploy-staged-repository (default-cli) on project staging-test-project: Execution default-cli of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6:deploy-staged-repository failed: Nexus connection problem to URL [https://localhost:8443/nexus ]: ProxyInfo and BaseUrl protocols does not align!
        	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
        	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:108)
        	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
        	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
        	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
        	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
        	at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
        	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:483)
        	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: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6:deploy-staged-repository failed: Nexus connection problem to URL [https://localhost:8443/nexus ]: ProxyInfo and BaseUrl protocols does not align!
        	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:144)
        	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        	... 19 more
        Caused by: java.lang.IllegalArgumentException: Nexus connection problem to URL [https://localhost:8443/nexus ]: ProxyInfo and BaseUrl protocols does not align!
        	at org.sonatype.nexus.maven.staging.remote.RemoteNexus.createNexusClient(RemoteNexus.java:209)
        	at org.sonatype.nexus.maven.staging.remote.RemoteNexus.<init>(RemoteNexus.java:103)
        	at org.sonatype.nexus.maven.staging.deploy.strategy.AbstractStagingDeployStrategy.createRemoteNexus(AbstractStagingDeployStrategy.java:56)
        	at org.sonatype.nexus.maven.staging.deploy.strategy.ImageDeployStrategy.finalizeDeploy(ImageDeployStrategy.java:72)
        	at org.sonatype.nexus.maven.staging.deploy.DeployRepositoryMojo.execute(DeployRepositoryMojo.java:88)
        	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
        	... 20 more
        Caused by: java.lang.IllegalArgumentException: ProxyInfo and BaseUrl protocols does not align!
        	at org.sonatype.nexus.client.rest.jersey.NexusClientFactoryImpl.applyProxyIfAny(NexusClientFactoryImpl.java:284)
        	at org.sonatype.nexus.client.rest.jersey.NexusClientFactoryImpl.doCreateHttpClientFor(NexusClientFactoryImpl.java:141)
        	at org.sonatype.nexus.client.rest.jersey.NexusClientFactoryImpl.createFor(NexusClientFactoryImpl.java:123)
        	at org.sonatype.nexus.maven.staging.remote.RemoteNexus.createNexusClient(RemoteNexus.java:190)
        	... 25 more
        [ERROR] 
        [ERROR] Re-run Maven using the -X switch to enable full debug logging.
        [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/PluginExecutionException
        

      Expected: Proxy server at http is used to tunnel an https connection to nexus host when Maven proxy is active AND (proxy protocol is not set OR is set to protocol matching the remote host)

      If we change proxy protocol to https, this fails as well, because Staging tries to talk https on http proxy port.

      Remote staging failed: IO failure: Unrecognized SSL message, plaintext connection?
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title