0

I have a gradle project with several subprojects. and I have defined several dependencies in library with version numbers and aliases in the root project. Now whenever subproject needs it it can define that alias with what level it wants e.g. compile.

root
- build.gradle
    - libraries
        - xercesImpl: 'xerces:xercesImpl:2.8.1',
        - xalan: 'xalan:xalan:2.7.1',
\ project1 : ear
    - build.gradle
        - ear project('project2')
\ project2 : jar
    - build.gradle
        - compile libraries.xercesImpl
        - compile libraries.xalan

Since I have defined xercesImpl and xalan as dependencies of project1 and project1 is included in project2 ear those jars should be added to EAR, but it's getting excluded from EAR. I checked and transitive dependencies is not declared anywhere as false.

I have printed dependency tree with gradlew and it prints only above 2 jars as excluded others are included:

+--- org.hibernate:hibernate:3.1.3
|    +--- commons-logging:commons-logging:1.0.4 -> 1.1
|    |    +--- log4j:log4j:1.2.12
|    |    +--- logkit:logkit:1.0.1
|    |    +--- avalon-framework:avalon-framework:4.1.3
|    |    \--- javax.servlet:servlet-api:2.3
|    +--- ehcache:ehcache:1.1
|    |    \--- commons-logging:commons-logging:1.0.4 -> 1.1 (*)
|    +--- cglib:cglib:2.1_3
|    |    \--- asm:asm:1.5.3
|    +--- asm:asm:1.5.3
|    +--- asm:asm-attrs:1.5.3
|    +--- commons-collections:commons-collections:2.1.1 -> 3.1
|    +--- dom4j:dom4j:1.6.1
|    +--- javax.transaction:jta:1.0.1B
|    \--- antlr:antlr:2.7.6rc1 -> 2.7.6
+--- net.sf.ehcache:ehcache:2.9.0
|    \--- org.slf4j:slf4j-api:1.7.7
+--- xerces:xercesImpl:2.8.1 (*)
+--- xalan:xalan:2.7.1 (*)
Chirag Shah
  • 55
  • 1
  • 10

0 Answers0