我想为所有子项目(大约30)定义一个jar任务。我尝试了以下任务:在gradle中为jar清单定义自定义类路径
jar {
destinationDir = file('../../../../_temp/core/modules')
archiveName = baseName + '.' + extension
metaInf {
from 'ejbModule/META-INF/' exclude 'MANIFEST.MF'
}
def manifestClasspath = configurations.runtime.collect { it.getName() }.join(',')
manifest {
attributes("Manifest-Version" : "1.0",
"Created-By" : vendor,
"Specification-Title" : appName,
"Specification-Version" : version,
"Specification-Vendor" : vendor,
"Implementation-Title" : appName,
"Implementation-Version" : version,
"Implementation-Vendor" : vendor,
"Main-Class" : "com.dcx.epep.Start",
"Class-Path" : manifestClasspath
)
}
}
我的问题是,该子项目之间的依赖关系不包括在清单的类路径。我尝试将运行时配置更改为编译配置,但会导致以下错误。
- 出了什么问题:发生了评估项目 ':EskoordClient'。
您无法更改未处于未解决状态的配置!
这是项目EskoordClient我的完整构建文件:
dependencies {
compile project(':ePEPClient')
}
我的大部分子项目的建设文件只定义了项目的依赖。第三方lib依赖关系在超级项目的构建文件中定义。
是否有可能将所有需要的类路径条目(第三方库和其他项目)包含到所有子项目的超级项目中的清单类路径中。
你声明的每子项目,它的任务? (我没有看到一个'subprojects {}'块。)出现“无法更改配置”错误,因为您在做这项工作的时间太早(配置阶段而不是执行阶段)。项目依赖关系对我来说是正确的。你正在使用哪个Gradle版本? – 2012-07-13 13:05:45
我正在使用gradle版本1.0 目前,我在配置'操作中配置了jar目标:configure(subprojects.findAll {it.name.endsWith('Service')|| it.name.endsWith('Common')) || it.name.endsWith('Client')})' – user1490402 2012-07-16 10:49:58