Collection of Ant tasks for managing Open Liberty and WebSphere Liberty servers and applications.
Use Maven 3.x to build the Ant tasks.
mvn install
: builds the Ant tasks.mvn install -Poffline-its -DwlpInstallDir=<liberty_install_directory>
: builds the Ant tasks and runs the integration tests by providing an existing installation.mvn install -Ponline-its -DwlpVersion=<liberty_version> -DwlpLicense=<liberty_license_code>
: builds the Ant tasks and runs the integration tests by downloading a new server.- Liberty versions and their respective link to the license code can be found in the index.yml file. You can obtain the license code by reading the current license and looking for the D/N: line.
The Ant tasks are tested with Long-Term-Support (LTS) releases of Java. The Ant tasks, as of release 1.9.11, are supported on Java 8, 11 and 17. Prior to this version, the Ant tasks are supported on Java 8 and 11.
To use the Liberty Ant tasks in your build scripts you need to:
- Declare the
antlib
namespace in yourbuild.xml
file:
<project xmlns:wlp="antlib:io.openliberty.tools.ant">
</project>
- Make Liberty Ant tasks available in your build script by:
-
Copying
liberty-ant-tasks.jar
into$ANT_HOME/lib
directory, or -
Using the
typedef
task to load the Liberty tasks, for example:<typedef resource="io/openliberty/tools/ant/antlib.xml" uri="antlib:io.openliberty.tools.ant" classpath="target/liberty-ant-tasks.jar"/>
The latest build of
liberty-ant-tasks.jar
can be obtained from the Sonatype OSS Maven snapshot repository.
The liberty-ant-tasks.jar
provides the following tasks.
Task | Description |
---|---|
install-liberty | The install-liberty task is used to download and install a Liberty server. The task can download the Liberty runtime archive from a specified location (via runtimeUrl ) or automatically resolve it from the Liberty repository based on a version and a runtime type. |
server | The server task supports the operations: create , start , run , stop , status , package , dump and javadump . |
deploy | The deploy task supports deployment of one or more applications to the Liberty server. |
undeploy | The undeploy task supports undeployment of a single application from the Liberty server. |
install-feature | The install-feature task installs a feature packaged as a Subsystem Archive (ESA file) to the Liberty runtime. |
uninstall-feature | The uninstall-feature task uninstalls a feature from the Liberty runtime. |
clean | The clean task deletes every file in the ${wlp_output_dir}/logs , ${wlp_output_dir}/workarea , ${wlp_user_dir}/dropins or ${wlp_user_dir}/apps . |
compileJSPs | The compileJSPs task compiles JSP files so they do not need to be compiled on demand at runtime. |
springBootUtil | The SpringBootUtilTask task thins a spring boot fat jar, pulling out the runtime dependencies into a local library and producing a much smaller jar containing only the application logic. Use this capability to create efficient Docker layers for your Spring Boot application. |
=======