【发布时间】:2014-11-20 23:24:52
【问题描述】:
我正在尝试启动 WebSphere Liberty 配置文件服务器(名为 WL_UAT_Server)
<project basedir="." default="help" name="myProject" xmlns:wlp="antlib:com.ibm.websphere.wlp.ant">
<target name="liberty-start">
<wlp:server id="test" installDir="/opt/IBM/WebSphere/Liberty" operation="start" serverName="WL_UAT_Server"/>
</target>
</project>
来自以下命令:
ant -f /opt/myProject/build.xml "liberty-start"
但系统出现以下错误:
/opt/myProject/build.xml:144: Problem: failed to create task or type antlib:com.ibm.websphere.wlp.ant:server
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.
No types or tasks have been defined in this namespace yet
This appears to be an antlib declaration.
Action: Check that the implementing library exists in one of:
-/usr/share/ant/lib
-/home/root/.ant/lib
-a directory added on the command line with the -lib argument
Total time: 2 seconds
跟随ant -diagonstics 命令的输出
------- Ant 诊断报告 ------- Apache Ant 1.7.1 版本于 2010 年 4 月 26 日编译
-------------------------------------------
Implementation Version
-------------------------------------------
core tasks : 1.7.1
optional tasks : not available
-------------------------------------------
ANT PROPERTIES
-------------------------------------------
ant.version: Apache Ant version 1.7.1 compiled on April 26 2010
ant.java.version: 1.6
ant.core.lib: /usr/share/java/ant-1.7.1.jar
ant.home: /usr/share/ant
-------------------------------------------
ANT_HOME/lib jar listing
-------------------------------------------
ant.home: /usr/share/ant
ant.jar (1339582 bytes)
ant-launcher.jar (12243 bytes)
ant-bootstrap.jar (19013 bytes)
wlp-anttasks.jar (43990 bytes)
-------------------------------------------
USER_HOME/.ant/lib jar listing
-------------------------------------------
user.home: /root
No such directory.
感谢任何帮助。
【问题讨论】:
-
您是将 Ant 作为独立工具运行还是从 Eclipse 或其他开发工具运行?
-
@Gas 我从命令行运行它。
-
虽然幸运:-)。我想,也许你是从 Eclipse 中调用它,因为它使用不同的类路径和 ANT_HOME。
-
@Gas 知道我做错了什么吗?
标签: ant websphere-8 websphere-liberty