Java Software Development

Web Swing Others

Let's talk!


Ant and Maven command wrappers

Posted at June 1st, 2013
Posted by yves
Tags: Tags: , , ,
Categories: Build tools

Build tools wrappers allow leveraging a build tool installation on the fly. The developers can share a project without expectations of an existing application of a particular build tool.

This is a very convenient feature on build servers, especially when different software projects may require a specific version of a build tool.

Below is a short introduction to two build tool wrappers : maven-wrapper and ant-wrapper.

At the end of this blog post, there’s a link to a youtube screencast that provides more details about how those wrappers work.

The usual build tool installation problem

Developer: This is a Java project, please build it an package it, the build tool used is Maven.
Project Builder: Hum… Java I know it, but what is Maven
Developer: Like I said, it’s a build tool, please google it and install the latest version

“Couple of hours later”

Project Builder: I tried to setup Maven but it doesn’t work, I don’t understand…
Developer: Did you set up the PATH environment variable for Maven?
Project Builder: Hum.. How can I do that?? This is very complicated…
Developer: ??? Let me come to your desk…

Why build wrappers are cool

Today was a good day in terms of coding.

It started with a fork of the existing Github maven-wrapper project and it ended with another tool called Ant wrapper.

Setting up build machines is often an issue:

  • Different versions of the same tool need to be used for many projects
  • The build tool installation is not straightforward
  • A user error can result into a non-working installation (file permissions, etc.)

Build wrappers simplify build tools installation and maintenance.

Those wrappers can also be useful in the cloud, yes that cloud, where you cannot control all the build infrastructure as you please.

Apache Maven wrapper

The original Maven wrapper code is a port of the Gradle wrapper.

However, if was not possible to just reuse the utility accross Maven projects.

The project was then forked to add Maven plugin support.

The developers just need to reference the plugin in their POM file and then generate the wrapper scripts.

The Github project page can be found here.

Apache Ant wrapper

The Apache Ant wrapper is similar in essence to the Maven wrapper (quick code rip). The Ant wrapper is provided via a custom Ant task.

I looked again at another project with the same goals called antw. antw seems to work just like gvmtool, which is bash script based.

You generate an Apache Ant wrapper for your project and then you just share it without worrying about installation procedures.

Windows support is planned in couple of days, if all goes well.

The Github project page can be found here.

Below is the youtube video that provides more details about the above-mentioned two projects

If you like what you see, please subscribe to our channel and comment!

Share this post
Facebook Twitter Digg Plusone Reddit Stumbleupon

Leave a Reply

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

Time limit is exhausted. Please reload the CAPTCHA.

Comments RSS

© 2012-2018, Rimero Solutions Inc.

Slideshare presentations

Grails and build tools

Recent Blog posts

Apache Ant Git tasks project

Latest tweets

Added maven plugin support to maven-wrapper.

Brand-new screen-casts

Introduction to ant-wrapper and maven-wrapper

Github activity

Apache Ant Git tasks