Apache Maven 1.x has reached its end of life, and is no longer supported. For more information, see the announcement. Users are encouraged to migrate to the current version of Apache Maven.

Information about the generated Ant build file

Properties

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 :

Property name Description Default value
defaulttargetdir The directory where the generated files are stored ${basedir}/target
libdir The directory where are downloaded dependencies (default maven local repository). If you prefer you can use something like ${basedir}/target/lib. ${user.home}/.maven/repository
classesdir The directory where compiled classes are stored ${basedir}/target/classes
testclassesdir The directory where compiled classes for unit tests are stored (only if there are unit tests classes in your project) ${basedir}/target/test-classes
testreportdir The directory where tests reports are stored (only if there are unit tests classes in your project) ${basedir}/target/test-reports
distdir The directory where the distribution is created ${basedir}/dist
javadocdir The directory where is stored the javadoc ${basedir}/dist/docs/api
final.name The name used for the generated jar ${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).
proxy.host The proxy host used to download dependencies.
proxy.port The proxy port.
proxy.username The username used to connect on proxy. (only if the ant file was generated with a 1.6 compatibility)
proxy.password The password used to connect on proxy. (only if the ant file was generated with a 1.6 compatibility)

Targets

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.*).