Is Maven a tool I want to use if I'm building a non-web app?
Asked Answered
H

3

5

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?

Heyer answered 24/5, 2010 at 17:14 Comment(0)
B
4

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).

Byword answered 24/5, 2010 at 17:19 Comment(1)
I'd like to add that the Dependency Management means that any libraries required by your declared libraries are loaded automagically.Asclepius
H
3

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.

Hearthstone answered 24/5, 2010 at 17:20 Comment(0)
M
0

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.

Mckinnie answered 24/5, 2010 at 17:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.