This week's book giveaway is in the
Agile and other Processes
forum.
We're giving away four copies of
The Mikado Method
and have Ola Ellnestam and Daniel Brolund on-line!
See
this thread
for details.
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Engineering
»
Ant, Maven and Other Build Tools
Author
Building a war in eclipse using ant
Suresh Herumb
Greenhorn
Joined: Jan 22, 2010
Posts: 2
posted
Jan 22, 2010 14:44:20
0
Hello guys
I am newbie to web dev. Could anybody tell me how to build a war file in eclipse using ant?
Thanks in advance!
sur
Oleg Tikhonov
Ranch Hand
Joined: Aug 02, 2008
Posts: 55
posted
Jan 22, 2010 23:22:10
0
Hi,
Ant
has a
war
task.
Here is a fragment of the build.xml file
<target name="delete"> <delete dir="${build.dir}" verbose="false"/> <delete file="${basedir}/${war.name}" verbose="false"/> </target> <target name="mkdir" depends="delete"> <mkdir dir="${build.dir}"/> </target> <target name="compile" depends="mkdir"> <javac compiler="modern" srcdir="${src.dir}" destdir="${build.dir}" debug="off" fork="yes" failonerror="true" source="1.6" > <classpath refid="run.classpath"/> <compilerarg value="-Xlint:unchecked"/> </javac> </target> <target name="build" depends="compile"> <war destfile="${war.name}" webxml="${basedir}/WebContent/WEB-INF/web.xml"> <fileset dir="${basedir}/WebContent"/> <fileset dir="${src.dir}"/> <classes dir="build"/> </war> <echo message="${line.separator}As fresh as a daisy ${war.name}${line.separator}served at ${basedir} ;-)"/> </target>
Hope it helps,
Oleg.
Suresh Herumb
Greenhorn
Joined: Jan 22, 2010
Posts: 2
posted
Jan 25, 2010 11:50:18
0
Hi Oleg,
Thanks for the help, I didn't find time to try that.. I will and come back to you
Thanks again
Suree
I agree. Here's the link:
http://aspose.com/file-tools
subject: Building a war in eclipse using ant
Similar Threads
Eclipse - exporting files in WAR file
diff between war file created by Ant and eclipse
Building a .WAR file
how to create a war file in eclipse2.1 to deploy in tomcat 5.5
Struts2 with tomcat 6 unable to deploy war
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter