maven + modules + webapp + reload

Hey,

When you import a maven project with multiple modules, and one is a webapp, it will auto create a webapp artifact .
In this artifact the depend modules are included packaged as jars.This is really cool and correct(tm).

But the fact that those modules are included as a jar make it a lot harder to reload classes & resources during debugging.

For example when re-compiling in debug mode and things are packed in the jars it will start throwing class not found exceptions
really soon, and also resources seem troublesome (at least with the framework i'm using. (wicket)).
Everything works fine if i manually go and delete the jars, and add the 'compile output' from the differed modules in the 'classes'

Because this artifact is re-created everytime you change/reimport the pom i end up manually having to change this a great number of times.
(pom changes from switching branches etc)

So my question is, does anyone know a nice(r) way to deal with this so that i wouldn't have to keep manually changing this artifact?
Without losing the automatic syncing of dependencies and modules with maven (which is the greatest thing ever)

Thank you

2 comments
Comment actions Permalink

Hi,

When you import a maven project with multiple modules, and one is a webapp, it will auto create a webapp artifact .
In this artifact the depend modules are included packaged as jars.This is really cool and correct(tm).

But the fact that those modules are included as a jar make it a lot harder to reload classes & resources during debugging.

For example when re-compiling in debug mode and things are packed in the jars it will start throwing class not found exceptions
really soon, and also resources seem troublesome (at least with the framework i'm using. (wicket)).
Everything works fine if i manually go and delete the jars, and add the 'compile output' from the differed modules in the 'classes'

maven support in idea works differently, it doesn't put jars in the output artifacts. It will add jars only if your dependencies is not under the project, either if your artifact depends on jar artifatcs within idea.

Because this artifact is re-created everytime you change/reimport the pom i end up manually having to change this a great number of times.
(pom changes from switching branches etc)

Idea of maven support is to keep all the information in the pom files, so you shouldn't normallly adjust artifacts in the idea project. The reason above(jars) doesn't look valid for me. If you still need to maintain hand edited artifact, try to put that artidact.xml definition under version control and revert it if broken by resync.

3.jpg2.jpg
regards, Alex

0
Comment actions Permalink

ashitkin.alex wrote:

Hi,

When you import a maven project with multiple modules, and one is a webapp, it will auto create a webapp artifact .
In this artifact the depend modules are included packaged as jars.This is really cool and correct(tm).

But the fact that those modules are included as a jar make it a lot harder to reload classes & resources during debugging.

For example when re-compiling in debug mode and things are packed in the jars it will start throwing class not found exceptions
really soon, and also resources seem troublesome (at least with the framework i'm using. (wicket)).
Everything works fine if i manually go and delete the jars, and add the 'compile output' from the differed modules in the 'classes'

maven support in idea works differently, it doesn't put jars in the output artifacts. It will add jars only if your dependencies is not under the project, either if your artifact depends on jar artifatcs within idea.


My idea does work like this version 10.5.1 (and maven 3).

Attached is a sample multimodule project that opens with both modules as jars in the war.
2011-08-01-143438_1680x1050_scrot.png



Attachment(s):
test.zip
0

Please sign in to leave a comment.