Apache Tomcat Maven Plugin
  1. Apache Tomcat Maven Plugin
  2. MTOMCAT-100

support war overlay to add war external dependencies in tomcat run

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-beta-1
    • Component/s: tomcat6, tomcat7
    • Labels:
      None

      Description

      /WEB-INF/lib/.jar and /WEB-INF/classes will added to web app classloader when using tomcat:run to do as war overlays does.

        Activity

        Hide
        Hudson added a comment -

        Integrated in TomcatMavenPlugin #25 (See https://builds.apache.org/job/TomcatMavenPlugin/25/)
        MTOMCAT-100 support war overlay to add war external dependencies in tomcat run: tomcat6 support too.
        MTOMCAT-100 support war overlay to add war external dependencies in tomcat run.

        olamy : http://svn.apache.org/viewvc/?view=rev&rev=1182064
        Files :

        • /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RunMojo.java
        • /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/RunMojo.java

        olamy : http://svn.apache.org/viewvc/?view=rev&rev=1182063
        Files :

        • /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/pom.xml
        • /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculator.java
        • /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculatorRequest.java
        • /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
        • /tomcat/maven-plugin/trunk/pom.xml
        • /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractRunMojo.java
        • /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RunMojo.java
        • /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java
        • /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/RunMojo.java
        Show
        Hudson added a comment - Integrated in TomcatMavenPlugin #25 (See https://builds.apache.org/job/TomcatMavenPlugin/25/ ) MTOMCAT-100 support war overlay to add war external dependencies in tomcat run: tomcat6 support too. MTOMCAT-100 support war overlay to add war external dependencies in tomcat run. olamy : http://svn.apache.org/viewvc/?view=rev&rev=1182064 Files : /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RunMojo.java /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/RunMojo.java olamy : http://svn.apache.org/viewvc/?view=rev&rev=1182063 Files : /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/pom.xml /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculator.java /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculatorRequest.java /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java /tomcat/maven-plugin/trunk/pom.xml /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractRunMojo.java /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RunMojo.java /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/RunMojo.java
        Hide
        Hudson added a comment -

        Integrated in TomcatMavenPlugin-mvn2.x #8 (See https://builds.apache.org/job/TomcatMavenPlugin-mvn2.x/8/)
        MTOMCAT-100 support war overlay to add war external dependencies in tomcat run: tomcat6 support too.
        MTOMCAT-100 support war overlay to add war external dependencies in tomcat run.

        olamy : http://svn.apache.org/viewvc/?view=rev&rev=1182064
        Files :

        • /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RunMojo.java
        • /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/RunMojo.java

        olamy : http://svn.apache.org/viewvc/?view=rev&rev=1182063
        Files :

        • /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/pom.xml
        • /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculator.java
        • /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculatorRequest.java
        • /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
        • /tomcat/maven-plugin/trunk/pom.xml
        • /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractRunMojo.java
        • /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RunMojo.java
        • /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java
        • /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/RunMojo.java
        Show
        Hudson added a comment - Integrated in TomcatMavenPlugin-mvn2.x #8 (See https://builds.apache.org/job/TomcatMavenPlugin-mvn2.x/8/ ) MTOMCAT-100 support war overlay to add war external dependencies in tomcat run: tomcat6 support too. MTOMCAT-100 support war overlay to add war external dependencies in tomcat run. olamy : http://svn.apache.org/viewvc/?view=rev&rev=1182064 Files : /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RunMojo.java /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/RunMojo.java olamy : http://svn.apache.org/viewvc/?view=rev&rev=1182063 Files : /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/pom.xml /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculator.java /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculatorRequest.java /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java /tomcat/maven-plugin/trunk/pom.xml /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractRunMojo.java /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RunMojo.java /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/RunMojo.java
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        implemented

        Show
        Olivier Lamy (*$^¨%`£) added a comment - implemented
        Hide
        Hudson added a comment -

        Integrated in TomcatMavenPlugin #27 (See https://builds.apache.org/job/TomcatMavenPlugin/27/)
        MTOMCAT-100 support war overlay to add war external dependencies in tomcat run: this option must be on by default to mimic what the maven war plugin does with overlays.

        olamy : http://svn.apache.org/viewvc/?view=rev&rev=1182081
        Files :

        • /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RunMojo.java
        • /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/RunMojo.java
        Show
        Hudson added a comment - Integrated in TomcatMavenPlugin #27 (See https://builds.apache.org/job/TomcatMavenPlugin/27/ ) MTOMCAT-100 support war overlay to add war external dependencies in tomcat run: this option must be on by default to mimic what the maven war plugin does with overlays. olamy : http://svn.apache.org/viewvc/?view=rev&rev=1182081 Files : /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RunMojo.java /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/RunMojo.java
        Hide
        Olivier Bazoud added a comment -

        I experienced some problems with war overlay with tomcat6:run goal, tomcat does not found any resource present in overlays.
        IMOHO, all the tmpDirs should not be deleted immediately, but only when tomcat stops.
        IMOHO, if directories does not exists, classloaders should skip them.
        If I comment the following line (http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java?revision=1187271&view=markup line 158), Tomcat finds again my ressources files.

        Show
        Olivier Bazoud added a comment - I experienced some problems with war overlay with tomcat6:run goal, tomcat does not found any resource present in overlays. IMOHO, all the tmpDirs should not be deleted immediately, but only when tomcat stops. IMOHO, if directories does not exists, classloaders should skip them. If I comment the following line ( http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java?revision=1187271&view=markup line 158), Tomcat finds again my ressources files.
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        reopen due to user comment

        Show
        Olivier Lamy (*$^¨%`£) added a comment - reopen due to user comment
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        please test with last snapshot.
        reopen if you still have the issue.

        Show
        Olivier Lamy (*$^¨%`£) added a comment - please test with last snapshot. reopen if you still have the issue.
        Hide
        Hudson added a comment -

        Integrated in TomcatMavenPlugin #58 (See https://builds.apache.org/job/TomcatMavenPlugin/58/)
        MTOMCAT-100 support war overlay to add war external dependencies in tomcat run
        delete temporary directories used for extract after plugin shutdown.

        olamy : http://svn.apache.org/viewvc/?view=rev&rev=1198103
        Files :

        • /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculator.java
        • /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculatorRequest.java
        • /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculatorResult.java
        • /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
        • /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RunMojo.java
        • /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java
        • /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/RunMojo.java
        Show
        Hudson added a comment - Integrated in TomcatMavenPlugin #58 (See https://builds.apache.org/job/TomcatMavenPlugin/58/ ) MTOMCAT-100 support war overlay to add war external dependencies in tomcat run delete temporary directories used for extract after plugin shutdown. olamy : http://svn.apache.org/viewvc/?view=rev&rev=1198103 Files : /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculator.java /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculatorRequest.java /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/ClassLoaderEntriesCalculatorResult.java /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RunMojo.java /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/AbstractRunMojo.java /tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/run/RunMojo.java
        Hide
        Hudson added a comment -

        Integrated in TomcatMavenPlugin #60 (See https://builds.apache.org/job/TomcatMavenPlugin/60/)
        MTOMCAT-100 support war overlay to add war external dependencies in tomcat run
        fix extraction of war overlay content files was extracted in .

        olamy : http://svn.apache.org/viewvc/?view=rev&rev=1198376
        Files :

        • /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
        Show
        Hudson added a comment - Integrated in TomcatMavenPlugin #60 (See https://builds.apache.org/job/TomcatMavenPlugin/60/ ) MTOMCAT-100 support war overlay to add war external dependencies in tomcat run fix extraction of war overlay content files was extracted in . olamy : http://svn.apache.org/viewvc/?view=rev&rev=1198376 Files : /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
        Hide
        Olivier Bazoud added a comment -

        a small fix in response to previous commits: target/apache-tomcat-maven-plugin/[mywar] should be exist, otherwise UnArchiver extracts it in root project.
        https://github.com/obazoud/tomcat-maven-plugin/commit/60bd62c83b54f48779adecab8b37053e69e22f58

        Show
        Olivier Bazoud added a comment - a small fix in response to previous commits: target/apache-tomcat-maven-plugin/ [mywar] should be exist, otherwise UnArchiver extracts it in root project. https://github.com/obazoud/tomcat-maven-plugin/commit/60bd62c83b54f48779adecab8b37053e69e22f58
        Show
        Olivier Lamy (*$^¨%`£) added a comment - http://svn.apache.org/viewvc?view=revision&revision=1198376 do that
        Hide
        Hudson added a comment -

        Integrated in TomcatMavenPlugin #62 (See https://builds.apache.org/job/TomcatMavenPlugin/62/)
        MTOMCAT-100 support war overlay to add war external dependencies in tomcat run
        avoid duplicate jars in the webappclassloader: can cause issues with struts2

        olamy : http://svn.apache.org/viewvc/?view=rev&rev=1198740
        Files :

        • /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
        Show
        Hudson added a comment - Integrated in TomcatMavenPlugin #62 (See https://builds.apache.org/job/TomcatMavenPlugin/62/ ) MTOMCAT-100 support war overlay to add war external dependencies in tomcat run avoid duplicate jars in the webappclassloader: can cause issues with struts2 olamy : http://svn.apache.org/viewvc/?view=rev&rev=1198740 Files : /tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/java/org/apache/tomcat/maven/common/run/DefaultClassLoaderEntriesCalculator.java
        Hide
        Olivier Bazoud added a comment -

        It seems to me that the resources(css, js, jsp, ...) available in the war overlayt are not served by the plugin.
        For tomcat 6 plugin, this can help you : http://blog.bazoud.com/post/2009/05/12/Multiples-docbases-avec-tomcat
        For tomcat 7 plugin, you can use alias resources.

        Show
        Olivier Bazoud added a comment - It seems to me that the resources(css, js, jsp, ...) available in the war overlayt are not served by the plugin. For tomcat 6 plugin, this can help you : http://blog.bazoud.com/post/2009/05/12/Multiples-docbases-avec-tomcat For tomcat 7 plugin, you can use alias resources.
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        The issue I have here is to have a different behavior with the maven-war-plugin.
        This one doesn't handle resources from war dependencies.
        So usually folks use maven-dependency-plugin to unpack war dependencies to have those resources packaged with the war artifacts.

        Show
        Olivier Lamy (*$^¨%`£) added a comment - The issue I have here is to have a different behavior with the maven-war-plugin. This one doesn't handle resources from war dependencies. So usually folks use maven-dependency-plugin to unpack war dependencies to have those resources packaged with the war artifacts.
        Hide
        Leo Przybylski added a comment -

        When I run tomcat7:run, it is not overlaying for me. For example, my jsp complains it cannot find tags in /WEB-INF/tags/portal. Normally, when war:war is run, the dependency overlay is extracted into the war directory. tomcat7:run doesn't depend on a war directory, but it also doesn't seem to being picking up tags and other webapp files from my dependency war. How do I get around this?

        Show
        Leo Przybylski added a comment - When I run tomcat7:run, it is not overlaying for me. For example, my jsp complains it cannot find tags in /WEB-INF/tags/portal. Normally, when war:war is run, the dependency overlay is extracted into the war directory. tomcat7:run doesn't depend on a war directory, but it also doesn't seem to being picking up tags and other webapp files from my dependency war. How do I get around this?
        Hide
        Robert Hollencamp added a comment -

        I incorporated the functionality Olivier Bazoud linked to into the tomcat6 plugin. Can somebody from the project review the diff and let me know what they think? It should be pretty trivial to add this to the tomcat7 plugin

        http://pastebin.com/tU0daHZA

        Show
        Robert Hollencamp added a comment - I incorporated the functionality Olivier Bazoud linked to into the tomcat6 plugin. Can somebody from the project review the diff and let me know what they think? It should be pretty trivial to add this to the tomcat7 plugin http://pastebin.com/tU0daHZA
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        @Robert this issue is closed. So please an other one and attach your patch.
        Thanks.

        Show
        Olivier Lamy (*$^¨%`£) added a comment - @Robert this issue is closed. So please an other one and attach your patch. Thanks.

          People

          • Assignee:
            Olivier Lamy (*$^¨%`£)
            Reporter:
            Olivier Lamy (*$^¨%`£)
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development