Windows 7, Java jdk1.6.0_32, Ant 1.9
用户,系统变量:
JAVA_HOME : C: Program Files Java jdk1.6.0_32
路径>:C: Program Files Java jdk1.6.0_32; C: bin 蚂蚁;ANT_HOME:c:ANT
Run command prompt as administrator
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
H:>c:
C:>w:
W:>cd webadvisor
W:WebAdvisor>cd wasql*
W:WebAdvisorWASQLTEST3>c:antbinant
Buildfile: W:WebAdvisorWASQLTEST3build.xml
init:
prepare:
[echo] Preparing Update...
[copy] Copying 208 files to W:WebAdvisorWASQLTEST3temp
[copy] Copying 129 files to W:WebAdvisorWASQLTEST3temp
[copy] Copying 49 files to W:WebAdvisorWASQLTEST3temp
splitdocs:
merge-cleanup:
[delete] Deleting: W:WebAdvisorWASQLTEST3customWEB-INFweb.xml
findwebxml:
merge:
datatelxmloverride:
mergeDefault:
BUILD FAILED
W:WebAdvisorWASQLTEST3build.xml:112: The following error occurred while executing this line:
W:WebAdvisorWASQLTEST3build.xml:165: The following error occurred while executing this line:
W:WebAdvisorWASQLTEST3build.xml:173: java.lang.NoClassDefFoundError: org/apache/xml/serialize/OutputFormat
at org.codehaus.cargo.module.webapp.WebXmlIo.writeWebXml(WebXmlIo.java:256)
at org.codehaus.cargo.module.webapp.WebXmlIo.writeWebXml(WebXmlIo.java:225)
at org.apache.cactus.integration.ant.WebXmlMergeTask.execute(WebXmlMergeTask.java:120)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at
org/apache/xml/serialize/OutputFormat是一个Xerces类…在系统中搜索xerces*.jar。这个文件存在吗?它在您的类路径中吗?
您的类路径缺少
所需的jarorg/apache/xml/serialize/OutputFormat
检查你的类路径中是否有xercesImpl.jar
EDIT:
您可以通过在ant编译目标中包含所需的jar并将所有所需的jar放在lib文件夹中来设置。
<target name="compile" depends="" description="compile the java source files">
<javac srcdir="." destdir="${build}">
<classpath>
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>