user697111
user697111

Reputation: 2262

Java Build; with these requirements, what would be a good choice?

This is in regards to building a Java Project.

So I'm a bit confused on my options here.

My requirements (it's a small project):

So far I think Ant and Maven are the main two build systems in use. It's very unclear to me though which one I should use or how they differ?

The other option would be 'make' under linux (or maybe cygwin). I've only used it once, but seemed pretty quick to get going/working. Is that a good option for Java or this project? Any downsides to make? Why don't more java developer's use it?

Other options?

Upvotes: 0

Views: 212

Answers (2)

ktorn
ktorn

Reputation: 88

In a nutshell: spend your 12 hours learning and using Ant.

Maven has a good feel out-of-the box, super-easy to get going and with the neat dependency management, but down the line tweaking the pom.xml (your project's maven build file) to fit your needs will require more fiddling with than if you used Ant.

To address some of your specific requirements:

  • you can use <compilerarg> elements with the <javac> task
  • for native libs you can add them with: <sysproperty> and key="java.library.path"
  • use Rhino with Ant (http://stackoverflow.com/questions/3526960/using-recent-rhino-in-ant-script)
  • there is a Proguard task for Ant (http://proguard.sourceforge.net/index.html#/manual/ant.html)
  • for javadoc Ant comes with the <javadoc> task out of the box
  • the <jar> Ant task is extremely easy to use to package everything up
  • there is a <jw:jnlpwar> task available from the [Ant Web Start Task project] at (http://ant-jnlp-war.sourceforge.net)
  • Ant is ubiquitous, it works for just about every major platform out there (Linux, Unix, Windows, MacOS)
  • with plenty of docs and examples available on the web, you'll pick-up Ant in no time, and those hours you'll spend learning it will probably "pay" themselves back within a couple of weeks of using it for your builds.
  • Eclipse integrates with Ant out of the box (http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.platform.doc.user/gettingStarted/qs-81_basics.htm)

It may not do fancy dependency management out-of-the-box like Maven (although for that you can integrate Ant with Ivy) but it certainly provides you with all the flexibility you'll ever need, and you won't find yourself "fighting" the build tool configuration file as it's fairly common with Maven.

I should probably just mention the 2 new names in Java build (and CI) tools: Hudson and Jenkins. They're fairly recent and may be interesting to look at, but I would definitely not recommend them to you and your project at this early stage.

Note: apologies for the lack of real links (only allowed 2 links atm)

Upvotes: 3

Prashant Bhate
Prashant Bhate

Reputation: 11087

Maven is the best choice here as it has integration for all of these

so go for it.

Here, quick links for you to save an extra hour to spend on learning maven ;)

Upvotes: 0

Related Questions