views:

24

answers:

2

We currently have an ant based project and are contemplating moving to maven. The project is java ee based, however it has a module structure where each module can contain multiple java ee projects. like this:

mod1-->subdir-->war-A
             -->war-B
mod1->src
mod1->build/classes

multiple such modules plus some jars dependencies are added and one EAR file is created. + custom manifest file

like so

EAR -->war-A
    -->war-B
    -->war-C
    -->war-D
    lib/allclasses-from-allmodules-in-one jar

This structure and dependencies cannot be changed- it comes from a framework that we use.

I don't know enough about maven to figure out how much work this is- or if our project struture and development practices are so far removed from the maven convention that its not worth the time.

I realize you can bend maven to do whatever you want it to -but if we make a switch it should be for the benefits of maven not to make life harder! :)

The other important thing is that I want to be able to create the ear file exploded...what options do I have to customize that aspect ? What will I be giving up if I go with a customized "task" (I'm not sure what the maven term for this is)

+2  A: 

To be perfectly honest, I wouldn't bother with porting this over to maven - and I say this despite being a total maven fanboy. Converting full projects that have any kind of complexity at build time to maven normally isn't worth the trouble you'll undergo.

For new projects or perhaps a rewrite of this app (if it were to ever happen), I would fully suggest starting with maven instead.

I realize you can bend maven to do whatever you want it to -but if we make a switch it should be for the benefits of maven not to make life harder! :)

You can "bend maven" to do whatever you want, but typically you are shooting yourself in the foot when you do so. The point of maven is that it's a build by convention, not by configuration. The more you venture outside of doing things that fall outside of the scope of the maven lifecycle, the more trouble you are asking for in terms of the maintenance and reliability of your build.

whaley
+1  A: 

I'm not 100% sure I understood your current project structure but if you can't change anything, it looks like there are major show stopper issues. With Maven:

  1. parent modules of nested modules don't contain code
  2. one module produces only one main artifact (not sure it's the case of your project though)

Not following the Maven default layout being a minor problem compared to the above one.

Without more details about what can be changed (without breaking the structure), I simply don't think it's doable in an elegant way (if even doable).

Pascal Thivent