Ben Walding

Overview

This section covers what different components are called in each of Maven and Ant

Project

In ant a project is what you define in your build.xml file. This project is a collection of targets, which are composed of tasks.

In Maven a project is what you define in your project.xml file. It's a collection of information about the development effort that Maven uses to produce an artifact such as a jar or war.

Target

A target is the unit of execution for a user of ant. When you execute ant, you provide a list of targets to run, e.g.

ant clean compile

Which executes the clean target followed by the compile targets you have coded in your build.xml file.

In Maven, the goal is the equivalent of an ant target, e.g.

maven clean java:compile

Executes the clean goal of the clean plugin, followed by the java:compile of the java plugin.

Maven goals can contain ant tasks as well as jelly tags.

Build file

When writing your own code in ant, you place the targets in the build.xml file.

When writing your own code in Maven, you place the goals in the maven.xml file. However, if you are using standard Maven goals, maven.xml is not compulsory.