views:

71

answers:

2

Hello everyone,

I have an existing j2ee project which is very big and old. Therefore, my current building process is to open eclipse, file/export, and clic on War archive.

While our company turn over is as fast as new build is needed, we have to create an automated process. However, I'm searching the fastest way to automate building. I'm first looking to Maven2, but our application has a JDK1.4, which is lesser than the minimum 1.5.

I was looking to Maven1, but after some weirds bugs and some reading, it seems to be only an overlay to Ant. Why I'm not using directly Ant?

Here we are, I'm looking at Ant documentation and try to writing build.xml but it seems to be too much arduous with my big project. For god's sake, when I clic to Export/War, Eclipse do the job. Why I can't in the simplest way, reproduce or export the way Eclipse export the war file, into a build.xml or whatelse?

Some tools which convert Eclipse-metadata into ant-build.xml should exists. But does anyone know them ?

A: 

I don't think that creating the ant script to be so hard. Anyway, maybe this link could help: Creating a deployable WAR file from 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>
Tomas Narros
After I consumed most of my time, I've actually wrote an ant script from scratch. Thanks for your reply!
Doomsday
A: 

Did you try http://www.testingreflections.com/node/view/1129.

Anotherway may be to use IntelliJ to load eclipse project and the use intellij to create ant file

Jayan
Well, this solution is fine, but it is relevant only if the project using IntelliJ before. I had a look at this IDE and it was too much complex to convert my current WebSphere project into it... And the simplicity was my main argument :-)
Doomsday