Maven 1.x War Plugin
  1. Maven 1.x War Plugin
  2. MPWAR-18

plugin doesn't provide for easily way to filter files

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Number of attachments :
      6

      Description

      Since the war plugin does not use the project.xml file for any of its resources, there is not an easy way to filter files. If you are building an artifact that uses maven:copy-resources in one of its goals, filtering is simple. Just set filtering to true on the build resource in the POM, and add a simple preGoal which sets your filters maven.xml This is a lot more difficult when building a war because the files are copied and built into the war in the same goal.

      There are some workarounds to this. You can copy the source directory for your webapp to a temporary directory under target and have that be maven.war.src. That requires a lot of verbose code in maven.xml for each webapp. A filtering attribute could be added to the ant:copy command that copies the maven.war.src directory, but then filters cannot be easily defined in the POM.

      1. plugin.jelly.patch
        1 kB
        Eric Hauser
      2. plugin.jelly.patch2
        0.6 kB
        Eric Hauser
      3. plugin.properties.patch
        0.6 kB
        Eric Hauser
      4. plugin.properties.patch2
        0.9 kB
        Eric Hauser
      5. properties.xml.patch
        0.7 kB
        Eric Hauser
      6. properties.xml.patch2
        0.6 kB
        Eric Hauser

        Activity

        Hide
        Eric Hauser added a comment -

        I added a couple patches which seems to me like a good solution. This allows users to easily include pom resources in their webapp, but by default it is turned off.

        Show
        Eric Hauser added a comment - I added a couple patches which seems to me like a good solution. This allows users to easily include pom resources in their webapp, but by default it is turned off.
        Hide
        Eric Hauser added a comment -

        I also added a second group of patches that would just add filtering to the web.xml document instead of using resources from the pom.

        Show
        Eric Hauser added a comment - I also added a second group of patches that would just add filtering to the web.xml document instead of using resources from the pom.
        Hide
        Michael Osipov added a comment -

        Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

        Show
        Michael Osipov added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

          People

          • Assignee:
            Unassigned
            Reporter:
            Eric Hauser
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1 hour
              1h
              Remaining:
              Remaining Estimate - 1 hour
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified