Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ANT BUILD.XML HELP!!!!

Status
Not open for further replies.

ejmelious

Programmer
May 24, 2005
5
US
Can someone please point me to a very simple tutorial on build.xml files, I have read at leat 10 so far and none are helping me set up what I need to set up.

thanks...
 
What do you need to set up?

Tim
---------------------------
"Your morbid fear of losing,
destroys the lives you're using." - Ozzy
 
ok this is what I am trying to do: I want to deploy a web application so it is accessable to the server.

This is my file directory:
bluegrass\
has html and jsp pages
bluegrass\WEB-INF
has web.xml file
bluegrass\WEB-INF\classes
has my class files
bluegrass\WEB-INF\lib
has my jar files

I want to take and make a web app out of these files. I am not sure how to set up a build.xml file to handle the jsp's (4) and the java servlet(1). I am also unsure what to do with properties. I think for targets I am going to use initiate, build, clean, compile, dist, deploy....

But again it is mainly the properties and classpath that I get hung up on I have never done a build.xml file before so I am lost!
 
...make a web app out of these files.

Are you wanting to build a .war file from these? Or is deployment gonna be a simple matter of a straight file-copy?

(One thought ... a lot of Open Source dists come with build files, if you could find one which uses JSP etc, its build file may give you a starting point to help you create your own).

Tim
---------------------------
"Your morbid fear of losing,
destroys the lives you're using." - Ozzy
 
I was planning on creating a war file with this buil file and then having the war file be deployed.
This is what I am thinking so far:
<?xml version="1.0"?>
<project name="bluegrass" default="buildwar" basedir=".">
<target name="init">
<property name="webinf.dir" value="${basedir}/WEB-INF"/>
<property name="lib.dir" value="${webinf.dir}/lib"/>
<property name="classes.dir" value="${webinf.dir}/classes"/>
<property name="fileset.dir" value="${basedir}/bluegrass"/>
</target>
<target name="buildwar" depends="init">
<war destfile="myapp.war" webxml="${webinf.dir}/web.xml">
<fileset dir="${fileset.dir}"/>
<lib dir="${lib.dir}"/>
<classes dir="${classes.dir}"/>
</war>
</target>
</project>

Does that look reasonably correct?
 
I haven't the time to go and check for definite, but yes, it looks okay to me.

Tim
---------------------------
"Your morbid fear of losing,
destroys the lives you're using." - Ozzy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top