2017-06-12 16 views
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}") 
} 

私はしようとビルドするそれは次のjar procdues ./gradlew clean buildと瓶:

  1. /build/libs/libs-0.0.1-SNAPSHOT.jarを
  2. 共通/構築/ libsに/共通-0.0.1-SNAPSHOT.jarに
  3. 共通/ webutils /構築/ LIBS/webutils-0.0.1-SNAPSHOT.jarに

Iは

  • (3)(2)
  • に含めることを期待
  • (2)、(3)(目線(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 
    

    目線(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 
    ~     
    

    目線(1)

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 
~    
  • なぜ私の瓶(1)と(2)は空ですか?
  • (3)のcompiletestCompileの依存関係はどこにありますか? documentation
    • compileによると:時間依存性に
    • testCompileをコンパイルします:テスト

答えて

1

をコンパイルするための追加の依存関係は、Javaは、通常、他のjarファイル内のjarファイルの依存関係をバンドルしません。ファイルMANIFEST.MFの内容は何ですか?依存関係をバンドルする場合は、shadow pluginを参照してください。

+0

ありがとう@ngreen。 https://plugins.gradle.org/plugin/com.github.johnrengelman.shadowで提供されている設定でシャドープラグインを追加しようとしましたが、まだ何も追加されていません。また、 'compile project( ':common:webutils')'を使うのは、実際には "Compile time dependencies"を意味すると思いました。 – BigDong

+0

これは、空のjarファイルの 'MANIFEST.MF'の内容です(行は1つしかありません)。' Manifest-Version:1.0' – BigDong

関連する問題