Return code is: 401, ReasonPhrase: Unauthorized

2,157 views
Skip to first unread message

Kholofelo Madihlaba

unread,
Sep 28, 2017, 1:33:12 PM9/28/17
to Nexus Users

Please assist I am getting the below exception when I run clean deploy. I have attached the log file.

settings.xml:

<servers>
<server> 
<id>wf-machine-config-bundle</id> 
<username>admin</username> 
<password>Admin_123</password> 
</server>
</servers>

I have my profiles defined on the pom file and settings.xml.


I am able to login to the nexus GUI using the above credentials.

 

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project jira: Failed to deploy artifacts: Could not transfer artifact intelligent-automation:jira:jar:1.1.4 from/to wf-machine-config-bundle (http://localhost:8381/nexus/content/repositories/wf-machine-config-bundle): Failed to transfer file: http://localhost:8381/nexus/content/repositories/wf-machine-config-bundle/intelligent-automation/jira/1.1.4/jira-1.1.4.jar. 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.7:deploy (default-deploy) on project jira: Failed to deploy artifacts: Could not transfer artifact intelligent-automation:jira:jar:1.1.4 from/to wf-machine-config-bundle (http://localhost:8381/nexus/content/repositories/wf-machine-config-bundle): Failed to transfer file: http://localhost:8381/nexus/content/repositories/wf-machine-config-bundle/intelligent-automation/jira/1.1.4/jira-1.1.4.jar. 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:497)
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 intelligent-automation:jira:jar:1.1.4 from/to wf-machine-config-bundle (http://localhost:8381/nexus/content/repositories/wf-machine-config-bundle): Failed to transfer file: http://localhost:8381/nexus/content/repositories/wf-machine-config-bundle/intelligent-automation/jira/1.1.4/jira-1.1.4.jar. Return code is: 401, ReasonPhrase: Unauthorized.
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:193)
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 intelligent-automation:jira:jar:1.1.4 from/to wf-machine-config-bundle (http://localhost:8381/nexus/content/repositories/wf-machine-config-bundle): Failed to transfer file: http://localhost:8381/nexus/content/repositories/wf-machine-config-bundle/intelligent-automation/jira/1.1.4/jira-1.1.4.jar. 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:167)
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:157)
... 22 more
Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact intelligent-automation:jira:jar:1.1.4 from/to wf-machine-config-bundle (http://localhost:8381/nexus/content/repositories/wf-machine-config-bundle): Failed to transfer file: http://localhost:8381/nexus/content/repositories/wf-machine-config-bundle/intelligent-automation/jira/1.1.4/jira-1.1.4.jar. 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 intelligent-automation:jira:jar:1.1.4 from/to wf-machine-config-bundle (http://localhost:8381/nexus/content/repositories/wf-machine-config-bundle): Failed to transfer file: http://localhost:8381/nexus/content/repositories/wf-machine-config-bundle/intelligent-automation/jira/1.1.4/jira-1.1.4.jar. 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:8381/nexus/content/repositories/wf-machine-config-bundle/intelligent-automation/jira/1.1.4/jira-1.1.4.jar. 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

dev.log

Brian Fox

unread,
Sep 28, 2017, 1:43:17 PM9/28/17
to Kholofelo Madihlaba, Nexus Users
If you're using the default admin account, the password is "admin123"
which is different from what you pasted.

Also make sure the server id matches the id in your
distributionManagement section of your pom.
> --
> You received this message because you are subscribed to the Google Groups
> "Nexus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nexus-users...@glists.sonatype.com.
> To post to this group, send email to nexus...@glists.sonatype.com.
> To view this discussion on the web visit
> https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/680cb7ce-8f78-438d-b439-a521fd934292%40glists.sonatype.com.
> For more options, visit
> https://groups.google.com/a/glists.sonatype.com/d/optout.

Kholofelo Madihlaba

unread,
Oct 3, 2017, 11:49:18 AM10/3/17
to Nexus Users
Thanks, I found the issue behind it. It was not referencing my maven settings that I normally use for all my projects instead it was referencing the default C:\Users\****\.m2 settings which I am not even using. So I had to create a dummy settings.xml in \.m2 for it to work.

Santosh Krishna

unread,
Oct 3, 2017, 12:01:26 PM10/3/17
to Kholofelo Madihlaba, Nexus Users
The profile could be nexus, try using this instead..
<server> 
<id>nexus</id> 
<username>admin</username> 
<password>admin123</password> 
</server>


//Santosh

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.
Reply all
Reply to author
Forward
0 new messages