Monday, December 9, 2013

Pushing artifacts to your local repo using Maven's Ant plugin

If you have an Ant module that you need to integrate into an existing Maven project, you'll likely face a few challenges.  Let's just pretend you don't want to mess with Ant too much.

Despite the existence of the maven-antrun-plugin, they don't mesh perfectly together.  One issue is getting the built artifact into your local Maven repository.

Here's one technique: once the Ant build is complete, reach into the target directory and copy the artifact into your repo while taking care to roll the path and version.
You might want to adjust this according to your environment.  Perhaps adding more phases and breaking up the operations would be wise.