将Maven项目推送(部署)到Nexus 3 [英] Push (deploy) maven project to Nexus 3

查看:303
本文介绍了将Maven项目推送(部署)到Nexus 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将项目推送到Nexus 3,但是每次遇到相同的问题时(请在下面登录).

I'm try push my project to Nexus 3, but every time i have the same problem (log below).

配置: pom.xml

Configuration: 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:

And i have file settings.xml:

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

然后我尝试"MVN部署",结果是:

Then i try "mvn deploy" and result is:

[INFO] Deploying remotely...
[INFO]  * Bulk deploying locally gathered snapshot artifacts to URL http://adress/#browse/browse/components:docker-image
Downloading: http://adress/#browse/browse/components:/myProjectSource/0.1-SNAPSHOT/maven-metadata.xml
[WARNING] Checksum validation failed, expected <!DOCTYPE but is c90f8bc4e18b8c79c2df61e2ec9288e33fd8985f for http://adress/#browse/browse/components:/myProjectSource/0.1-SNAPSHOT/maven-metadata.xml
[WARNING] Could not validate integrity of download from http://adress/#browse/browse/components:/myProjectSource/0.1-SNAPSHOT/maven-metadata.xml Checksum validation failed, expected <!DOCTYPE but is c90f8bc4e18b8c79c2df61e2ec9288e33fd8985f
[WARNING] Checksum validation failed, expected <!DOCTYPE but is c90f8bc4e18b8c79c2df61e2ec9288e33fd8985f for http://adress/#browse/browse/components:/myProjectSource/0.1-SNAPSHOT/maven-metadata.xml
Downloaded: http://adress/#browse/browse/components:/myProjectSource/0.1-SNAPSHOT/maven-metadata.xml (5 KB at 13.3 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:56 min
[INFO] Finished at: 2016-12-12T14:15:55+01:00
[INFO] Final Memory: 75M/744M
[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 update metadata myProjectSource:0.1-SNAPSHOT/maven-metadata.xml: 
Could not parse metadata /home/test/.m2/repository/myProjectSource/0.1-SNAPSHOT/maven-metadata-nexus.xml: entity reference names can not start with character '&' (position: START_TAG seen ...ascript">\n    function progressMessage(msg) {\n      if (console &&... @33:21) -> [Help 1]

您知道问题出在哪里吗?

Do you know where is the problem?

推荐答案

我找到了解决方案.问题出在连结网址. 当我更改网址

I found solution. The problem was with nexus url. When i changed url

来自:

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

收件人:

<nexus.url>http://adress/repository/image-docker/</nexus.url>

工作正常.

这篇关于将Maven项目推送(部署)到Nexus 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆