Reputation: 431
I am trying to run mvn deploy on my project I am not getting any Error codes like 401,407 etc
But the logs are saying
Uploading to repo id: dav:http://snapshot repo link//parent-pom/2.0.0.
Then execution failed
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] parent-pom 2.0.0-SNAPSHOT ........... SUCCESS [ 9.264 s]
[INFO] project-name-one .................. SUCCESS [ 8.086 s]
[INFO] project-name-two ..................... SUCCESS [ 37.332 s]
[INFO] project-name-three ...................... SUCCESS [ 20.625 s]
[INFO] project-name-four 2.0.0-SNAPSHOT ... FAILURE [ 19.265 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:35 min
[INFO] Finished at: 2018-12-06T21:55:07-06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project project-name-four: Failed to deploy artifacts: Could not transfer artifact project.groupid:project-name-one:pom:2.0.0-20181207.035505-1 from/to [repo id] (dav:http://repo/main/snapshot-repo): Access denied to: http://repo/main/snapshot-repo/project/group/id/project-name-one/2.0.0-SNAPSHOT/project-name-one-2.0.0-20181207.035505-1.pom -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project project-name-four: Failed todeploy artifacts: Could not transfer artifact project.groupid:project-name-one:pom:2.0.0-20181207.035505-1 from/to [repo id] (dav:http://repo/main/snapshot-repo): Access denied to: http://repo/main/snapshot-repo/project/group/id/project-name-one/2.0.0-SNAPSHOT/project-name-one-2.0.0-20181207.035505-1.pom
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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 project.groupid:project-name-one:pom:2.0.0-20181207.035505-1 from/to [repo id] (dav:http://repo/main/snapshot-repo): Access denied to: http://repo/main/snapshot-repo/project/group/id/project-name-one/2.0.0-SNAPSHOT/project-name-one-2.0.0-20181207.035505-1.pom
at org.apache.maven.plugin.deploy.DeployMojo.deployProject (DeployMojo.java:284)
at org.apache.maven.plugin.deploy.DeployMojo.execute (DeployMojo.java:185)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
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.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact project.groupid:project-name-one:pom:2.0.0-20181207.035505-1 from/to [repo id] (dav:http://repo/main/snapshot-repo): Access denied to: http://repo/main/snapshot-repo/project/group/id/project-name-one/2.0.0-SNAPSHOT/project-name-one-2.0.0-20181207.035505-1.pom
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy (DefaultArtifactDeployer.java:146)
at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy (AbstractDeployMojo.java:171)
at org.apache.maven.plugin.deploy.DeployMojo.deployProject (DeployMojo.java:242)
at org.apache.maven.plugin.deploy.DeployMojo.execute (DeployMojo.java:185)
.
.
.
.
Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact project.groupid:project-name-one:pom:2.0.0-20181207.035505-1 from/to [repo id] (dav:http://repo/main/snapshot-repo): Access denied to: http://repo/main/snapshot-repo/project/group/id/project-name-one/2.0.0-SNAPSHOT/project-name-one-2.0.0-20181207.035505-1.pom
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy (DefaultDeployer.java:295)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy (DefaultDeployer.java:223)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy (DefaultRepositorySystem.java:384)
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy (DefaultArtifactDeployer.java:142)
at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy (AbstractDeployMojo.java:171)
at org.apache.maven.plugin.deploy.DeployMojo.deployProject (DeployMojo.java:242)
.
.
.
.
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact project.groupid:project-name-one:pom:2.0.0-20181207.035505-1 from/to [repo id] (dav:http://repo/main/snapshot-repo): Access denied to: http://repo/main/snapshot-repo/project/group/id/project-name-one/2.0.0-SNAPSHOT/project-name-one-2.0.0-20181207.035505-1.pom
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed (ArtifactTransportListener.java:52)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run (BasicRepositoryConnector.java:365)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.put (BasicRepositoryConnector.java:284)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy (DefaultDeployer.java:289)
.
.
.
.
Caused by: org.apache.maven.wagon.authorization.AuthorizationException: Access denied to: http://repo/main/snapshot-repo/project/group/id/project-name-one/2.0.0-SNAPSHOT/project-name-one-2.0.0-20181207.035505-1.pom
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put (AbstractHttpClientWagon.java:409)
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put (AbstractHttpClientWagon.java:336)
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put (AbstractHttpClientWagon.java:303)
. . . . [ERROR] [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/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :project-name-three
I tried to verify settings.xml and my pom distribution management.. As this is not generation any error code I couldn't figure code the exact problem
Upvotes: 0
Views: 2269
Reputation: 729
There could be one of two things going on based upon the status codes 401 and 407. In case of a 401 then the artifact server (Nexus) requires authorization and authentication to publish artifacts. In this case you need to provide the required username and password. This can be done in the ~/.m2/settings.xml by adding something similar to this:
<servers>
<server>
<id>dav:http://snapshot</div>
<username>youruser</username>
<password>yourpass</password>
</server>
</servers
The error code 407 indicates an entirely different problem. This usually means you have a proxy server between you and the artifact server that requires a login. This can usually be solved by adding a proxy configuration to the settings.xml with the required username and password. See the sample below from for a template.
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>proxy.host.net</host>
<port>80</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
-->
</proxies>
Upvotes: 2