Using Plugins

  1. Build targets
  2. Plugin properties
  3. Adding/installing new plugins

Build targets

In the plugin documentation, you can see which Ant targets every plugin adds to a release and a module. When a release is checked out, Antmod will automatically register the plugin's build targets to the release and module buildfile. So using a plugin is as simple as:

  • Checking out the release with Antmod
  • Change directory to the release or module, for example "cd /home/klaas/dev/myrelease-dev"
  • Use a documented plugin build target for the release or module, for example "ant junit"
  • If you want to check which build targets are available, execute: "ant -p"

NOTE: if an Ant target is missing, while you know that it has to be there, you may be working with an old checkout of a release which does not have the build plugin registered yet in the buildfiles. Solve this by changing directory to the release (for example "cd /home/klaas/dev/myrelease-dev") and running "ant update-ant".

Plugin properties

Every plugin has a set of documented properties that can be configured to customize the behavior of the plugin. For example, the JUnit plugin allows you to specify whether an HTML report is a frames or non-frames version using its ${antmod.junit.report.format} property.

Configuring a plugin is as simple as setting one of the documented plugin properties to the desired value. There are various ways to configure this:

  • Configure per release: Add the plugin property value to the <properties> section of the release descriptor. This is what is usually the best way to configure a plugin, as it allows for customized plugin behavior per specific project. For example:
  • <properties>
      antmod.junit.report.format=noframes
    </properties>
    
  • Configure per repository: You can configure a plugin for all developers using a repository, by setting the property in an "antmod-conf" module in the repository. Read the configuration reference for more information. For example:
    • In the "trunk" of the module "antmod-conf", create a properties file, let's say "pluginconfig.properties"
    • In the file "pluginconfig.properties" add the configuration such as:
    •  # disable frames in JUnit HTML reports
       antmod.junit.report.format=noframes
      
    • Make sure to add/commit your changes to "pluginconfig.properties" to the repository
    • NOTE: this config is picked up by Antmod once an hour from the repository, so it can take a little while before other developers get your configuration change

  • Configure per user: Simple add the plugin property value to your "${HOME}/.antmodrc" file.

Adding/installing new plugins

If you have downloaded/obtained an Antmod plugin, you can add it to your Antmod installation by following these steps:

  1. Store plugin archive, for example "newplugin.jar", on your harddisk
  2. Unpack "newplugin.jar" in your "${ANTMOD_HOME}/plugins" directory, for example: "jar -xf /home/klaas/newplugin.jar"
  3. You should now have a "${ANTMOD_HOME}/plugins/newplugin" directory
  4. Antmod will automatically pick up the new plugin from your "${ANTMOD_HOME}/plugins" directory