+

Search Tips   |   Advanced Search

Use Ant to automate tasks for the Liberty profile

Apache Ant is a Java library tool for automating the build process. We can use Ant tasks provided by the Liberty profile to manage the server and applications.

The Ant plug-in for the Liberty profile is located in the dev/tools/ant directory of the server image. This plug-in contains a set of Ant tasks. To use these tasks in the build script, we must make sure the plug-in is available on the Ant classpath. One way of doing this is to copy the plug-in file wlp-anttasks.jar to the /lib directory of the Ant installation, and declare the antlib namespace in the build.xml file. For example:

  <project .... xmlns:wlp="antlib:com.ibm.websphere.wlp.ant">
    ...
  </project>

The namespace can be any string, provided you avoid name conflicts. After that, use the namespace as a prefix of the Ant tasks for the Liberty profile. For example, use wlp:server when calling the server task.

We can create build scripts that use these Ant tasks to package, install, and test the application on the Liberty profile.


Subtopics


Parent topic: Administer the Liberty profile from the command prompt

Reference:
The Apache Ant project

  • server command options