无法在工作灯 6.2 中创建任务或输入 war-builder [英] failed to create task or type war-builder in worklight 6.2

查看:22
本文介绍了无法在工作灯 6.2 中创建任务或输入 war-builder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 workklight 6.2 并编写了以下 ant 任务来在 linux 机器命令行上构建 war 文件.

I am using workklight 6.2 and wrote following ant task to build war file on linux machine command line.

<taskdef resource="com/worklight/ant/defaults.properties">
    <classpath>
        <pathelement location="opt/IBM/Worklight/WorklightServer/worklight-ant-builder.jar"/>
    </classpath>
</taskdef>

<target name="build-war">        
    <war-builder projectfolder="${basedir}"
                 destinationfolder="bin/"
                 warfile="bin/MyProject.war"
                 classesFolder="classes-folder"/>
</target>

当我使用以下命令ant -f/opt/MyWS/MyProject/build.xmlbuild-war"执行任务时,它给了我以下错误:

When I execute the task with following command "ant -f /opt/MyWS/MyProject/build.xml "build-war" it gives me following error :

Problem: failed to create task or type war-builder
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.

ANT_HOME 设置为/opt/IBM/Worklight/tools/apache-ant-1.8.4".当我在 Eclipse 中执行相同的任务时,它工作正常.

ANT_HOME is set to "/opt/IBM/Worklight/tools/apache-ant-1.8.4". When I execute the same task in eclipse, it just works fine.

推荐答案

jar 文件的路径似乎没有正确设置(您错过了根斜杠):

It seems the path to the jar file is not set correctly (you missed the root slash):

<taskdef resource="com/worklight/ant/defaults.properties">
    <classpath>
      <pathelement location="/opt/IBM/Worklight/WorklightServer/worklight-ant-builder.jar"/>
    </classpath>
</taskdef>

这篇关于无法在工作灯 6.2 中创建任务或输入 war-builder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆