在gradle中,当我试图构建每个模块时,我需要在Jar中打包为Jar的外部依赖关系。
下面列出的依赖项很少:
dependencies {
compile group: 'org.springframework.integration', name: 'spring-integration-xml', version:'4.1.6.RELEASE'
compile group: 'org.springframework', name: 'spring-oxm', version:'3.0.0.RELEASE'
....
}
jar {
manifest{
attributes 'Main-Class':'com.MyfirstClass'
}
}最后,当我们试图查看Jar时,它应该在lib中包含依赖的Jar,如下所示
jar tvf build/libs/test.jar
META-INF/
META-INF/MANIFEST.MF
lib/
lib/spring-integration-xml.4.1.6.jar
.....提前谢谢!
发布于 2016-04-11 17:44:46
jar {
from(configurations.runtime) {
into 'lib'
}
}https://stackoverflow.com/questions/36555554
复制相似问题