views:

96

answers:

3

Guys,

I've got to build a GUI to be run on Desktops in Java. I'm decently new to Java, and I"m trying to understand what Maven is best suited for. Is this the type of application that would be well suited for Maven? Could someone just give me a 100 word explanation of what Maven basically is?

Thanks,

Joe

+3  A: 

You most certainly want to use Maven for desktop apps. It's well suited for building all kind of Java application and I personally use it for 2 quite large Swing applications. In short Maven gives you the following:

  • predefined project directory structure(very, very helpful)

  • project lifecycle(clean, compile, package, install, test)

  • dependency management(you only declare the libraries you use in the project and maven fetches them for you)

  • a lot of plugins that can basically do just about everything - run a static analysis tool on your code or update your database schema

Maven is basically driven by "convention over configuration" - sane defaults for everything to save you the time to figure out (probably) worse settings then the maven authors have chosen. I heartily recommend you to have a look at the first chapter of the Maven book(it's just a short overview to get you hooked).

Bozhidar Batsov
I'd like to add that the Dependency Management means that any libraries required by your declared libraries are loaded automagically.
Fred Haslam
+2  A: 

In short, yes, Maven could be appropriate.

Maven is a build tool that prefers convention over configuration (so it'll figure out where your code and tests are, so long as you put them in a standard place). It also does dependency management - no more checking jars into a lib directory. Tell maven what your dependencies are, and it will find them and use them in the compilation.

Maven isn't specific to web apps. It can package in a number of different ways (jar, war, ear, etc). If you choose a packaging that's not specific to web (i.e. jar), then you'll be able to build your app just fine.

nojo
A: 

I use Maven with a complex webapp - Geoserver and a Desktop app - NEST. Both benefit from the build management infrastructure Maven provides. If you have used source based linux distributions e.g. Gentoo then Maven is the equivalent of Portage. It takes a while to do initial builds and set up repositories with dependencies, but once everything is in place the build process becomes highly automated.

whatnick