Maven overlay integration - how transparent is it supposed to work?

Answered

Hello,

As we are starting to play around with Maven overlays (to reuse static web resources in two different web applications - up to now we use SVN externals to solve that problem) we are experiencing the situation that it requires manual Maven build steps ("mvn install" in the module that is included in the web app and "mvn package" in the web app) to get changes updated in a running web application (after pressing F10).

Is the Maven overlay supposed to work in IntelliJ in a transparent way so when I am changing a resource in the source module (managed by IDEA), saving it and then pressing F10 to update resources I can immediately see the new content being served via Tomcat to the browser when repeating the request via the web app?

If it is supposed to support such a rapid application life cycle, the next question will be: what are we doing wrong? (But I suppose this will require detailed information about our project structure...)

Thanks in advance for the basic answer about how it's meant to work - and keep up the good work on IntelliJ!

Kind regards, Stefan

0
2 comments

Generally it should work. Though there was a related issue reported some time ago: https://youtrack.jetbrains.com/issue/IDEA-157747 so there could be nuances.

Could you please verify that Maven coordinates (groupId, artifactId and version) of these web Maven projects are the same in dependencies section and modules declarations? Also the artifact you build in IDE and select for deployment should be of an exploded type.

0
Avatar
Permanently deleted user

Thanks for the quick response, Andrey.

I turned out that we configured the Maven projects that we wanted to include via overlay as jar, not war modules (so making war is required sometimes ;)).

When we changed the structure and configuration to war, IntelliJ out of the box applied the changes directly to the target structure of the web app (when updating resources).

Regards,

  Stefan

0

Please sign in to leave a comment.