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

patch to allow extra webapp and webapp/WEB-INF/classes files to be specified that override existing files

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      Currnelty, there is no way to execute a plugin inbetween the 'build exploded webapp' part of this plugin, and the 'zip up resources' bit.

      I have the need to override classpath resources, and sometimes other webapp resources, based on a deployment target, such as test / staging or production.

      With this patch, I will be able to have files layed out like this :

      /profile/test/config.properties
      /src/main/resources/config.properties

      then configure the war plugin :

      <configuration>
      <extraWebappClasses>profile/test</extraWebappClasses>
      </configuration>

      thus producing a war that contains profile/test/config.properties instead of the default /src/main/resources/config.properties

      I have investigated alternative ways to achive this goal, and none of them seemed easy.

      Some ideas :

      • split the package phase into 2 phases - preparePackage and package
      • provide a generic technique to allow plugins to expose extension points where other plugins can hook into
      • create a plugin that runs after the war plugin, that creates a new war - slow since the ziping will need to be done twice

      i'm keen to hear anyone's thoughts on the mailing list or in irc - my nick is Fracture

      Attachments

        Issue Links

          Activity

            People

              snicoll Stephane Nicoll
              cameronbraid Cameron Braid
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: