mvn 包 间接依赖问题

chongzai 发布于 2013/05/24 18:08
阅读 832
收藏 0

1.一个maven项目两个module :core(提供业务实现),web(前端控制层)

2.web 依赖core

3.core 依赖几个服务jar :article-service,user-service,goods-service

最终web打包会把这几个服务包打到war中

现在打印依赖树.mvn -Ptest dependency:tree

发现core的依赖树是

[INFO] ------------------------------------------------------------------------
[INFO] Building fire-core 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ fire-wm-core ---
[INFO] com.desksoft.fire.core:fire-wm-core🏺1.0-SNAPSHOT
[INFO] +- com.desksoft.common:fire-common🏺1.0-test:compile
[INFO] |  +- org.apache.geronimo.specs:geronimo-servlet_2.4_spec🏺1.1.1:compile
[INFO] |  +- com.caucho:hessian🏺3.1.6:compile
[INFO] |  +- org.jsoup:jsoup🏺1.6.2:compile
[INFO] |  +- org.aspectj:aspectjrt🏺1.6.11:compile
[INFO] |  +- org.aspectj:aspectjweaver🏺1.6.11:compile
[INFO] |  +- com.google.guava:guava🏺12.0:compile
[INFO] |  |  \- com.google.code.findbugs:jsr305🏺1.3.9:compile
[INFO] |  \- javax.mail:mail🏺1.4.1:compile
[INFO] |     \- javax.activation:activation🏺1.1:compile
[INFO] +- com.desksoft.fire.user.service:fire-user-service🏺1.0-test:compile
[INFO] +- com.desksoft.fire.article.service:fire-article-service🏺1.0-test:compile
[INFO] +- com.desksoft.fire.goods.service:fire-goods-service🏺1.0-test:compile

而web的依赖树是

[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ fire-wm-web ---
[INFO] com.desksoft.fire-web:fire-wm-web:war:1.0-SNAPSHOT
[INFO] +- com.desksoft.fire.core:fire-wm-core🏺1.0-SNAPSHOT:compile
[INFO] |  +- com.desksoft.common:fire-common🏺1.0-SNAPSHOT:compile
[INFO] |  |  +- org.apache.geronimo.specs:geronimo-servlet_2.4_spec🏺1.1.1:compile
[INFO] |  |  +- com.caucho:hessian🏺3.1.6:compile
[INFO] |  |  +- org.jsoup:jsoup🏺1.6.2:compile
[INFO] |  |  +- org.aspectj:aspectjrt🏺1.6.11:compile
[INFO] |  |  +- org.aspectj:aspectjweaver🏺1.6.11:compile
[INFO] |  |  +- com.google.guava:guava🏺12.0:compile
[INFO] |  |  |  \- com.google.code.findbugs:jsr305🏺1.3.9:compile
[INFO] |  |  \- javax.mail:mail🏺1.4.1:compile
[INFO] |  |     \- javax.activation:activation🏺1.1:compile
[INFO] |  +- com.desksoft.fire.user.service:fire-user-service🏺1.0-SNAPSHOT:compile
[INFO] |  +- com.desksoft.fire.article.service:fire-article-service🏺1.0-SNAPSHOT:compile
[INFO] |  +- com.desksoft.fire.goods.service:fire-goods-service🏺1.0-SNAPSHOT:compile




以下是问题补充:

@chongzai:服务jar版本使用变量设置,在pom中的配置如下: <modules> <module>fire-wm-core</module> <module>fire-wm-web</module> </modules> <profiles> <profile> <id>dev</id> <properties> <props>fire.wm</props> <user.version>1.0-SNAPSHOT</user.version> <common.version>1.0-SNAPSHOT</common.version> <article.version>1.0-SNAPSHOT</article.version> <goods.version>1.0-SNAPSHOT</goods.version> </properties> <activation> <activeByDefault>true</activeByDefault> </activation> </profile> <profile> <id>test</id> <properties> <props>fire.wm.test</props> <user.version>1.0-test</user.version> <common.version>1.0-test</common.version> <article.version>1.0-test</article.version> <goods.version>1.0-test</goods.version> </properties> </profile> <profile> <id>real</id> <properties> <props>fire.wm.real</props> <user.version>1.0</user.version> <common.version>1.0</common.version> <article.version>1.0</article.version> <goods.version>1.0</goods.version> </properties> </profile> </profiles> (2013/05/27 09:04)
加载中
返回顶部
顶部