jakarta ant n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Jakarta Ant PowerPoint Presentation
Download Presentation
Jakarta Ant

Loading in 2 Seconds...

play fullscreen
1 / 19

Jakarta Ant - PowerPoint PPT Presentation


  • 152 Views
  • Uploaded on

Jakarta Ant. Sean C. Sullivan June 25, 2002 Portland Java Users Group. Jakarta. Tomcat Struts Ant Log4j HttpClient …and many more!. What is Ant?. Ant is an extensible build tool. “In theory, it is kind of like Make, but without Make's wrinkles.”. Projects that use Ant. Tomcat

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Jakarta Ant' - sandra_john


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
jakarta ant

Jakarta Ant

Sean C. Sullivan

June 25, 2002

Portland Java Users Group

jakarta
Jakarta
  • Tomcat
  • Struts
  • Ant
  • Log4j
  • HttpClient
  • …and many more!
what is ant
What is Ant?

Ant is an extensible build tool.

“In theory, it is kind of like Make, but without Make's wrinkles.”

projects that use ant
Projects that use Ant
  • Tomcat
  • NetBeans
  • JBoss
  • JDOM
what ant can do for you
What Ant Can Do For You
  • automate your project’s build and deployment tasks
  • compile Java source code
  • create JAR’s, ZIP’s, EAR’s, and WAR’s
  • automate Javadoc generation
  • run test suites
  • deploy files to remote systems
ant terminology
Ant terminology
  • buildfile
  • project
  • targets
  • tasks
example build file build xml
Example build file: build.xml

<project name="FooEJBProject"

default="build" basedir=".">

<property name="jboss-rootdir" value="c:/jboss-3.0.0/" />

<property name="j2ee-jarfile"

value="${jboss-rootdir}/server/all/lib/jboss-j2ee.jar" />

<property name="fooejb-jarfilename" value="FooEJB.jar" />

<target name="all" depends="init, build, dist"/>

<target name="init">

<mkdir dir="${outputdir}" />

</target>

build xml continued
build.xml (continued)

<target name="clean">

<delete dir="${outputdir}" />

</target>

<target name="dist" depends="init, EJBJarFile"/>

build xml continued1
build.xml (continued)

<target name="EJBJarFile" depends="init, build">

<ejbjar srcdir="${classesdir}"

destdir="${outputdir}"

descriptordir="${basedir}"

basejarname="${fooejb-jarfilename}"

genericjarsuffix=""

classpath="${classesdir};${j2ee-jarfile}" >

<include name="**/ejb-jar.xml"/>

<support dir="${classesdir}">

<include name="*.class" />

</support>

</ejbjar>

</target>

build xml continued2
build.xml (continued)

<target name="build" depends="init">

<javac

srcdir="${javasrcdir}"

deprecation="on"

destdir="${classesdir}"

includeAntRuntime="no"

classpath="${j2ee-jarfile}"

debug="on"

/>

</target>

</project>

common tasks
Common tasks
  • <property>
  • <javac>
  • <jar>
  • <ejb-jar>
  • <javadoc>
  • <junit>
  • <touch>
  • <copy>
  • <delete>
  • <move>
  • <fileset>
  • <cvs>
  • <exec>
  • <mail>
creating your own ant task
Creating your own Ant task

public class MyTask extends

org.apache.tools.ant.Task

{

public void execute() { … }

public String getFoo() { … }

public String setFoo() { … }

}

monitoring a build
Monitoring a build
  • create a “build listener” class
  • implement Ant’s BuildListener interface
ant related tools
Ant related tools…
  • CruiseControl
  • Centipede
  • AntHill
  • Maven
cruisecontrol
CruiseControl
  • a “tool for setting up a continuous build process”
  • http://cruisecontrol.sourceforge.net/
  • a set of tasks to automate the checkout/build/test cycle
  • a servlet for viewing the status of the current build as well as the results of previous builds
centipede
Centipede
  • project build system
  • http://www.krysalis.org/centipede/
  • Defines format for:
    • code modules
    • project status information
    • project layout
  • Features:
    • Java source colorizer
    • UML doclet
anthill
AntHill

http:/www.urbancode.com/projects/anthill/default.jsp

  • ensures a controlled build process
  • performs a checkout from the source repository of the latest version of a project before every build and tags the repository with a unique build number after every build
  • automatically updates a project intranet site with artifacts from the latest build
maven
Maven
  • is a “project management and project comprehension tool”
  • http://jakarta.apache.org/turbine/maven/
  • well-defined Project Object Model
  • useful when you need to build multiple projects
summary
Summary
  • Ant is easy to use and powerful
  • download Ant at

http://jakarta.apache.org/ant/