Automation of IIB Maven and Ant

I have been working on a project with IIB (IBM Integration Bus). If you are like me, you want to automate all those pesky build tasks. In IIB, I needed to package and build my project (BAR).

I investigated scripting the build using the mqsipackagebar command . I noticed at the bottom a description of using it with ANT.

I’ve used ANT in a few projects (in combination with Maven). I took the script as a starting point, added the jar files and property files (based on configuring environments without IIB). I configured the maven-antrun-plugin in order to integrate within my parent project’s maven build.

Here is some sample code for you, I hope it helps you all get started:

My Experience with maven-antrun-plugin

I’ve been spending some time with maven so that files which matched a certain criteria were automatically moved in the project – OpenNTF SocialSDK.  The files only should be moved when the files don’t have -SNAPSHOT at the end of the version.

I started modifying some code that used maven-antrun-plugin, which bridges the maven-ant worlds.  I tried mixing complex conditional depends on and unless statements from Ant targets and Ant Tasks. Where the target “depends” on another target, you should be able to conditionally execute a target.  I wrote the code, however it never ran cleanly, always throwing an error.

I split the ant tasks and targets into a separate file, and the code now runs cleanly.  From the best practices I’ve read it’s better to pick one, and only use one Maven file or Ant file, I however couldn’t get it to read depends on targets.

I hope you find this ant-maven hack as helpful as I did.

 

The solution is found in the commit – added support for automatically moving the cdnjs files when a release.