Reputation: 14363
I have a gradle project made of module and submodules.
| build.gradle (1)
|- common
| build.gradle (2)
|- webutils
| build.gradle (3)
|- spring
| build.gradle
|- security
| build.gradle
This is build.gradle
(1)
dependencies {
compile project(':common'), project(':common:webutils')
compile project(':spring'), project(':spring:security')
}
This is build.gradle
(2)
dependencies {
compile project(':common:webutils')
}
This is 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}")
}
When I try to build the jars with ./gradlew clean build
it procdues the following jar :
I expect
Looking at (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
~
Looking at (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
Looking at (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
and testCompile
dependencies in (3) not included in the jar ? According to the documentation
compile
: Compile time dependenciestestCompile
: Additional dependencies for compiling testsUpvotes: 0
Views: 1068
Reputation: 1769
Java doesn't normally bundle jar dependencies inside other jars. What are the contents of your MANIFEST.MF
files? If you want to bundle the dependencies, you might look at the shadow plugin.
Upvotes: 1