Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Advice on a good Java build tool, well integrated with eclipse

I am working in a small team (3 persons) on several modules (about 10 currently). The compilation, integration and management of build versions is becoming more and more tedious. I am looking for a good build / integration tool to replace / complete Ant.

Here is the description of our current development environment : - Several modules depending on each over and on third party JARs - Some may export JARS, some export WARS, some export standalone, runnable JARS (with Fat-Jar) - Javadoc for all of them - We work with eclipse - Custom Ant script for each module. Many redundant information between the eclipse configuration and Ant scripts. For example, for the standalone Fat-JAR, we have listed all the recursive dependencies, whereas ideally, it could clearly be imported from the eclipse configuration. - The source code is versioned using SVN

Here is what I would like a perfect integration tool to do for me :

  • Automatize the releases and versioning of modules. Ideally, the integration tool should detect if a new version is needed. For example, if I want to release a project A that depends on a project B, and if I have made small changes on the project B locally, then the integration tool should first release a new version of B as well and make A based on it.

  • Integrate strongly with eclipse, so that it could get the dependencies between modules and third party libs from its configuration. BTW, I would like to continue to configure build path with eclipse without updating some other ".xml" stuff. I saw that Gradle can generate eclipse project files from its configuration, but the counterpart would be great.

  • Enable a "live" and transparent development on local projects. I mean that I often make small changes on the core / common projects while developing the main / "leaf" projects. I would like to have my changes on core projects immediately available to leaf projects without the need of publishing (even locally) the JARs of my core projects.

  • Store all versions of the releases of my module on an external server. The simplest (shares folder / Webdav) would be the best. A nice web page with list of modules and delivered artifacts would be great too.

I have looked around for many things. From Ant4eclipse (to integrate the Eclipse configuration into my Ant script), to the Maven / Ivy / Gradle tools.

I am a bit confused. Here is what I have understood so far: - Maven is a great / big tool, but is somewhat rigid and obliges you to bend to its structure and concepts. It is based on description rather than on scripting. If you go out of the path, you have to develop you own plugins. - Ivy is less powerful than maven, it handles less stuff but is more flexible. - Gradle is in-between. It is general purpose. It enables scripting as well as "convention based" configuration. It integrates Ant and extends it.

So at this point I am looking for actual testimonials from real users. What tools do you use ? How ? Do you have the same needs as me ? Does it ease your life or get into the way ?

Are there sample some use cases, or workspace skeletons out there that I could use as a starting point to see what these tools are capable of ?

Sorry for the length of this message. And thanks in advance for you advice.

Kind regards,

Raphael

like image 600
Raphael Jolivet Avatar asked Jul 06 '10 13:07

Raphael Jolivet


2 Answers

Automatize the releases and versioning of modules (...)

The concepts of versioning and repository are built-in with Maven and they could fit here.

Maven supports SNAPSHOT dependencies. When using a snapshot, Maven will periodically try to download the latest available snapshot from a repository when you run a build. SNAPSHOT are typically used when a project is under active development.

Maven 2 also supports version ranges (I do not really recommend them but that's another story) which allow for example to configure A to depend on version [4.0,) of B (any version greater than or equal to 4.0). If you build and release a new version of B, A would use it.

Integrate strongly with eclipse

The m2eclipse plugin provides bi-directional synchronization with Eclipse.

Enable a "live" and transparent development on local projects.

The m2eclipse plugin supports "workspace resolution": if project A depend on project B and if project B is in the workspace, you can configure A to depend on B sources and not on B.jar (that's the default mode if I'm not wrong). So a change on B sources would be directly visible, without the need to build B.jar.

Store all versions of the releases of my module on an external server.

As mentioned earlier, this is actually a central concept of Maven (you don't even have the choice) and deploying through file:// or dav:// are both supported.


To sum up, Maven is (probably) not the only candidate but I'm sure it would fit:

  • Your project isn't that exotic or complex, there is nothing scaring from your description (some refactoring of the structure will probably be required but this shouldn't be a big deal).
  • Maven also brings a workflow based on best practices.
  • m2eclipse provides strong integration with the IDE.

But Maven has some learning curve.

like image 108
Pascal Thivent Avatar answered Sep 18 '22 00:09

Pascal Thivent


CI tools? To me, there's only one: the Hudson CI.


I've setup a software development environment for Java once, with the components:

  • eclipse IDE
  • mercurial
  • bugzilla
  • maven
  • Nexus
  • Hudson CI

and some apache, mysql, php, perl, python, .. for integration.

The hudson was not integrated with eclipse and that was on purpose, because I wanted to build on a separate server. for all the other tools I had a perfect cross integration (like: mylyn on eclipse to talk with bugzilla, m2eclipse for using maven eclipse, a lot of plugins for hudson, ...)

like image 40
Andreas Dolk Avatar answered Sep 20 '22 00:09

Andreas Dolk