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



当我要在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>

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

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

相关内容

最新更新