[ 
http://jira.codehaus.org/browse/MWAR-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=190767#action_190767
 ] 

Damon Silver commented on MWAR-203:
-----------------------------------

FWIW, I came up with a workaround after my original post using maven 2.0.9 (and 
later 2.2.1) and maven-war-plugin 2.1-beta-1 (its version is defined in a 
parent pom):

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          ...
          <overlays>
            <overlay>
              <id>some-id</id>
              <groupId>${company.groupId}</groupId>
              <artifactId>myArtifact</artifactId>
              <type>war</type>
              <includes>
                <include>foo/bar/**</include>
              </includes>
            </overlay>
            <overlay>
              <!--
                Empty groupId/artifactId detected as the current build. 
myArtifact
                overlays must come before this for <webResources> block below 
to work
                properly!
              -->
            </overlay>
          <webResources>
            <!--
              These war/work moves are horrible hacks, but necessary for now
              because other resource manipulation isn't working properly. -
              9/2/09 DTS
            -->
            <resource>
              
<directory>${project.build.directory}/war/work/${company.groupId}/myArtifact/foo/bar</directory>
              <targetPath>random/new/directory</targetPath>
              <includes>
                <include>file1</include>
                <include>file2</include>
                <include>file3</include>
              </includes>
            </resource>
            <resource>
              
<directory>${project.build.directory}/war/work/${company.groupId}/myArtifact/foo/bar</directory>
              <targetPath>some/other/directory</targetPath>
              <includes>
                <include>**/*.jsp</include>
              </includes>
            </resource>
          </webResources>
        </configuration>
      </plugin>
    </plugins>
  </build>


> overlay <include> to strip the original path
> --------------------------------------------
>
>                 Key: MWAR-203
>                 URL: http://jira.codehaus.org/browse/MWAR-203
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Improvement
>         Environment: 2.1-beta-1
>            Reporter: Adam Hamer
>            Priority: Minor
>
> I have a base-war project which I'd like to overlay into my project-war. To 
> avoid filename conflicts I use <targetPath>, but the result is 
> project//targetPath/WEB-INF/... and I don't really want the WEB-INF in there. 
> I came across this posting with the same issue: 
> http://www.coderanch.com/t/447258/Ant-Maven-Other-Build-Tools/Maven-war-dependencies-moving-files.
> I also tried an assembly approach, but this also includes WEB-INF. Other 
> ideas could include using the dependency plugin, antrun-plugin, cargo plugin 
> or some other option? However, I would like to use jetty now that it is 
> supporting overlays http://jira.codehaus.org/browse/JETTY-1027.
> Perhaps some mechanism like this could be added:
> under <includes> or <include>
>   <excludePathPrefix>/WEB-INF/</excludePathPrefix> <!-- ignores the prefix 
> given -->
>   <excludePath>true</excludePath> <!-- copies only the filename -->

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to