gpt4 book ai didi

gradle - 尝试在Gradle脚本中输入Ant前缀属性时出错

转载 作者:行者123 更新时间:2023-12-03 06:06:13 25 4
gpt4 key购买 nike

问题
无此类属性:类的前缀:org.gradle.api.task.bundling.War_Decorated。我正在尝试将我的ant脚本转换为Gradle,但是我被困在具有prefix属性的zipfileset中。

Ant 脚本

 <war destfile="${dist.dir}/${warname}.war" update="true" >
<manifest>
<attribute name="Implementation-Vendor" value="place" />
<attribute name="Implementation-Version" value="${label}" />
<attribute name="Interface-Version" value="${Interface-Version}" />
<attribute name="Implementation-Title" value="Telescope WS" />
<attribute name="Compiled-By" value="${user.name}" />
<attribute name="Compiled-On" value="${TODAY}" />
<attribute name="Sealed" value="false" />
</manifest>

<zipfileset dir="src/com/place/telescope" prefix="WEB-INF/classes/com/place/telescope">
<include name="*.xml" />
</zipfileset>

Gradle脚本
 war {

manifest {
attributes ('Implementation-Vendor': 'Place',
'Implementation-Version': "$label",
'Interface-Version': project.'Interface-Version',
'Implementation-Title': 'Telescope WS',
'Compiled-By': 'user.name',
'Compiled-On': 'TODAY',
'Sealed': 'false')

}
archiveName 'MANIFEST.MF'
//dependsOn 'zipAllfileset'
}

war.manifest.writeTo('dist/warname.war/')

fileset(dir: 'src/com/place/telescope', includes: '*.xml',
prefix = 'dist/warname.war/WEB-INF/classes/com/place/telescope')

最佳答案

语法错误,Gradle / Groovy使用attribute : value而不是Ant attribute = value:

fileset(dir: 'src/com/place/telescope', includes: '*.xml',
prefix: 'dist/warname.war/WEB-INF/classes/com/place/telescope')

关于gradle - 尝试在Gradle脚本中输入Ant前缀属性时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38727116/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com