Share

June 3, 2010

Maven Authentication failed: Could not connect to server.

If you ever get the following error message when doing a build, it might very hard to see the server that refused the connection....

[13:14:35]: [INFO] [INFO] [deploy:deploy {execution: default-deploy}]
[13:14:35]: [INFO] [INFO] ------------------------------------------------------------------------
[13:14:35]: [INFO] [ERROR] BUILD ERROR
[13:14:35]: [INFO] [INFO] ------------------------------------------------------------------------
[13:14:35]: [INFO] [INFO] Error deploying artifact: Authentication failed: Could not connect to server.
[13:14:35]: [INFO] 
[13:14:35]: [INFO] Connection refused

to find out more info you should add the -e -X flags to the maven command and you will get something like.. which gives you more info about the issue.

[13:52:46]: [INFO] [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-deploy-plugin:2.4:deploy' -->
[13:52:46]: [INFO] [DEBUG]   (f) artifact = com.mycompany:project:pom:1.47.2.1
[13:52:46]: [INFO] [DEBUG]   (f) attachedArtifacts = []
[13:52:46]: [INFO] [DEBUG]   (f) deploymentRepository = Repository[xxx_repository|ftp://server.mycomapny.com//home/maven/repository]
[13:52:46]: [INFO] [DEBUG]   (s) localRepository = Repository[local|file:///home/buildagent/.m2/repository]
[13:52:46]: [INFO] [DEBUG]   (f) packaging = pom
[13:52:46]: [INFO] [DEBUG]   (f) pomFile = /home/buildagent/buildagent/work/beaa44be392fc592/target/checkout/pom.xml
[13:52:46]: [INFO] [DEBUG]   (f) skip = false
[13:52:46]: [INFO] [DEBUG]   (f) updateReleaseInfo = true
[13:52:46]: [INFO] [DEBUG] -- end configuration --
[13:52:46]: [INFO] [INFO] [deploy:deploy {execution: default-deploy}]
[13:52:46]: [INFO] [DEBUG] not adding permissions to wagon connection
[13:52:46]: [INFO] [INFO] ------------------------------------------------------------------------
[13:52:46]: [INFO] [ERROR] BUILD ERROR
[13:52:46]: [INFO] [INFO] ------------------------------------------------------------------------
[13:52:46]: [INFO] [INFO] Error deploying artifact: Authentication failed: Could not connect to server.