I got Jenkins set up with SSH connection to Git, using SSH agent and trying to set up a job, which would do Maven Release build. The job is executing following commands
-Dresume=false release:prepare release:perform
-Dresume=false -DdryRun=true release:prepare
During deployment with maven-deploy-plugin I run into error,
[INFO] [INFO]
[INFO] [INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ uaiContacts ---
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] BUILD FAILURE
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Total time: 4.151 s
[INFO] [INFO] Finished at: 2015-09-23T11:35:32+01:00
[INFO] [INFO] Final Memory: 27M/265M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project uaiContacts: Failed to deploy artifacts/metadata: Cannot access git@giturl:repo with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access git@giturl:repo using the registered transporter factories: WagonTransporterFactory: java.util.NoSuchElementException
[INFO] [ERROR] role: org.apache.maven.wagon.Wagon
[INFO] [ERROR] roleHint: git@giturl
[INFO] [ERROR] -> [Help 1]
[INFO] [ERROR]
[INFO] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[INFO] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[INFO] [ERROR]
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I am not sure why is it saying cannot access and how is it trying to access. As I am aware wagon will be using ssh, so there should not be a problem.
My pom.xml
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.4</version>
</extension>
</extensions>
</build>
<scm>
<connection>scm:git:git@giturl:repo</connection>
<developerConnection>scm:git:git@giturl:repo</developerConnection>
<url>git@giturl:repo</url>
<tag>HEAD</tag>
</scm>
<distributionManagement>
<repository>
<id>release</id>
<url>git@giturl:repo</url>
</repository>
</distributionManagement>
You are trying to deploy the released artifact to a GIT repository. Artifacts are deployed to a central repository such as Artifactory or Nexus, usually by means of HTTP (POST) unless you specify something else.
If you want to deploy using SSH, this link will explain how it's done.