我有一个多模块项目书店(其中一个模块是 WAR)。一些模块依赖于 projectX(并且一些依赖项也依赖于该 projectX)。我在模块中使用了 maven 属性和依赖管理,以确保它们的一切都依赖于相同的版本(0.0.7-SNAPSHOT)。参见 [1] 中的依赖分析
在 projectX 和其他一些项目中执行了很多更改后,我的存储库有很多 projectX 的时间戳快照。
当我运行 CI 服务器的部署作业(golas“部署站点:站点”后跟“站点:部署”)时,我得到一个 WAR 文件,其中包含 projectX 的 SNAPSHOT 的多个时间戳版本(每个模块的 3 个时间戳 - api、core、mail -确切地说,总共 9 个)。
在本地运行目标包不会产生同样的问题——正如预期的那样,每个模块只有一个快照被打包在战争中。
有谁知道为什么 Maven 打包了多个快照。既然他们都是
干杯,
米格尔·阿尔梅达
[1]
[INFO] --- maven-dependency-plugin:2.1:analyze (default-cli) @ bookstore-persist ---
[WARNING] Used undeclared dependencies found:
[WARNING] org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final:compile
[WARNING] org.company.clinicalmanagement:clinicaltrial-api:jar:1.0.2-SNAPSHOT:compile
[WARNING] org.springframework:spring-tx:jar:3.1.0.RELEASE:compile
[WARNING] org.company.security:security-api:jar:0.0.7-SNAPSHOT:compile
[WARNING] commons-logging:commons-logging:jar:1.1.1:compile
[WARNING] org.apache.struts.xwork:xwork-core:jar:2.3.4:compile
[WARNING] org.company.audit:audit-core:jar:0.1.0-SNAPSHOT:compile
[WARNING] org.company.security:security-core:jar:0.0.7-SNAPSHOT:compile
[WARNING] org.company.security:security-mail:jar:0.0.7-SNAPSHOT:compile
[WARNING] joda-time:joda-time:jar:2.0:compile
[WARNING] Unused declared dependencies found:
[WARNING] org.company:projectX-shared:pom:1.1.0-SNAPSHOT:compile
[WARNING] org.company:projectX-model:jar:1.1.0-SNAPSHOT:compile
[WARNING] org.company:projectX-configuration:jar:1.1.0-SNAPSHOT:test
[WARNING] org.springframework:spring-core:jar:3.1.0.RELEASE:compile
[WARNING] org.slf4j:jcl-over-slf4j:jar:1.5.8:runtime
[WARNING] org.slf4j:slf4j-api:jar:1.5.8:runtime
[WARNING] org.slf4j:slf4j-log4j12:jar:1.5.8:runtime
[WARNING] log4j:log4j:jar:1.2.14:runtime
[WARNING] org.springframework:spring-orm:jar:3.1.0.RELEASE:compile
[WARNING] c3p0:c3p0:jar:0.9.1.2:provided
[WARNING] postgresql:postgresql:jar:9.0-801.jdbc4:provided
[WARNING] javassist:javassist:jar:3.4.GA:compile
[WARNING] javax.servlet:servlet-api:jar:2.4:provided
[WARNING] cglib:cglib:jar:2.2:compile
[WARNING] org.company.security:security:pom:0.0.7-SNAPSHOT:compile
[WARNING] org.company.audit:audit:pom:0.1.0-SNAPSHOT:compile
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Bookstore Web 1.1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-dependency-plugin:2.1:analyze (default-cli) @ projectX-web >>>
[INFO]
[INFO] --- buildnumber-maven-plugin:1.0:create (default) @ projectX-web ---
[INFO]
[INFO] --- maven-dependency-plugin:2.1:analyze (default-cli) @ projectX-web ---
[WARNING] Used undeclared dependencies found:
[WARNING] org.company.clinicalmanagement:clinicaltrial-api:jar:1.0.2-SNAPSHOT:compile
[WARNING] org.company.security:security-api:jar:0.0.7-SNAPSHOT:compile
[WARNING] org.hibernate:hibernate-core:jar:3.6.3.Final:compile
[WARNING] org.apache.struts.xwork:xwork-core:jar:2.3.4:compile
[WARNING] org.company.security:security-core:jar:0.0.7-SNAPSHOT:compile
[WARNING] commons-logging:commons-logging-api:jar:1.1:compile
[WARNING] org.company.audit:audit-struts:jar:0.1.0-SNAPSHOT:compile
[WARNING] org.springframework:spring-tx:jar:3.1.0.RELEASE:compile
[WARNING] org.company.audit:audit-core:jar:0.1.0-SNAPSHOT:compile
[WARNING] org.company.security:security-mail:jar:0.0.7-SNAPSHOT:compile
[WARNING] org.springframework:spring-web:jar:3.0.5.RELEASE:compile
[WARNING] Unused declared dependencies found:
[WARNING] org.apache.commons:commons-jci-fam:jar:1.0:compile
[WARNING] postgresql:postgresql:jar:9.0-801.jdbc4:test
[WARNING] org.apache.struts:struts2-sitemesh-plugin:jar:2.3.4:compile
[WARNING] org.apache.struts:struts2-config-browser-plugin:jar:2.3.4:compile
[WARNING] org.apache.struts:struts2-spring-plugin:jar:2.3.4:compile
[WARNING] commons-fileupload:commons-fileupload:jar:1.1.1:compile
[WARNING] org.company:projectX-model:jar:1.1.0-SNAPSHOT:compile
[WARNING] org.company:projectX-persist:jar:1.1.0-SNAPSHOT:compile
[WARNING] org.company.audit:audit:pom:0.1.0-SNAPSHOT:compile
[WARNING] org.springframework:spring-core:jar:3.1.0.RELEASE:compile
[WARNING] org.springframework:spring-context-support:jar:3.1.0.RELEASE:compile
[WARNING] org.slf4j:jcl-over-slf4j:jar:1.5.8:runtime
[WARNING] org.slf4j:slf4j-api:jar:1.5.8:runtime
[WARNING] org.slf4j:slf4j-log4j12:jar:1.5.8:runtime
[WARNING] log4j:log4j:jar:1.2.14:runtime
[WARNING] c3p0:c3p0:jar:0.9.1.2:test
[WARNING] org.company:projectX-configuration:jar:1.1.0-SNAPSHOT:compile
[WARNING] org.company:projectX-configuration:test-jar:tests:1.1.0-SNAPSHOT:compile
[WARNING] org.company.security:security:pom:0.0.7-SNAPSHOT:compile
[WARNING] org.xhtmlrenderer:core-renderer:jar:R8-final:compile
[WARNING] com.lowagie:itext:jar:2.1.7:compile
[WARNING] org.apache.poi:poi:jar:3.7:compile
[WARNING] com.jgeppert.struts2.jquery:struts2-jquery-plugin:jar:3.0.1:compile
[WARNING] org.company.application.version:application-version:jar:0.0.2:compile
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building bookstore-acceptance 1.1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] <<< maven-dependency-plugin:2.1:analyze (default-cli) @ bookstore-acceptance <<<
[INFO]
[INFO] --- maven-dependency-plugin:2.1:analyze (default-cli) @ bookstore-acceptance ---
[WARNING] Used undeclared dependencies found:
[WARNING] org.springframework:spring-beans:jar:3.1.0.RELEASE:compile
[WARNING] org.company.clinicalmanagement:clinicaltrial-api:jar:1.0.2-SNAPSHOT:compile
[WARNING] org.company.audit:audit-struts:jar:0.1.0-SNAPSHOT:compile
[WARNING] org.apache.struts:struts2-junit-plugin:jar:2.3.4:test
[WARNING] org.hibernate:hibernate-core:jar:3.6.3.Final:compile
[WARNING] org.company.security:security-api:jar:0.0.7-SNAPSHOT:compile
[WARNING] org.easymock:easymock:jar:3.0:compile
[WARNING] org.company.systemDate:systemDate:jar:0.0.2:compile
[WARNING] com.lowagie:itext:jar:2.1.7:compile
[WARNING] junit:junit:jar:4.8.2:test
[WARNING] org.springframework:spring-context-support:jar:3.1.0.RELEASE:compile
[WARNING] org.apache.struts.xwork:xwork-core:jar:2.3.4:compile
[WARNING] org.company.clinicalmanagement:clinicaltrial-core:jar:1.0.2-SNAPSHOT:compile
[WARNING] org.company.audit:audit-core:jar:0.1.0-SNAPSHOT:compile
[WARNING] info.cukes:cucumber-core:jar:1.0.9:test
[WARNING] org.company.security:security-core:jar:0.0.7-SNAPSHOT:compile
[WARNING] org.springframework:spring-web:jar:3.0.5.RELEASE:compile
[WARNING] org.company.security:security-mail:jar:0.0.7-SNAPSHOT:compile
[WARNING] info.cukes:cucumber-java:jar:1.0.9:test
[WARNING] Unused declared dependencies found:
[WARNING] info.cukes:cucumber-spring:jar:1.0.9:test
[WARNING] postgresql:postgresql:jar:9.0-801.jdbc4:provided
[WARNING] org.company:projectX-persist:jar:1.1.0-SNAPSHOT:compile
[WARNING] org.company:projectX-persist:test-jar:tests:1.1.0-SNAPSHOT:test
[WARNING] org.company:projectX-configuration:jar:1.1.0-SNAPSHOT:compile
[WARNING] org.company:projectX-configuration:test-jar:tests:1.1.0-SNAPSHOT:compile
[WARNING] c3p0:c3p0:jar:0.9.1.2:test
[WARNING] org.company:projectX-web:jar:classes:1.1.0-SNAPSHOT:test
[WARNING] org.company:projectX-web:test-jar:tests:1.1.0-SNAPSHOT:test
[WARNING] org.apache.struts:struts2-spring-plugin:jar:2.3.4:compile
[WARNING] javax.servlet:servlet-api:jar:2.4:provided
[WARNING] javax.servlet:jsp-api:jar:2.0:provided