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

Add multiple files to WEB-INF from a merge point directory

    Details

    • Type: New Feature New Feature
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      na
    • Number of attachments :
      1

      Description

      This feature adds the possibility to include pre-filtered files from a merge-point directory

      It looks for 2 properties:

      1. the directory to get the files from, you need to make sure this exists
        maven.build.mergedir=$ {maven.build.dir}

        /merge-point

      2. a comma delimted list of files to look for
        maven.war.webinf.filelist=ws-proxyfactory-config.xml,some-config-file.xml

      You would use:
      <goal name="filter-before-war-example">
      <mkdir dir="$

      {maven.build.mergedir}"/>
      <!-- setup a filterset here ..... -->
      <ant:copy
      file="${basedir}/src/webapp/WEB-INF/some-config.xml"
      tofile="${maven.build.mergedir}

      /some-config.xml"
      filtering="true"
      />
      <attainGoal name="war:war"/>
      </goal>

      below is a cvs diff -u plugin.jelly

      Index: plugin.jelly
      ===================================================================
      RCS file: /home/cvspublic/maven-plugins/war/plugin.jelly,v
      retrieving revision 1.42
      diff -u -r1.42 plugin.jelly
      — plugin.jelly 29 Apr 2004 17:05:41 -0000 1.42
      +++ plugin.jelly 14 Jun 2004 16:12:08 -0000
      @@ -17,7 +17,6 @@
      */
      -->

      -
      <project xmlns:j="jelly:core"
      xmlns:license="license"
      xmlns:util="jelly:util"
      @@ -132,7 +131,25 @@
      </ant:fileset>
      </ant:copy>
      </j:if>
      +
      + <!-- want to independently copy specified files to the WEB-INF diectory that
      + may have been filtered
      + -->
      +
      + <!-- split the list of files up -->
      + <util:tokenize var="maven.war.webinf.filelist.split" delim=",">$

      {maven.war.webinf.filelist}

      </util:tokenize>

      + <!-- iterate the list -->
      + <j:forEach var="file" items="$

      {maven.war.webinf.filelist.split}

      ">
      + <!-- ant:echo>Merge file: $

      {file}</ant:echo -->
      + <util:available file="${maven.build.mergedir}/${file}

      ">
      + <ant:echo>Copying $

      {maven.build.mergedir}/${file} to ${webapp.build.webinf}/${file}</ant:echo>
      + <ant:copy file="${maven.build.mergedir}

      /$

      {file}"
      + tofile="${webapp.build.webinf}/${file}

      "
      + overwrite="true" />
      + </util:available>
      + </j:forEach>
      +
      <util:available file="$

      {maven.war.webxml}">
      <ant:copy file="${maven.war.webxml}

      "
      tofile="$

      {webapp.build.webinf}

      /web.xml"

        Activity

        Hide
        Peter Anning added a comment -

        cvs diff -u plugin.jelly

        Show
        Peter Anning added a comment - cvs diff -u plugin.jelly

          People

          • Assignee:
            Unassigned
            Reporter:
            Peter Anning
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: