[英]Gradle - Customize Classpath in Manifest
我想创建一个更通用的类路径,而不是从我的 build.gradle 文件的这个片段生成的:
jar {
manifest {
attributes (
"Main-Class": "x.y.z.main",
"Specification-Title" : "Oh how specific!",
"Specification-Vendor" : "Super Secret",
"Specification-Version" : "1.0",
"Implementation-Title" : "Top Notch Software",
"Implementation-Version" : "1.0 Build Nr. 1",
"Implementation-Vendor" : "Super Secret",
"Implementation-Vendor-Id" : "x.y.z.com",
"Implementation-Url" : "http://www.x.y.z.com",
"Class-Path": configurations.runtimeClasspath.files.collect { it.absolutePath }.join(' ')
)
}
这会产生这样的结果:
...Class-Path: C:\Users\YouWouldLikeToKnow\.gradle\caches\modules-2\files-2.1\org.springframework.cloud\spring-cloud-starter-gateway\3.1.3\d008ce51415d0507a1806bd0a518a21860ee0f63\spring-cloud-starter-gateway-3.1.3.jar...
相反,我想将其配置为:
...Class-Path: libs\external\spring-cloud-starter-gateway-3.1.3.jar...
就像是:
configurations.runtimeClasspath.files.collect {"libs\external\" + it.fileName}.join(' ')
你能试试:
'Class-Path': configurations.runtime.files.collect{ "lib/external/" + it.getName() }.join(' ')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.