Ich habe ein Großprojekt aus Modulen und Submodulen.Warum produziert Gradle leere Archive?
| build.gradle (1)
|- common
| build.gradle (2)
|- webutils
| build.gradle (3)
|- spring
| build.gradle
|- security
| build.gradle
Dies ist build.gradle
(1)
dependencies {
compile project(':common'), project(':common:webutils')
compile project(':spring'), project(':spring:security')
}
Dies ist build.gradle
(2)
dependencies {
compile project(':common:webutils')
}
Dies ist 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}")
}
Wenn ich versuche bauen Die Gläser mit ./gradlew clean build
es procdues folgendes jar:
- /build/libs/libs-0.0.1-SNAPSHOT.jar
- common/bauen/libs/common-0.0.1-SNAPSHOT.jar
- common/webutils/build/libs/webutils-0.0.1-SNAPSHOT.jar
I erwarten
- (3) zu sein, umfassen in (2)
- (2), (3) zu sein, umfasst in (1)
Betrachtet man (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
~
Blick in (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
bei der Suche (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
~
- Warum sind meine Gläser (1) und (2) leer?
- Wo sind die
compile
undtestCompile
Abhängigkeiten in (3) nicht im Jar enthalten? Nach dem documentationcompile
: Zeitabhängigkeiten KompilierentestCompile
: Zusätzliche Abhängigkeiten für die Erstellung von Tests
Dank @ngreen. Ich habe versucht, das Schattenplugin mit der Konfiguration hinzuzufügen, die hier bereitgestellt wird: https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow und ich sehe noch nichts hinzugefügt. Außerdem dachte ich, dass die Verwendung von 'compile project (': common: webutils')' bedeutet, dass es "Zeitabhängigkeiten kompilieren" wird. – BigDong
Dies ist der Inhalt der 'MANIFEST.MF' eines leeren Kruges (es gibt nur eine Zeile):' Manifest-Version: 1.0' – BigDong