使用 mule-domain-maven-plugin 发布时双重上传

Double Upload When Releasing With mule-domain-maven-plugin

我正在尝试使用 mule-domain-maven-plugin 发布 Mule 域。我注意到在调用安装时,安装了主要的 *.zip 工件,然后是 *.pom,然后是 *.zip 的第二个副本:

[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ esb-common ---
[INFO] Installing /Users/chase/git/dn2k/dn2k-esb/esb-common/target/esb-common-2.6.7.0.zip to /Users/chase/.m2/repository/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.zip
[INFO] Installing /Users/chase/git/dn2k/dn2k-esb/esb-common/pom.xml to /Users/chase/.m2/repository/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.pom
[INFO] Installing /Users/chase/git/dn2k/dn2k-esb/esb-common/target/esb-common-2.6.7.0.zip to /Users/chase/.m2/repository/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.zip

也许有点奇怪,但无害。

但是,当尝试释放时,会遵循类似的顺序。首先将主要的 *.zip 工件上传到 Nexus,然后是 *.pom,然后是 maven-metadata.xml,最后是主要的 *.zip 工件的第二个副本:

[INFO] Uploading: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.zip
[INFO] Uploaded: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.zip (2 KB at 7.7 KB/sec)
[INFO] Uploading: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.pom
[INFO] Uploaded: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.pom (2 KB at 6.7 KB/sec)
[INFO] Downloading: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/maven-metadata.xml
[DEBUG] Could not find metadata com.dn2k:esb-common/maven-metadata.xml in dn2k-deployment (http://<hostname>/nexus/content/repositories/releases/)
[DEBUG] Writing tracking file /Users/myron/.m2/repository/com/dn2k/esb-common/resolver-status.properties
[INFO] Uploading: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/maven-metadata.xml
[INFO] Uploaded: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/maven-metadata.xml (302 B at 1.4 KB/sec)
[DEBUG] Using transporter WagonTransporter with priority -1.0 for http://<hostname>/nexus/content/repositories/releases/
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for http://<hostname>/nexus/content/repositories/releases/ with username=admin, password=***
[INFO] Uploading: http://<hostname>/nexus/content/repositories/releases/com/dn2k/esb-common/2.6.7.0/esb-common-2.6.7.0.zip
^^^^ ERRORS OUT ^^^^

在第二次上传时,Nexus 犹豫不决,因为我们将其配置为不允许多次上传同一个已发布的工件。

source code for the plugin 中,第 88 行将 zip 文件标识为主要工件,上面仅一行将同一文件标识为附件。这种双重识别是导致 maven-install-plugin 将双重副本复制到 ~/.m2/repository 的原因,如上所示。

这是一个错误,还是我没有正确配置插件?有没有人有使用 mule-domain-maven-plugin 成功发布的例子?

这是 esb-common(域)项目的 pom(插件的版本管理为 1.1):

  <?xml version="1.0" encoding="UTF-8"?>
  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

     <modelVersion>4.0.0</modelVersion>
     <groupId>com.dn2k</groupId>
     <artifactId>esb-common</artifactId>
     <packaging>mule-domain</packaging>

     <parent>
        <groupId>com.dn2k</groupId>
        <artifactId>esb-parent</artifactId>
        <version>2.6.7.0</version>
     </parent>

     <build>
        <plugins>
           <plugin>
              <groupId>org.mule.tools.maven</groupId>
              <artifactId>mule-domain-maven-plugin</artifactId>
              <extensions>true</extensions>
           </plugin>
        </plugins>
     </build>

  </project>

我为 mulesoft 团队提起诉讼。他们现在修好了我的票。这显然是一个错误。幸运的是,如果我使用最新的 mule 版本和 mule 插件,我不再收到这些冗余安装消息。

[INFO] Installing C:\project\workspaces\workspace_mule\zzzz\pom.xml to C:\Users\charmin\.m2\repository\com\mycompany\zzzz.0.0-SNAPSHOT\zzzz-1.0.0-SNAPSHOT.pom
[INFO] Installing C:\project\workspaces\workspace_mule\zzzz\target\zzzz-1.0.0-SNAPSHOT.zip to C:\Users\charmin\.m2\repository\com\mycompany\zzzz.0.0-SNAPSHOT\zzzz-1.0.0-SNAPSHOT.zip