Uploaded image for project: 'Maven WAR Plugin'
  1. Maven WAR Plugin
  2. MWAR-73

war overlay mechanism does not work for classes

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 2.0, 2.0.1, 2.0.2, 2.1-beta-1
    • None
    • overlay
    • None
    • all OS, all JDK, currently using jdk1.4.2_10 and jdk1.5.0_06 under linux fedora core 5/x86_64 and sunOS5.10/Sparc64

    Description

      PROBLEM DESCRIPTION:
      When building a WAR (e.g. war2.war) which depends on another WAR (e.g. war1.war), the web-resources from the dependant war are beeing used as base for overlaying.

      This mechanism doesn't currently work for the classes within the dependant war, altough it is specified by the plugin documentation
      See the SampleActionDependency.class in http://maven.apache.org/plugins/maven-war-plugin/examples/war-overlay.html

      APPLIED PATCH:
      I have written two simple war examples war1 and war2 and extended the maven-war-plugin by an own WarClasspathMojo which is bound to the phase generate-resources to fix this issue.

      Since i found no way to add non-artifact parts to the classpath, i simply unpack all dependant war files (reusing the functions already there in AbstractWarMojo) and add a resource-path to the $explodedWarDir/WEB-INF/classes for each of them. The

      The implementation fits all my needs, but if you provide me with a hint how it may be improved, then let me know.

      KNOWN ISSUES:
      This mechanism currently doesn't work if you have specified to generate an archive for the dependant war's classes.

      Attachments

        1. maven-war-plugin-patch.tar.gz
          3 kB
          Mark Struberg
        2. warpath.patch.tar.gz
          5 kB
          Michael Horwitz

        Issue Links

          Activity

            People

              struberg Mark Struberg
              struberg Mark Struberg
              Votes:
              7 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: