【问题标题】:Deploy worklight application using Ant tasks使用 Ant 任务部署 Worklight 应用程序
【发布时间】:2013-09-23 23:30:59
【问题描述】:

我正在使用 Ant 将我的应用程序部署到生产应用程序服务器 (WebSphere)。 我使用位于 ${WORKLIGHT_INSTALL_DIR}\configuration-samples 文件夹中的示例配置文件。配置文件被标记为适用于 Websphere liberty 和 Apache derby。 在配置部分中,我更改了路径元素标记的值(并且只有这个值符合 IBM 文档)(在报告的代码下方)。

 <taskdef resource="com/worklight/ant/defaults.properties">
<classpath>
  <pathelement location="C:\workspace\jQueryMobileApplication\bin\jQueryMobileApplication.war"/>
</classpath>

设置为我的应用程序战争路径的位置。 build.xml 文件位于我项目的 war 文件的同一文件夹中。 当我输入命令时:

ant -f <filename>.xml 

我得到了这个例外:

Buildfile: C:\IBM\WorklightSRV\WorklightServer\configure-liberty-derby.xml
[taskdef] Could not load definitions from resource com/worklight/ant/defaults.properties. It could not be found.

我是 Worklight 开发(以及 Ant 部署)的新手,所以我感谢任何帮助,即使这可能是一个微不足道的问题。

【问题讨论】:

    标签: ant ibm-mobilefirst


    【解决方案1】:

    classpath 是为 worklight-ant.jar 定义任务给 ant 例如。

    <taskdef resource="com/worklight/ant/defaults.properties">
        <classpath>
            <pathelement location="./lib/worklight-ant.jar" />
        </classpath>
    </taskdef>
    

    加载 ant 任务后,您可以使用其中一个 worklight ant 任务来执行您的命令 例如。

    <echo>Export war file</echo>
            <war-builder projectfolder="./<ProjectDirectory>" destinationfolder="bin/war" warfile="bin/Application.war.${env}" classesFolder="<ProjectDirectory>/bin/classes" />
    

    据我所知,这将为您制造战争,但您必须手动部署它。

    【讨论】:

    • 谢谢 tik27,我改变了那些东西,现在我可以构建它了。无论如何我面临另一个问题,我没有设置'websphereapplicationserver installdir',所以它的值仍然是默认值(即/n/java/webservers/was-liberty-8.5-express)。我应该在哪个应用服务器的文件夹中安装应用程序?
    • 我尝试使用 C:\Programfiles\IBM\WebSphere\AppServer 或 C:\Programfiles\IBM\WebSphere\AppServer\newApp 但它还不起作用
    • 您运行的是完整的 Websphere 还是 websphere liberty?
    • 我的应用程序正在运行 WebSphere liberty,我设置了 websphere liberty 配置文件的目录并且它可以工作。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-12
    • 1970-01-01
    • 1970-01-01
    • 2010-11-18
    • 1970-01-01
    相关资源
    最近更新 更多