Run Maven in Ant

The maven-antrun-plugin allows us to run Ant tasks in Maven. On the contrary, there is no Ant task for running Maven in Ant.

Luckily, Maven is command line based and so we can make use to the <exec> Ant task to run Maven command. =P

<target name="build" basedir="/${maven.project.directory}" >
	<exec>mvn install</exec>
</target>

Done =)

Reference: Nabble – How do I run maven build from ant

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.