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

前端 未结 2 1563
走了就别回头了
走了就别回头了 2021-02-06 08:22

I\'m using Intellij Idea 12 and have a multi module maven project.

To make it simple let\'s assume that I have:

  • Module A - compiled to JAR
  • Module
相关标签:
2条回答
  • 2021-02-06 08:53

    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 Maven Clean for 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) Build Jars 1.3 Compile all Projects with WAR artifacts - No packaging with MavenCompile WARs

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

    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

    0 讨论(0)
  • 2021-02-06 09:05

    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.

    0 讨论(0)
提交回复
热议问题