3招解决ant构建时任务找不到(taskdef cann't be found)的问题
来源:互联网 发布:dedecms改cms不变 编辑:程序博客网 时间:2024/05/13 20:22
在用ant编译项目时,有时会碰到build.xml中所定义的任务找不到的问题:
[root@tivu25 test]# ant -f build.xml local_warBuildfile: build.xmllocal_war:BUILD FAILED/home/haoqf/software/APM/test/build.xml:18: taskdef class com.ibm.team.build.ant.task.LogPublisherTask cannot be foundTotal time: 0 seconds
这是因为ant在当前java的classpath中找不到类LogPublisherTask(LogPublisherTask由 org.apache.tools.ant.Task派生而来),这时候需要重新指定当前的classpath,让它包含LogPublisherTask所属jar库或者class的路径。有三种方法:
1. 在ant命令行指定:
[root@tivu25 test]# ant -f build.xml local_war -lib /home/haoqf/software/RTC/RTC-BuildSystem-Toolkit-Linux-3.0iFix1/jazz/buildsystem/buildtoolkit/
2. 在build.xml指定:
<?xml version="1.0" encoding="UTF-8"?><project name="BVT_CVT" default="local_war"> <target name="local_war"> <taskdef name="logPublisher" classname="com.ibm.team.build.ant.task.LogPublisherTask"> <classpath> <pathelement location="/home/haoqf/software/RTC/RTC-BuildSystem-Toolkit-Linux-3.0iFix1/jazz/buildsystem/buildtoolkit/"/> <fileset dir="/home/haoqf/software/RTC/RTC-BuildSystem-Toolkit-Linux-3.0iFix1/jazz/buildsystem/buildtoolkit/"> <include name="**/*.jar"/> </fileset> </classpath> </taskdef> <logPublisher repositoryAddress="${repositoryAddress}" /> </target></project>
3. 设定当前环境变量CLASSPATH:
[root@tivu25 test]# export CLASSPATH=$CLASSPATH:/home/haoqf/software/RTC/RTC-BuildSystem-Toolkit-Linux-3.0iFix1/jazz/buildsystem/buildtoolkit/com.ibm.team.build.toolkit_2.2.0.v20110308_0258.jar
其中com.ibm.team.build.toolkit_2.2.0.v20110308_0258.jar包含了类LogPublisherTask的实现。
来源:
http://blog.chinaunix.net/uid-23741326-id-3191369.html
0 0
- 3招解决ant构建时任务找不到(taskdef cann't be found)的问题
- 3招解决ant构建时任务找不到(taskdef cann't be found)的问题
- "taskdef class org.hibernate.tool.ant.HibernateToolTask cannot be found"的解决
- taskdef class org.apache.catalina.ant.InstallTask cannot be found!
- ant debug 出现的错误:build.xml:49 taskdef class com.android.ant.SetupTask cannot be found
- ant debug 出现的错误:build.xml:49 taskdef class com.android.ant.SetupTask cannot be found(zt)
- cann't open file的错误解决
- Ant-JMS Exception: taskdef class weblogic.ant.taskdefs.management.WLConfig cannot be found
- 【ANT】taskdef class org.programmerplanet.ant.taskdefs.jmeter.JMeterTask cannot be found using the cla
- Eclipse生成的Android Project在用ant install部署时报taskdef class com.android.ant.SetupTask cannot be found异常
- Ant taskdef class net.sf.antcontrib.logic.ForEach cannot be found
- taskdef class com.android.ant.SetupTask cannot be found using the classloader AntClassLoader
- ant编译android程序时报错,build.xml:49: taskdef class com.android.ant.SetupTask cannot be found
- Android ADT 升级后 tools\ant\build.xml:828: taskdef class proguard.ant.ProGuardTask cannot be found
- 解决Android Studio默认AppTheme主题找不到的问题 The following classes could not be found: - android.support.v
- taskdef class xdoclet.modules.ejb.EjbDocletTask cannot be found解决办法
- taskdef class com.install4j.install4jtask cannot found解决
- windows7下用svn出现的"cann't move file"的问题
- mongo的upsert(spring的mongo template)
- 关于ping时候出现Network is unreachable
- 核桃运算创办人薛文蔚推出即时资料分析引擎
- java.lang.VerifyError错误参考解决办法
- 外媒预测2015年十大最热门工作
- 3招解决ant构建时任务找不到(taskdef cann't be found)的问题
- 强噪声下的语音检测 VAD
- Node.js+Web TWAIN,实现Web文档扫描和图像上传
- Python装饰器与面向切面编程
- typedef
- hbase export 使用小技巧
- ARM amba总线介绍
- 如何阅读SDF文件
- 分享10个实用的jQuery代码开发小技巧