我在ant中使用app bundler时遇到错误

时间:2013-02-19 07:53:53

标签: java macos ant app-bundle

当我要在ant中使用app bundler创建.app文件时,会出现以下错误:

/Users/vijaygupta/NetBeansProjects/Screen Grabber/build.xml:14: Problem: failed to create task or type bundleapp
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

我的build.xml文件是:

<?xml version="1.0" encoding="UTF-8"?>
<project name="Screen_Project" default="default" basedir=".">        
<import file="nbproject/build-impl.xml"/>

<taskdef name="Screen_Project"
         classname="com.oracle.appbundler.AppBundlerTask"   
         classpath="lib/appbundler-1.0.jar" />

<target name="ScreenProject">
    <bundleapp outputdirectory="dist"
        name="ScreenProject"
        displayname="ScreenGrabber"
        identifier="Main.MainIconPage"
        mainclassname="Main.MainIconPage">
        <classpath file="dist/Screen_Project.jar" />
    </bundleapp>
</target>

</project>

1 个答案:

答案 0 :(得分:0)

问题是您的build.xml不包含bundleapp标记的taskdef。从上面的示例可以看出,您已将其更改为Screen_Project,您只需将taskdef替换为:

<taskdef name="bundleapp"
     classname="com.oracle.appbundler.AppBundlerTask"   
     classpath="lib/appbundler-1.0.jar" />