Sto*_*wke 1 jar war gradle build.gradle
在尝试从疯狂复杂的ant构建迁移到gradle的持续传奇中 - 我正在生成一些用于'javahelp'的资源jar文件.它们不包含任何类.我需要将创建这些资源jar的项目的输出添加到我的战争的根源(而不是WEB-INF/lib).
我试图解决的问题
apply plugin: 'war'
//Move files into position for the mmplEar project
task stage(overwrite: true, dependsOn: war) << {
}
war {
from project(':help:schedwincli').buildDir.absolutePath + '/libs'
include '*.jar'
}
dependencies {
//Ensure the jar is generated, but we don't want it in the lib dir
providedCompile project(':help:schedwincli')
}
Run Code Online (Sandbox Code Playgroud)
这会编译并运行,并且:help:schedwincli会运行并生成所需的jar,但是当我打开我的war文件时,预期的jar不会出现在战争的任何地方.建议?
编辑
我在下面提出了Peter建议的更改,但现在我收到此错误:
无法在配置容器上找到属性"资源".
这就是它说失败的地方:
from '../../runtime', /*Fails on this line*/
'../../runtime/html',
'../../runtime/html/Jboss',
'../../runtime/props',
'../../runtime/props/Jboss',
'../../scripts',
'../../../proj/runtime',
'../../../proj/runtime/html',
'../../../proj/runtime/html/Jboss',
'../../../proj/runtime/props',
'../../../proj/runtime/props/Jboss',
configurations.resources
include '*.css'
include '*.gif'
include '*.html'
include '*.jpg'
include '*.jnlp'
include '*.props'
include '*.properties'
include 'jsps/**'
include '*.jar'
include 'log4j/**'
include 'setupLdap.cmd'
include 'spreadsheets/*.xlsx'
Run Code Online (Sandbox Code Playgroud)
你想要的东西:
configurations {
resources
}
dependencies {
resources project(':help:schedwincli')
}
war {
from configurations.resources
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2868 次 |
| 最近记录: |