Maven Ant Plug-in Jason van Zyl Arnaud Heritier

This plugin generates a vanilla ant build.xml file that so that user's that haven't installed Maven can still build. Though it is always highly recommended that you install Maven :-)

For more information on the functionality provided by this plugin, please see the Goals document.

For more information on how to customise the functionality provided by this plugin, please see the properties document.

When you generate the build file with maven, if the property "maven.ant.use.properties" is setted to true (default behaviour), the build file will load successively the properties stored in files "build.properties" located in :

  1. the project's root directory,
  2. the user's home directory.

If this property is setted to false the generated build file doesn't load this properties, so it will help you to avoid conflicts.

The following properties are defined in the build files and thus can be overridden in the files described previously :

  • defaulttargetdir : the directory where the generated files are stored (default = ${project.home}/target).
  • libdir : the directory where are downloaded dependencies (default = ${project.home}/target/lib).
  • classesdir : the directory where compiled classes are stored (default = ${project.home}/target/classes).
  • testclassesdir (only if there are unit tests classes in your project) : the directory where compiled classes for unit tests are stored (default = ${project.home}/target/test-classes).
  • testreportdir (only if there are unit tests classes in your project) : the directory where tests reports are stored (default = ${project.home}/target/test-reports).
  • distdir : the directory where the distribution is created (default = ${project.home}/dist).
  • javadocdir : the directory where is stored the javadoc (default = ${project.home}/dist/docs/api).
  • final.name : the name used for the generated jar (default = ${maven.final.name}.
  • ${dep.artifactId}.jar : a property is created for each project's dependency (for example : activation.jar). This property can be used to override the default url used to download the dependency (for example : activation.jar=http://myhost/repository/sun/jars/activation-1.0.2.jar).

The main targets defined in the generated ant's buildfile are :

  • clean : to delete generated directories (${defaulttargetdir} and ${distdir}).
  • compile : to compile the code.
  • test : to run the test cases.
  • jar : to create the jar.
  • javadoc : to generate the project's javadoc.
  • dist : to create the distribution. It contains the jar, the javadoc, licenses(LICENCE.*) and readme (README.*).