Intellij multi-module maven project, update in one of the submodules is not propagated to war

心不动则不痛 提交于 2019-12-03 03:23:57

Eventually I found a hybrid solution for this: Things to be done before Tomcat is run:

  1. Clean all
  2. Build, package and register (in repository) all projects that should become JAR
  3. Compile only (Don't build) WAR projects
  4. Build WAR artifacts with Intellij (This is needed for hot swap availability)

This is how I start Tomcat.

Detailed information:

  1. Create 3 Maven run configurations

    1.1 Clean all projects

    1.2 Build all projects with JAR artifacts. You need to manually include all your projects with the '-pl' maven option. Optionally you can run "Maven clean" before launch of this configuration (look at screenshot)

    1.3 Compile all Projects with WAR artifacts - No packaging with Maven

  2. Create Tomcat configuration to Build War artifacts and include other configurations to run before Launch

Now when Tomcat is run it is possible to hotswap code changes (if JVM allows) or simply restart server to include all your new code/changes. The draw back of this is somewhat longer start time of Tomcat. That's something we are willing to live with..... For now

I think hot code deployment works only with exploded artifacts. In IDEA 11 I rename the exploded directory, because the maven artefacts is at the same location and the name is same.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!