简体   繁体   English

Jenkins Maven与GIT一起发布

[英]Jenkins Maven Release with GIT

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. 我让Jenkins使用SSH代理程序通过SSH连接到Git进行了设置,并试图建立一个工作,这将完成Maven Release的构建。 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, 在使用maven-deploy-plugin进行部署期间,我遇到了错误,

[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. 据我所知,旅行车将使用ssh,因此应该没有问题。

My pom.xml 我的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. 您正在尝试将发布的工件部署到GIT存储库。 Artifacts are deployed to a central repository such as Artifactory or Nexus, usually by means of HTTP (POST) unless you specify something else. 除非您另外指定,否则通常通过HTTP(POST)将工件部署到Artifactory或Nexus等中央存储库。

If you want to deploy using SSH, this link will explain how it's done. 如果您想使用SSH进行部署,则链接将说明其完成方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM