1

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

1 回答 1

0

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

<taskdef name="bundleapp"
     classname="com.oracle.appbundler.AppBundlerTask"   
     classpath="lib/appbundler-1.0.jar" />
于 2015-11-12T08:21:44.653 回答