我正在尝试为所有子项目定义一个jar任务(大约30个) . 我尝试了以下任务:
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依赖项在超级项目的构建文件中定义 .
是否有可能将所有需要的类路径条目(第三方库和其他项目)包含到所有子项目的超级项目中的清单类路径中 .
1 回答
这就是我开始工作的方式 . 仅使用调用获取Project依赖项:
然后将每个项目的libsDir的内容添加到我的Class-Path清单条目中 .