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.

Leave a Reply

Your email address will not be published. Required fields are marked *