编辑ant build.xml以在ubuntu服务器中工作

时间:2017-08-14 07:49:42

标签: java xml ubuntu ant

我需要你的帮助,让build.xml在ubuntu服务器上执行,并为web应用程序生成war文件。

实际上在windows eclipse中,我将我的Web应用程序文件导入为动态项目并生成了build.xml文件。

<?xml version="1.0" encoding="UTF-8" standalone="no" ?> 
- <!-- 
 WARNING: Eclipse auto-generated file.
              Any modifications will be overwritten.
          To include a user specific buildfile here, simply create one in the same
          directory with the processing instruction <?eclipse.ant.import?>
          as the first entry and export the buildfile again. 

  --> 
 <project basedir="." default="build" name="taf-web-enh">
  <property environment="env" /> 
  <property name="ECLIPSE_HOME" value="../../eclipse/" /> 
  <property name="debuglevel" value="source,lines,vars" /> 
  <property name="target" value="1.8" /> 
  <property name="source" value="1.8" /> 
- <path id="Apache Tomcat v7.0 [Apache Tomcat v7.0].libraryclasspath">
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/annotations-api.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/catalina-ant.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/catalina-ha.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/catalina-tribes.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/catalina.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/ecj-4.4.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/el-api.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/jasper-el.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/jasper.jar" /> 
   <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/jsp-api.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/servlet-api.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/tomcat-api.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/tomcat-coyote.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/tomcat-dbcp.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/tomcat-i18n-es.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/tomcat-i18n-fr.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/tomcat-i18n-ja.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/tomcat-jdbc.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/tomcat-util.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/tomcat7-websocket.jar" /> 
  <pathelement location="C:/Program Files/Apache Software Foundation/Tomcat 
7.0/lib/websocket-api.jar" /> 
  </path>
- <path id="Web App Libraries.libraryclasspath">
  <pathelement location="WebContent/WEB-INF/lib/DBPool-5.0.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/activation-1.0.2.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/asm-1.5.3.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/cglib-2.1.3.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/commons-beanutils-1.7.0.jar" 
/> 
  <pathelement location="WebContent/WEB-INF/lib/commons-collections-3.1.jar" 
/> 
  <pathelement location="WebContent/WEB-INF/lib/commons-dbcp-1.2.1.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/commons-digester-1.7.jar" /> 

  <pathelement location="WebContent/WEB-INF/lib/commons-fileupload.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/commons-io-1.2.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/commons-lang-2.1.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/commons-logging-1.0.4.jar" 
/> 
  <pathelement location="WebContent/WEB-INF/lib/commons-logging.jar" /> 
   <pathelement location="WebContent/WEB-INF/lib/commons-pool-1.2.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/commons-validator-1.1.4.jar" 
/> 
  <pathelement location="WebContent/WEB-INF/lib/commons-validator.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/dom4j-1.6.1.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/ehcache-1.1.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/hibernate-3.1.3.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/itextpdf-5.5.2.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/java-json.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/json-lib.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/jta-1.0.1b.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/log4j-1.2.13.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/mail.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/mysql-connector-java-
3.1.12.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/rt.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/spring.jar" /> 
  <pathelement location="WebContent/WEB-INF/lib/struts-1.2.4.jar" /> 
  </path>
  <path id="EAR Libraries.libraryclasspath" /> 
- <path id="taf-web-enh.classpath">
  <pathelement location="build/classes" /> 
  <path refid="Apache Tomcat v7.0 [Apache Tomcat v7.0].libraryclasspath" /> 
  <path refid="Web App Libraries.libraryclasspath" /> 
  <path refid="EAR Libraries.libraryclasspath" /> 
  </path>
- <target name="init">
  <mkdir dir="build/classes" /> 
- <copy includeemptydirs="false" todir="build/classes">
- <fileset dir="src">
  <exclude name="**/*.java" /> 
  </fileset>
  </copy>
  </target>
- <target name="clean">
  <delete dir="build/classes" /> 
  </target>
  <target depends="clean" name="cleanall" /> 
  <target depends="build-subprojects,build-project" name="build" /> 
  <target name="build-subprojects" /> 
- <target depends="init" name="build-project">
  <echo message="${ant.project.name}: ${ant.file}" /> 
- <javac debug="true" debuglevel="${debuglevel}" destdir="build/classes" 
  includeantruntime="false" source="${source}" target="${target}">
  <src path="src" /> 
  <classpath refid="taf-web-enh.classpath" /> 
  </javac>
  </target>
  <target description="Build all projects which reference this project. 
Useful to propagate changes." name="build-refprojects" /> 
- <target description="copy Eclipse compiler jars to ant lib directory" 
name="init-eclipse-compiler">
- <copy todir="${ant.library.dir}">
  <fileset dir="${ECLIPSE_HOME}/plugins" 
includes="org.eclipse.jdt.core_*.jar" /> 
  </copy>
- <unzip dest="${ant.library.dir}">
  <patternset includes="jdtCompilerAdapter.jar" /> 
  <fileset dir="${ECLIPSE_HOME}/plugins" 
 includes="org.eclipse.jdt.core_*.jar" /> 
  </unzip>
  </target>
- <target description="compile project with Eclipse compiler" name="build-
eclipse-compiler">
  <property name="build.compiler" 
value="org.eclipse.jdt.core.JDTCompilerAdapter" /> 
  <antcall target="build" /> 
  </target>
  </project>

当我复制到ubuntu服务器并使用ant构建时,我收到的错误就像找不到javax.servlet包。 我非常需要你的帮助来修改代码以便在ubuntu服务器16.04中使用ant

在ubuntu中安装了软件: OpenJDK 8 apache tomcat 7 蚂蚁1.9

0 个答案:

没有答案