0
我有一個由模塊和子模塊組成的gradle項目。爲什麼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
它procdues下面罐的罐子:
- /build/libs/libs-0.0.1-SNAPSHOT.jar
- 公共/建造/庫/共0.0.1-SNAPSHOT.jar
- 公共/ webutils /建造/庫/ webutils-0.0.1-SNAPSHOT.jar
我期望
- (3)是包括在(2)
- (2),(3)是包括在(1)
尋找在(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
~
- 爲什麼我的jar(1)和(2)是空的?
- 哪裏有
compile
和testCompile
依賴關係(3)不包含在jar中?按照documentationcompile
:編譯時依賴testCompile
:附加依賴於編譯測試
Thanks @ngreen。我試圖添加陰影插件與在這裏提供的配置:https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow,我仍然沒有看到添加任何東西。另外,我認爲使用'compile project(':common:webutils')'實際上意味着它會「編譯時間依賴性」。 – BigDong
這是一個空罐子(只有一行)的'MANIFEST.MF'的內容:'Manifest-Version:1.0' – BigDong