【问题标题】:MobileFirst Building a project WAR file with AntMobileFirst 使用 Ant 构建项目 WAR 文件
【发布时间】:2015-03-02 15:10:52
【问题描述】:

我正在尝试在 MobileFirst Platform 6.3 中使用 Ant 构建项目 .war 文件。

我的 build.xml 有以下内容:

<?xml version="1.0" encoding="UTF-8"?>
    <project name="myProject" default="all">
        <taskdef resource="com/worklight/ant/defaults.properties">
            <classpath>
                <pathelement location="/Applications/IBM/Worklight-CLI/public/worklight-ant-builder.jar"/>
            </classpath>
        </taskdef>
        <target name="all">
            <war-builder projectfolder="."
                destinationfolder="bin/war"
                warfile="bin/project.war"
            classesFolder="classes-folder"/>
       </target>
   </project>

当我执行 Ant 脚本时,它会抛出以下错误:

[taskdef] 无法从资源加载定义 com/worklight/ant/defaults.properties。找不到。

【问题讨论】:

    标签: ant ibm-mobilefirst


    【解决方案1】:

    您提到您使用的是 MFP 6.3,但在您的 XML 中您指向“Worklight-CLI”,它不是 MFP 6.3,而是 6.2 或更早版本。您确定您真的在使用 MFP 6.3?
    它也指 CLI。您确定要使用 CLI 吗?在您的问题中没有提到 CLI...

    1. 验证您是否安装了您打算使用的正确版本
    2. 安装正确版本后,将 location 属性更改为:

    location="/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/ant-tools/worklight-ant-builder.jar"

    【讨论】:

    猜你喜欢
    • 2016-08-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多