如何使用Ant Build脚本打包Groovy类或Groovy项目?

时间:2018-08-26 08:55:48

标签: groovy build ant packaging

Error: Could not find or load main class GroovyDemoClass

我正在使用类似于下面的build.xml文件

<project>

    <target name="clean">
        <delete dir="build"/>
    </target>

    <target name="compile">
        <mkdir dir="build/classes"/>
        <javac srcdir="src" destdir="build/classes"/>
    </target>

    <target name="jar">
        <mkdir dir="build/jar"/>
        <jar destfile="build/jar/GroovyDemoClass.jar" basedir="build/classes">
            <manifest>
                <attribute name="Main-Class" value="GroovyDemoClass"/>
            </manifest>
        </jar>
    </target>

    <target name="run">
        <java jar="build/jar/GroovyDemoClass.jar" fork="true"/>
    </target>

</project>

我的疑问是,ANT能否识别Java类文件之类的Groovy类文件

0 个答案:

没有答案