You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ji...@codehaus.org on 2004/06/14 18:26:08 UTC

[jira] Created: (MPWAR-27) Add multiple files to WEB-INF from a merge point directory

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MPWAR-27

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPWAR-27
    Summary: Add multiple files to WEB-INF from a merge point directory
       Type: New Feature

     Status: Open
   Priority: Minor

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven-war-plugin

   Assignee: Jason van Zyl
   Reporter: Peter Anning

    Created: Mon, 14 Jun 2004 12:24 PM
    Updated: Mon, 14 Jun 2004 12:24 PM
Environment: na

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

It looks for 2 properties: 
# the directory to get the files from, you need to make sure this exists 
maven.build.mergedir=${maven.build.dir}/merge-point 
# 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"


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Updated: (MPWAR-27) Add multiple files to WEB-INF from a merge point directory

Posted by ji...@codehaus.org.
The following issue has been updated:

    Updater: Peter Anning (mailto:email@peteranning.com)
       Date: Mon, 14 Jun 2004 12:26 PM
    Comment:
cvs diff -u plugin.jelly
    Changes:
             Attachment changed to plugin-patch.txt
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://jira.codehaus.org/browse/MPWAR-27?page=history

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/MPWAR-27

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: MPWAR-27
    Summary: Add multiple files to WEB-INF from a merge point directory
       Type: New Feature

     Status: Open
   Priority: Minor

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: maven-war-plugin

   Assignee: Jason van Zyl
   Reporter: Peter Anning

    Created: Mon, 14 Jun 2004 12:24 PM
    Updated: Mon, 14 Jun 2004 12:26 PM
Environment: na

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

It looks for 2 properties: 
# the directory to get the files from, you need to make sure this exists 
maven.build.mergedir=${maven.build.dir}/merge-point 
# 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"


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org