failed to create task or type war-builder in worklight 6.2

孤街浪徒 提交于 2019-12-11 20:13:05

问题


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>

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 is set to "/opt/IBM/Worklight/tools/apache-ant-1.8.4". When I execute the same task in eclipse, it just works fine.


回答1:


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>


来源:https://stackoverflow.com/questions/26554835/failed-to-create-task-or-type-war-builder-in-worklight-6-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!