Using Ant to automate tasks for Liberty

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

Before you begin

Important: The wlp-anttasks.jar file was removed from Liberty in 19.0.0.3. For more information, see Removal notices. An open source Ant plug-in with more tasks for Liberty is available. The more recent Ant plug-in has a different antlib namespace, xmlns:wlp="antlib:net.wasdev.wlp.ant. For more information about the open source Ant plug-in for Liberty, see the GitHub repository.
The Liberty Ant plug-in wlp-anttasks.jar files are located in Maven Central. If you want to use these tasks in your build script, you must make sure the plug-in is available on the Ant class path. 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. See the following example:
<project .... xmlns:wlp="antlib:net.wasdev.wlp.ant">
  ...
 </project>

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

About this task

You can create build scripts that use these Ant tasks to package, install, and test your application on Liberty.