将泊坞窗图像推送到Nexus

时间:2016-12-13 09:49:12

标签: maven jenkins deployment nexus

您好Jenkins和Nexus在同一台服务器上。当Jenkins正确构建项目时,我想将图像推送到Nexus 3,但每次我遇到同样的问题时(记录如下)。

配置: pom.xml

<nexus.url>http://adress/#browse/browse/components:docker-image</nexus.url>

<distributionManagement>
   <snapshotRepository>
        <id>nexus</id>
        <url>${nexus.url}</url>
    </snapshotRepository>
</distributionManagement>
...
<plugins>
        <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.4</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>nexus</serverId>
              <nexusUrl>${nexus.url}</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
        </plugin>

我有文件settings.xml:

<servers>
 <server>
    <id>nexus</id>
    <username>login</username>
    <password>password</password>
 </server>
</servers>

然后我尝试“mvn clean deploy”,结果是:

[INFO] Deploying remotely...
[INFO] Bulk deploying locally gathered artifacts from directory: 
[INFO]  * Bulk deploying locally gathered snapshot artifacts to URL http://adress/repository/image-docker/
Downloading: http://adress/repository/image-docker/someProject/0.1-SNAPSHOT/maven-metadata.xml
Uploading: http://adress/repository/image-docker/someProject/0.1-SNAPSHOT/someProject-0.1-20161213.093022-1.jar
Uploading: http://adress/repository/image-docker/someProject//0.1-SNAPSHOT/someProject-0.1-20161213.093022-1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:58 min
[INFO] Finished at: 2016-12-13T10:30:35+01:00
[INFO] Final Memory: 75M/748M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.4:deploy (injected-nexus-deploy) on project someProject: 
Failed to deploy artifacts: Could not transfer artifact someProject:jar:0.1-20161213.093022-1 from/to nexus (http://adress/repository/image-docker/):
Failed to transfer file: http://adress/repository/image-docker/someProject/someProject/0.1-SNAPSHOT/someProject-0.1-20161213.093022-1.jar. 
Return code is: 502, ReasonPhrase: Bad Gateway. -> [Help 1]

502每次都是同样的问题 - Bad Gateway。

你有什么建议吗?

1 个答案:

答案 0 :(得分:2)

不幸的是,由于一些原因,这不起作用。

希望这有帮助。