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

时间:2016-08-02 17:40:31

标签: gradle ant

问题 没有这样的属性:类的前缀:org.gradle.api.task.bundling.War_Decorated。我正在尝试将我的蚂蚁脚本转换为Gradle,但我被困在带有前缀属性的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')

1 个答案:

答案 0 :(得分:0)

语法错误,Gradle / Groovy使用date{ match => ['field','MMM dd YYY'] } 代替Ant attribute : value

attribute = value