为什么Maven没有打包子模块?

时间:2018-07-06 03:27:47

标签: java spring maven jenkins

感谢您的光临和帮助。

我们在使用 maven spring 时遇到了麻烦,并且在打包模块ipdp-trade-fund,父模块的pom和ipdp-trade-资金被附加在后面,jenkins总是从nexus搜索其依赖关系,然后报告错误,因为ipdp-trade-parent的子模块在nexus服务器中不存在。

事实上,我希望它可以在项目中尝试打包其依赖项(子模块),但是下载它们,有人对解决方案有想法吗?

Jenkins错误消息:

[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building ipdp-trade-fund 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-ds-provider-fund/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-ds-provider-fund/1.0.0-SNAPSHOT/ipdp-ds-provider-fund-1.0.0-SNAPSHOT.pom
[WARNING] The POM for com.ipdp:ipdp-ds-provider-fund:jar:1.0.0-SNAPSHOT is missing, no dependency information available
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-strategy/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-strategy/1.0.0-SNAPSHOT/ipdp-strategy-1.0.0-SNAPSHOT.pom
[WARNING] The POM for com.ipdp:ipdp-strategy:jar:1.0.0-SNAPSHOT is missing, no dependency information available
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-base-common/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-base-common/1.0.0-SNAPSHOT/ipdp-base-common-1.0.0-SNAPSHOT.pom
[WARNING] The POM for com.ipdp:ipdp-base-common:jar:1.0.0-SNAPSHOT is missing, no dependency information available
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-base-config/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-base-config/1.0.0-SNAPSHOT/ipdp-base-config-1.0.0-SNAPSHOT.pom
[WARNING] The POM for com.ipdp:ipdp-base-config:jar:1.0.0-SNAPSHOT is missing, no dependency information available
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-foundation/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-foundation/1.0.0-SNAPSHOT/ipdp-foundation-1.0.0-SNAPSHOT.pom
[WARNING] The POM for com.ipdp:ipdp-foundation:jar:1.0.0-SNAPSHOT is missing, no dependency information available
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-trade-base/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-trade-base/1.0.0-SNAPSHOT/ipdp-trade-base-1.0.0-SNAPSHOT.pom
[WARNING] The POM for com.ipdp:ipdp-trade-base:jar:1.0.0-SNAPSHOT is missing, no dependency information available
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-channel-ips-send/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-channel-ips-send/1.0.0-SNAPSHOT/ipdp-channel-ips-send-1.0.0-SNAPSHOT.pom
[WARNING] The POM for com.ipdp:ipdp-channel-ips-send:jar:1.0.0-SNAPSHOT is missing, no dependency information available
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-ds-provider-fund/1.0.0-SNAPSHOT/ipdp-ds-provider-fund-1.0.0-SNAPSHOT.jar
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-base-common/1.0.0-SNAPSHOT/ipdp-base-common-1.0.0-SNAPSHOT.jar
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-strategy/1.0.0-SNAPSHOT/ipdp-strategy-1.0.0-SNAPSHOT.jar
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-base-config/1.0.0-SNAPSHOT/ipdp-base-config-1.0.0-SNAPSHOT.jar
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-foundation/1.0.0-SNAPSHOT/ipdp-foundation-1.0.0-SNAPSHOT.jar
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-trade-base/1.0.0-SNAPSHOT/ipdp-trade-base-1.0.0-SNAPSHOT.jar
Downloading: http://22.11.75.156:8081/nexus/content/groups/public/com/ipdp/ipdp-channel-ips-send/1.0.0-SNAPSHOT/ipdp-channel-ips-send-1.0.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.641s
[INFO] Finished at: Fri Jul 06 08:51:47 CST 2018
[INFO] Final Memory: 11M/101M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project ipdp-trade-fund: Could not resolve dependencies for project com.ipdp:ipdp-trade-fund:jar:1.0.0-SNAPSHOT: The following artifacts could not be resolved: com.ipdp:ipdp-ds-provider-fund:jar:1.0.0-SNAPSHOT, com.ipdp:ipdp-strategy:jar:1.0.0-SNAPSHOT, com.ipdp:ipdp-base-common:jar:1.0.0-SNAPSHOT, com.ipdp:ipdp-base-config:jar:1.0.0-SNAPSHOT, com.ipdp:ipdp-foundation:jar:1.0.0-SNAPSHOT, com.ipdp:ipdp-trade-base:jar:1.0.0-SNAPSHOT, com.ipdp:ipdp-channel-ips-send:jar:1.0.0-SNAPSHOT: Could not find artifact com.ipdp:ipdp-ds-provider-fund:jar:1.0.0-SNAPSHOT in nexus-public (http://22.11.75.156:8081/nexus/content/groups/public) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
Waiting for Jenkins to finish collecting data

这是父模块的pom的一部分:

<groupId>com.ipdp</groupId>
<artifactId>ipdp-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>ipdp-parent</name>
<url>http://maven.apache.org</url>
<properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <maven.compiler.source>1.8</maven.compiler.source>
  <maven.compiler.target>1.8</maven.compiler.target>

<modules>
  <module>ipdp-atom-product</module>
  <module>ipdp-atom-transferagent</module>
  <module>ipdp-atom-position-order</module>
  <module>ipdp-atom-operation</module>
  <module>ipdp-atom-management</module>
  <module>ipdp-atom-batch</module>
  <module>ipdp-dao-standard-interfaces</module>
      <module>ipdp-dao-standard</module>
     <module>ipdp-dao-special-interfaces</module>
      <module>ipdp-dao-special</module>
      <module>ipdp-base-common</module>
      <module>ipdp-base-config</module>
      <module>ipdp-foundation</module>
      <module>ipdp-atom-input-check</module>
      <module>ipdp-trade-fund</module>
      <module>ipdp-ds-provider-base</module>
      <module>ipdp-ds-provider-fund</module>
      <module>ipdp-trade-base</module>
    </modules>

<distributionManagement>
  <repository>
     <id>packaging-releases</id>
     <name>Packaging Release Repository</name>
     <url>http://22.11.97.134:8081/nexus/content/repositories/releases/</url>
  </repository>
  <snapshotRepository>
     <id>packaging-snapshots</id>
     <name>Packaging Snapshot Repository</name>
     <url>http://22.11.97.134:8081/nexus/content/repositories/snapshots/</url>
     <uniqueVersion>true</uniqueVersion>
  </snapshotRepository>
</distributionManagement> 

这是子模块的pom:

    <modelVersion>4.0.0</modelVersion>
<parent>
 <groupId>com.ipdp</groupId>
 <artifactId>ipdp-parent</artifactId>
 <version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>ipdp-trade-fund</artifactId>
<dependencies>
 <dependency>
   <groupId>com.ipdp</groupId>
   <artifactId>ipdp-ds-provider-fund</artifactId>
   <version>1.0.0-SNAPSHOT</version>
 </dependency>
 <dependency>
   <groupId>com.ipdp</groupId>
   <artifactId>ipdp-strategy</artifactId>
   <version>1.0.0-SNAPSHOT</version>
 </dependency>
 <dependency>
   <groupId>com.ipdp</groupId>
   <artifactId>ipdp-base-common</artifactId>
   <version>1.0.0-SNAPSHOT</version>
 </dependency>
 <dependency>
   <groupId>com.ipdp</groupId>
   <artifactId>ipdp-base-config</artifactId>
   <version>1.0.0-SNAPSHOT</version>
 </dependency>
 <dependency>
   <groupId>com.ipdp</groupId>
   <artifactId>ipdp-foundation</artifactId>
   <version>1.0.0-SNAPSHOT</version>
 </dependency>
  <dependency>
    <groupId>com.ipdp</groupId>
    <artifactId>ipdp-trade-base</artifactId>
    <version>1.0.0-SNAPSHOT</version>
  </dependency>
   <dependency>
       <groupId>com.ipdp</groupId>
       <artifactId>ipdp-channel-ips-send</artifactId>
       <version>1.0.0-SNAPSHOT</version>
       <scope>compile</scope>
   </dependency>
</dependencies>
<build>
 <plugins>
   <plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-jar-plugin</artifactId>
     <configuration>
       <archive>
         <manifest>
                   <mainClass>com.ipdp.ds.BootStrap</mainClass>
           <addClasspath>true</addClasspath>
           <classpathPrefix>lib/</classpathPrefix>
         </manifest>
         <addMavenDescriptor>false</addMavenDescriptor>
       </archive>
     </configuration>
   </plugin>
 </plugins>
</build> 

非常感谢您的任何建议。 :-)

0 个答案:

没有答案