【问题标题】:Push (deploy) maven project to Nexus 3将 maven 项目推送(部署)到 Nexus 3
【发布时间】:2017-04-27 09:20:07
【问题描述】:

我正在尝试将我的项目推送到 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 deploy”,结果是:

[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]

你知道问题出在哪里吗?

【问题讨论】:

    标签: maven jenkins deployment nexus


    【解决方案1】:

    我找到了解决方案。问题出在联系网址上。 当我更改网址时

    来自:

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

    到:

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

    工作正常。

    【讨论】:

    • 这是正确的,您不能将浏览器中显示的 URL 用于存储库。您应该在每个存储库右侧的存储库管理屏幕中看到一个 URL 列表,您想要使用这些。
    猜你喜欢
    • 1970-01-01
    • 2013-03-06
    • 1970-01-01
    • 2019-03-31
    • 2023-03-14
    • 2016-06-28
    • 2013-08-11
    • 2012-12-22
    • 2018-06-03
    相关资源
    最近更新 更多