1
votes

I have a modular maven project. On the top level I've got:

    <modules>
    <module>base</module>
    <module>module1</module>
    <module>module2</module>
    <module>ear</module>
    </modules>

The base module gets packed as a jar. module1 and module2 as war with a dependency on the base module. The Ear project has dependencies upon module1 and module2 and packages them accordingly. The pom's of module1 and module2 are exactly the same!!

Everything works perfect, except the deployment to the local server from eclipse. The problem is that module2 is missing base.jar in the lib folder of the deployed ear. Yet, module1 has it! If I run a mvn install from the command line it's also included in the target lib folder! In eclipse, all dependencies are resolved!

I've tried everything I can think of:

  • reimporting the projects,
  • cleaning all eclipse related files,
  • cleaning the local maven repository,
  • cleaning the servers tmp folder and re-add the projects,
  • do a maven update and install

Nothing helped so far.

Cheers

Edit:

I have made a somehow horrifying discovery: I've added a module named "amodule". Guess what, it got the required jar and the others didn't. It seems like only the alphabetical first module gets the jar and the others don't.

1

1 Answers

0
votes

My solution was to uncheck "resolve workspace dependencies" in the projects that include the base module. (project -> preferences -> maven -> uncheck: resolve workspace dependencies)

It comes with a side effect though: During debugging, the base.jar is handled like an external jar in the module. It is possible to specify the source code path, but I can't set a break point in the base project and wait until the debugger hits that line.