org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized.

Sonatype JIRA | Peter Lynch | 7 months ago
  1. 0

    Using the standard {{mvn deploy:deploy-file}} to a Nexus 3 maven repository, **when a server section with matching id in ~/.m2/settings.xml is not configured properly**, then Maven throws a broken pipe exception instead of reporting the 401 unauthorized from Nexus. This causes a retry death spiral and changes the behaviour of how Maven would normally react. Using the same scenario with Nexus 2 causes Maven to report the 401 as expected and stop immediately. {noformat:title=Nexus 3} [DEBUG] Configuring mojo org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2, parent: sun.misc.Launcher$AppClassLoader@45ee12a7] [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file' with basic configurator --> [DEBUG] (f) artifactId = project [DEBUG] (f) file = /app/clm-testing/jenkins/hudson-2.2.1.war [DEBUG] (f) generatePom = true [DEBUG] (f) groupId = com.somecompany [DEBUG] (s) localRepository = id: local url: file:///Volumes/OSX/m2r/ layout: default snapshots: [enabled => true, update => always] releases: [enabled => true, update => always] [DEBUG] (f) offline = false [DEBUG] (f) packaging = war [DEBUG] (f) project = MavenProject: org.apache.maven:standalone-pom:1 @ [DEBUG] (f) repositoryId = local-nexu [DEBUG] (f) repositoryLayout = default [DEBUG] (f) retryFailedDeploymentCount = 1 [DEBUG] (f) uniqueVersion = true [DEBUG] (f) updateReleaseInfo = false [DEBUG] (f) url = http://localhost:9081/repository/maven-releases/ [DEBUG] (f) version = 1.0.0 [DEBUG] -- end configuration -- [DEBUG] Using transporter WagonTransporter with priority -1.0 for http://localhost:9081/repository/maven-releases/ [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://localhost:9081/repository/maven-releases/ via 127.0.0.1:8888 Uploading: http://localhost:9081/repository/maven-releases/com/somecompany/project/1.0.0/project-1.0.0.war May 16, 2016 10:14:55 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute INFO: I/O exception (java.net.SocketException) caught when processing request to {}->http://127.0.0.1:8888->http://localhost:9081: Broken pipe May 16, 2016 10:14:55 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute INFO: Retrying request to {}->http://127.0.0.1:8888->http://localhost:9081 May 16, 2016 10:14:55 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute INFO: I/O exception (java.net.SocketException) caught when processing request to {}->http://127.0.0.1:8888->http://localhost:9081: Broken pipe May 16, 2016 10:14:55 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute INFO: Retrying request to {}->http://127.0.0.1:8888->http://localhost:9081 May 16, 2016 10:14:55 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute INFO: I/O exception (java.net.SocketException) caught when processing request to {}->http://127.0.0.1:8888->http://localhost:9081: Broken pipe May 16, 2016 10:14:55 AM org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec execute INFO: Retrying request to {}->http://127.0.0.1:8888->http://localhost:9081 Uploading: http://localhost:9081/repository/maven-releases/com/somecompany/project/1.0.0/project-1.0.0.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.628 s [INFO] Finished at: 2016-05-16T10:14:55-03:00 [INFO] Final Memory: 12M/309M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:9081/repository/maven-releases/): Broken pipe -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:9081/repository/maven-releases/): Broken pipe at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216) 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:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) 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:862) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286) at org.apache.maven.cli.MavenCli.main(MavenCli.java:197) 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: org.apache.maven.plugin.MojoExecutionException: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:9081/repository/maven-releases/): Broken pipe at org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:284) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 20 more Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:9081/repository/maven-releases/): Broken pipe at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:143) at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:171) at org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:280) ... 22 more Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:9081/repository/maven-releases/): Broken pipe at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:317) at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:245) at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:413) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:139) ... 24 more Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:9081/repository/maven-releases/): Broken pipe at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43) at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355) at org.eclipse.aether.connector.basic.BasicRepositoryConnector.put(BasicRepositoryConnector.java:274) at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:311) ... 27 more Caused by: org.apache.maven.wagon.TransferFailedException: Broken pipe at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:646) at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:541) at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:523) at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:517) at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:497) at org.eclipse.aether.transport.wagon.WagonTransporter$PutTaskRunner.run(WagonTransporter.java:644) at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:427) at org.eclipse.aether.transport.wagon.WagonTransporter.put(WagonTransporter.java:410) at org.eclipse.aether.connector.basic.BasicRepositoryConnector$PutTaskRunner.runTask(BasicRepositoryConnector.java:510) at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350) ... 29 more Caused by: java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109) at java.net.SocketOutputStream.write(SocketOutputStream.java:153) at org.apache.maven.wagon.providers.http.httpclient.impl.io.SessionOutputBufferImpl.streamWrite(SessionOutputBufferImpl.java:123) at org.apache.maven.wagon.providers.http.httpclient.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:135) at org.apache.maven.wagon.providers.http.httpclient.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:164) at org.apache.maven.wagon.providers.http.httpclient.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:115) at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon$RequestEntityImplementation.writeTo(AbstractHttpClientWagon.java:205) at org.apache.maven.wagon.providers.http.httpclient.impl.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:155) at org.apache.maven.wagon.providers.http.httpclient.impl.conn.CPoolProxy.sendRequestEntity(CPoolProxy.java:149) at org.apache.maven.wagon.providers.http.httpclient.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:236) at org.apache.maven.wagon.providers.http.httpclient.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:121) at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainClientExec.execute(MainClientExec.java:254) at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195) at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec.execute(RetryExec.java:86) at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RedirectExec.execute(RedirectExec.java:108) at org.apache.maven.wagon.providers.http.httpclient.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.maven.wagon.providers.http.httpclient.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.execute(AbstractHttpClientWagon.java:832) at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:592) ... 38 more [ERROR] [ERROR] {noformat} {noformat:title=Nexus 2} [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.229 s [INFO] Finished at: 2016-05-16T10:19:45-03:00 [INFO] Final Memory: 9M/309M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized. at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216) 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:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) 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:862) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286) at org.apache.maven.cli.MavenCli.main(MavenCli.java:197) 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: org.apache.maven.plugin.MojoExecutionException: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized. at org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:284) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 20 more Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized. at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:143) at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:171) at org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:280) ... 22 more Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized. at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:317) at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:245) at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:413) at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:139) ... 24 more Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized. at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43) at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355) at org.eclipse.aether.connector.basic.BasicRepositoryConnector.put(BasicRepositoryConnector.java:274) at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:311) ... 27 more Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized. at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:627) at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:541) at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:523) at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:517) at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:497) at org.eclipse.aether.transport.wagon.WagonTransporter$PutTaskRunner.run(WagonTransporter.java:644) at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:427) at org.eclipse.aether.transport.wagon.WagonTransporter.put(WagonTransporter.java:410) at org.eclipse.aether.connector.basic.BasicRepositoryConnector$PutTaskRunner.runTask(BasicRepositoryConnector.java:510) at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350) ... 29 more [ERROR] [ERROR] {noformat} h3. Expected Nexus should report the 401 and fail immediately instead of getting a broken pipe - act like Nexus 2.x does.

    Sonatype JIRA | 7 months ago | Peter Lynch
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact com.somecompany:project:war:1.0.0 from/to local-nexu (http://localhost:8081/nexus/content/repositories/releases/): Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized.
  2. 0

    Deploy SNAPSHOT to oss.jfrog.org (JCenter)

    Stack Overflow | 2 years ago | xybrek
    org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://oss.jfrog.org/simple/oss-snapshot-local/com/myorg/mylibrary/com/myorg/mylibrary/0.0.1-SNAPSHOT/mylibrary-0.0 .1-20141211.050111-1.pom. Return code is: 409, ReasonPhrase: Conflict.
  3. 0

    Why am I getting a "401 Unauthorized" error in Maven?

    Stack Overflow | 2 years ago | aliteralmind
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project xbnjava: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Followup questions: Using Maven to only sign and deploy jars to Maven Central. Build and compilation is done entirely with Ant

    Stack Overflow | 2 years ago | aliteralmind
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project xbnjava: Failed to deploy artifacts: Could not transfer artifact com.github.xbn:xbnjava:pom:0.1.2-20140716.142845-1 from/to ossrh (https://oss.sonatype.org/content/repositories/snapshots): Failed to transfer file: https://oss.sonatype.org/content/repositories/snapshots/com/github/xbn/xbnjava/0.1.2-SNAPSHOT/xbnjava-0.1.2-20140716.142845-1.pom. Return code is: 401, ReasonPhrase: Unauthorized.
  6. 0

    Why am I getting a “401 Unauthorized” error in Maven?

    laihaomi.com | 1 year ago
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project xbnjava: Failed to deploy artifacts: Could not transfer artifact com.github.aliteralmind:xbnjava:pom:0.1.2 from/to sonatype-nexus-staging (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/com/github/aliteralmind/xbnjava/0.1.2/xbnjava-0.1.2.pom. Return code is: 401, ReasonPhrase: Unauthorized.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.apache.maven.wagon.TransferFailedException

      Failed to transfer file: http://localhost:8081/nexus/content/repositories/releases/com/somecompany/project/1.0.0/project-1.0.0.war. Return code is: 401, ReasonPhrase: Unauthorized.

      at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put()
    2. Maven
      AbstractHttpClientWagon.put
      1. org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:627)
      2. org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:541)
      3. org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:523)
      4. org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:517)
      5. org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:497)
      5 frames
    3. Aether Transport Wagon
      WagonTransporter.put
      1. org.eclipse.aether.transport.wagon.WagonTransporter$PutTaskRunner.run(WagonTransporter.java:644)
      2. org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:427)
      3. org.eclipse.aether.transport.wagon.WagonTransporter.put(WagonTransporter.java:410)
      3 frames
    4. Aether Connector Basic
      BasicRepositoryConnector.put
      1. org.eclipse.aether.connector.basic.BasicRepositoryConnector$PutTaskRunner.runTask(BasicRepositoryConnector.java:510)
      2. org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
      3. org.eclipse.aether.connector.basic.BasicRepositoryConnector.put(BasicRepositoryConnector.java:274)
      3 frames
    5. Aether Implementation
      DefaultRepositorySystem.deploy
      1. org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:311)
      2. org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:245)
      3. org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:413)
      3 frames
    6. Maven
      DefaultArtifactDeployer.deploy
      1. org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:139)
      1 frame
    7. org.apache.maven
      DeployFileMojo.execute
      1. org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:171)
      2. org.apache.maven.plugin.deploy.DeployFileMojo.execute(DeployFileMojo.java:280)
      2 frames
    8. Maven Plugin
      DefaultBuildPluginManager.executeMojo
      1. org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      1 frame
    9. Maven Core
      DefaultMaven.execute
      1. org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
      2. org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      3. org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      4. org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      5. org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      6. org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      7. org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      8. org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      9. org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      10. org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      10 frames
    10. M3 Interceptor
      MavenCli.main
      1. org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
      2. org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
      3. org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
      3 frames
    11. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    12. Plexus
      Launcher.main
      1. org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      2. org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      3. org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      4. org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      4 frames