Use Ant to automate tasks for Liberty
Apache Ant is a Java library tool for automating the build process. We can use Ant tasks provided by Liberty to manage the server and applications.
Important: The wlp-anttasks.jar file was removed from Liberty in 19.0.0.3. See Removal notices.
An open source Ant plug-in, xmlns:wlp="antlib:net.wasdev.wlp.ant", is available in the GitHub repository. The Liberty Ant plug-in wlp-anttasks.jar files are located in Maven Central. To use these tasks in out build script, make sure the plug-in is available on the Ant class path. Copy the plug-in file wlp-anttasks.jar to the ANT_HOME/lib, and declare the antlib namespace in the build.xml file. For example:
- <project .... xmlns:wlp="antlib:net.wasdev.wlp.ant">
...
</project>
The namespace can be any string, provided we avoid name conflicts. After that, use the namespace as a prefix of the Ant tasks for Liberty. For example, we must 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 Liberty.