Automatically generate Ant build.xml

I have an existing J2EE project that is very large and old. So my current construction process is to open eclipse, file / export and click in the War archive.

While our company is turning over as fast as a new assembly is required, we must create an automated process. However, I am looking for the fastest way to automate construction. I look at Maven2 first, but our application has JDK1.4, which is less than the minimum 1.5.

I searched for Maven1, but after some weird errors and some reading, this seems to be just an overlay on Ant. Why am I not using Ant directly?

Here we are, I am looking at the Ant documentation and trying to write build.xml, but it seems to be too complicated for my large project. For God's sake, when I contact Export / War, Eclipse will complete the task . Why can't I reproduce or export the easiest way to export the Eclipse military file to the build.xml file or something else?

Some tools that convert Eclipse metadata to ant -build.xml must exist. But does anyone know them?

+4
source share
2 answers

I don't think creating an ant script would be so complicated. Anyway, maybe this link can help: Create a deployable WAR file from an Eclipse project

Here is an example ant file (copied from the linked page):

<?xml version="1.0" encoding="ISO-8859-1"?> <project name="Deploy From Eclipse to Tomcat" basedir="."> <property name="warfile" value="sanfran"/> <target name="unpack"> <unwar src="${warfile}.war" dest="${warfile}" /> </target> <target name="create"> <war destfile="${warfile}.war" webxml="WebContent/WEB-INF/web.xml" update="true"> <classes dir="build\classes"/> <fileset dir="WebContent"> <exclude name="WEB-INF/web.xml"/> </fileset> </war> </target> <target name="copy"> <copy todir="c:\tomcat5517\webapps" overwrite="true"> <fileset dir="."> <include name="*.war"/> </fileset> </copy> </target> <target name="deploy"> <antcall target="create"/> <antcall target="copy"/> </target> </project> 
+4
source

Have you tried http://www.testingreflections.com/node/view/1129 .

In another case, you may need to use IntelliJ to load the eclipse project and use intellij to create the ant file

+1
source

All Articles