Ant Client

We have an integration with Apache Ant which is “a Java-based build tool”. It is now possible to send messages to Apache ESME that describe the progress of your build steps. This is especially useful when Apache ESME is being in development projects where individual developers can be made aware of the status of various-build related actions. For example, a development team could be informed that a build is broken or if it is successful.


  1. Install Apache Ant
  2. Install Apache Maven
  3. Download the Apache Commons packages "Codec" and [Logger|] . We also need [Apache "Httpclient|] . Please note that we are currently using the legacy 3.1 version of the HTTP Client. 
  4. Check-out the ESME java client: _
  5. Perform a maven build in this directory with the following command "mvn compile package -Dmaven.test.skip=true" . This will create a jar file "esme-rest-api-0.1.jar" in the target directory. 
  6. Create _lib _directory and copy "rest-api-0.1-SNAPSHOT.jar", "commons-codec-1.2.jar", "commons-httpclient-3.1.jar" into this directory. 
  7. Create src directory and copy the "" file to this directory
  8. Change the build.xml file to point to the appropriate directories
  9. Change the token in the "esme" target in the build.xml file to a correct token.
  10. Change the proxy in the "esme" target in the build.xml file to a correct proxy.
  11. call ant dist esme to test the application



<path id="project.class.path">


<!-- Put everything in ${build} into the jar file -->
<jar jarfile="${dist}/lib/EsmeViaAnt.jar" basedir="${build}"/>

h4. EsmeAntTask java class

import org.apache.esme.api.EsmeRestApi; import org.apache.esme.model.Message;

public class EsmeAntTask {

public static void main (String args) {

String apiUrl; String authToken; String localProxy; String message; EsmeRestApi esme;

apiUrl = args0 ; authToken = args1 ; localProxy = args2 ; message = args3 ;

try {

 esme = new EsmeRestApi(apiUrl);

 if ((localProxy != null) && !("".equals(localProxy)))
    // Split proxyHost:port into two parts

proxy = localProxy.split(":"); esme.setProxy(proxy0 , Integer.parseInt(proxy[1])); }


 Message esmeMsg = new Message();



tags = new String[1]; tags0 = "Ant Task";




} catch (Exception e) {} } }