我有一个由模块和子模块组成的gradle项目。
| build.gradle (1)
|- common
| build.gradle (2)
|- webutils
| build.gradle (3)
|- spring
| build.gradle
|- security
| build.gradle
这是build.gradle
(1)
dependencies {
compile project(':common'), project(':common:webutils')
compile project(':spring'), project(':spring:security')
}
这是build.gradle
(2)
dependencies {
compile project(':common:webutils')
}
这是build.gradle
(3)
dependencies {
compile("javax.servlet:javax.servlet-api:${javaxServletApiVersion}")
testCompile("javax.servlet:javax.servlet-api:${javaxServletApiVersion}")
testCompile("org.springframework:spring-test:${springVersion}")
testCompile("junit:junit:${junitVersion}")
}
当我尝试使用./gradlew clean build
构建jar时,它会生成以下jar:
我希望
看(1)
" zip.vim version v27
" Browsing zipfile libs-0.0.1-SNAPSHOT.jar
" Select a file with cursor and press ENTER
META-INF/
META-INF/MANIFEST.MF
~
看(2)
" zip.vim version v27
" Browsing zipfile common-0.0.1-SNAPSHOT.jar
" Select a file with cursor and press ENTER
META-INF/
META-INF/MANIFEST.MF
看(3)
" zip.vim version v27
" Browsing zipfile webutils-0.0.1-SNAPSHOT.jar
" Select a file with cursor and press ENTER
META-INF/
META-INF/MANIFEST.MF
com/
com/domain/
com/domain/api/
com/domain/api/common/
com/domain/api/common/webutils/
com/domain/api/common/webutils/URLUtils.class
com/domain/api/common/webutils/RandomUtils.class
~
compile
和testCompile
依赖项?根据{{3}}
compile
:编译时间依赖性testCompile
:编译测试的其他依赖项