Skip to content
Alexis Resendiz Andrade edited this page Mar 10, 2015 · 4 revisions

HOME | SETUP GUIDE

This guide show you how to embed the ant tasks to manage Liberty server instances in your ant project.

Setting up the tasks involves two steps:

  1. Build the tasks
  2. Configure your build

Step 1: Build the tasks

Preconditions: You should have Apache Maven 2.x or 3.x installed in your system and referenced as an environment variable. An Internet connectivity is also required to download dependencies.

Download as ZIP file or fork this project from https://github.com/WASdev/ci.ant (If you decide download as ZIP file then you should uncompress it).

Open a console in your current directory pointing inside the tasks' project and use the following Maven command:

  • mvn install : This will test, compile, package and install the plugin in your current Maven repository.
  • mvn install -DwlpInstallDir=<wlp-install-directory> : This will do the same as the previous command and also will run the integration tests.

After running the command in the console you can use the provided jar in your builds.

Step 2: Configure your build

Preconditions: You should have wlp-anttasks-1.1-SNAPSHOT.jar from the previous step.

To use the Liberty Ant tasks in your build scripts you need to embed the jar that contains the compiled tasks following the next procedure:

  1. Define the antlib namespace in your build.xml file:

     <project xmlns:wlp="antlib:net.wasdev.wlp.ant">
             ...
     </project>
    
  2. Make Liberty Ant tasks available in your build script by copying wlp-anttasks-1.1-SNAPSHOT.jar (the generated jar from step 1) to ${ant.home}/lib or using the typedef task

     <typedef resource="net/wasdev/wlp/ant/antlib.xml" 
             uri="antlib:net.wasdev.wlp.ant" 
             classpath="target/wlp-anttasks.jar"/>
    

Setup is completed!

Once embedded the Liberty tasks in your build script, you are ready to create or manage liberty instances! Take a look around in the Tasks Descriptions section to see how to use each task.