我们的 Gradle 脚本由根 "war" 项目和多个 (10+) 子 "jar" 项目组成。每个 JAR 项目都依赖于许多 (30-60) 个 JAR。部分示例:
dependencies {
compile 'dwr:dwr:3.0.0.117'
compile 'annotations:annotations:1.0'
compile 'abdera:abdera-core:0.4.0-incubating'
compile 'abdera:abdera-extensions-json:0.4.0-incubating'
compile 'abdera:abdera-extensions-main:0.4.0-incubating'
compile 'abdera:abdera-i18n:0.4.0-incubating'
compile 'abdera:abdera-parser:0.4.0-incubating'
compile 'aopalliance:aopalliance:1.0'
compile 'apacheds:apacheds-core:1.0.2'
compile 'apacheds:apacheds-core-shared:1.0.2'
compile 'apacheds:apacheds-kerberos-shared:1.0.2'
compile 'apacheds:apacheds-protocol-changepw:1.0.2'
compile 'apacheds:apacheds-protocol-kerberos:1.0.2'
compile 'apacheds:apacheds-protocol-ldap:1.0.2'
compile 'apacheds:apacheds-protocol-ntp:1.0.2'
compile 'apacheds:apacheds-protocol-shared:1.0.2'
compile 'apacheds:apacheds-server-jndi:1.0.2'
compile 'apacheds:apacheds-server-main:1.0.2'
compile 'apacheds:apacheds-server-ssl:1.0.2'
compile 'commons:commons-logging:1.0.4'
compile 'commons:commons-beanutils'
compile 'commons:commons-cli:1.0'
compile 'commons:commons-codec:1.3'
compile 'commons:commons-collections:3.2.1'
compile 'commons:commons-digester'
compile 'commons:commons-discovery:0.2'
compile 'commons:commons-fileupload:1.2'
compile 'commons:commons-io:1.2'
compile 'commons:commons-lang:2.4'
compile 'commons:commons-pool:1.5.4'
compile 'dom4j:dom4j-full'
compile 'ehcache:ehcache:1.6.2'
compile 'eigenbase:eigenbase-properties'
compile 'eigenbase:eigenbase-resgen'
compile 'eigenbase:eigenbase-xom'
compile 'FastInfoset:FastInfoset:1.2.7'
compile 'fop:fop'
compile 'freehep:freehep-export:2.1.1'
compile 'freehep:freehep-graphics2d:2.1.1'
compile 'freehep:freehep-graphicsio:2.1.1'
compile 'freehep:freehep-graphicsio-emf:2.1.1-adapted'
compile 'freehep:freehep-graphicsio-java:2.1.1'
compile 'freehep:freehep-graphicsio-pdf:2.1.1'
compile 'freehep:freehep-graphicsio-ps:2.1.1'
compile 'freehep:freehep-graphicsio-svg:2.1.1'
compile 'freehep:freehep-graphicsio-swf:2.1.1'
compile 'freehep:freehep-graphicsio-tests:2.1.1'
compile 'freehep:freehep-io:2.0.2'
compile 'freehep:freehep-swing:2.0.3'
compile 'freehep:freehep-util:2.0.2'
compile 'freehep:freehep-xml:2.1.1'
}
我想避免每个组件都有如此长的重复依赖项列表。应该有一种方法来对依赖项进行分组,例如“freehep”、“commons”、“apacheds”、“abdera”、“dwr”,并且每个组件都会引用这些组。