[ 
https://issues.apache.org/jira/browse/SIS-34?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13414104#comment-13414104
 ] 

Ross Laidlaw edited comment on SIS-34 at 7/13/12 11:11 PM:
-----------------------------------------------------------

I had a look into this issue.  It seems that several other Apache projects have 
encountered the same problem.  For example see RAVE-63.

The parent Apache POM sets up the maven-remote-resources-plugin, which imports 
the LICENSE, NOTICE and DEPENDENCIES files from the apache-jar-resource-bundle. 
 Then for each POM in our project, this plugin puts the files into a 
'target/maven-shared-archive-resources' folder.  The plugin also copies these 
files to the 'target/classes/META-INF' folder.  For jars this is perfect, 
because the build then copies everything in 'target/classes' to the jar top 
level.  But for wars, everything in 'target/classes' gets copied to 
'WEB-INF/classes'.  That's why we end up with the LICENSE, NOTICE and 
DEPENDENCIES files in 'WEB-INF/classes/META-INF/'.

To get around the problem, the Rave guys (Ravers?) added the following code to 
their top-level POM (see 
http://svn.apache.org/viewvc/rave/rave-master-pom/trunk/pom.xml ):

{code}
<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-war-plugin</artifactId>
      <configuration>
        <!-- 
         copy legal files added/appended by maven-remote-resources-plugin 
         from /WEB-INF/classes/META-INF/ to root /META-INF folder as expected
         for war artifacts, see RAVE-168
        -->
        <webResources>
          <resource>
            <directory>${project.build.directory}/classes/META-INF</directory>
            <includes>
              <include>LICENSE</include>
              <include>NOTICE</include>
              <include>DEPENDENCIES</include>
            </includes>
            <targetPath>META-INF</targetPath>
            <filtering>false</filtering>
          </resource>
        </webResources>
        <!-- 
          exclude legal files added/appended by maven-remote-resources-plugin
          under /WEB-INF/classes/META-INF/ as for war artifacts these should 
(see above)
          be provided under /META-INF/ instead, see RAVE-168
        -->
        <packagingExcludes>
          WEB-INF/classes/META-INF/LICENSE,
          WEB-INF/classes/META-INF/NOTICE,
          WEB-INF/classes/META-INF/DEPENDENCIES
        </packagingExcludes>
      </configuration>
    </plugin>      
  </plugins>
</build>
{code}

I tried adding something similar to the sis-parent POM.  It seems to work.  The 
webResources configuration adds the META-INF files to the top level of the war 
and the 'packagingExcludes' part removes the LICENSE, NOTICE and DEPENDENCIES 
files from WEB-INF/classes/META-INF.

Would this be a suitable workaround for SIS?  Seems like this code is still 
very much part of the Rave project.


                
      was (Author: rlaidlaw):
    I had a look into this issue.  It seems that several other Apache projects 
have encountered the same problem.  For example see RAVE-63.

The parent Apache POM sets up the maven-remote-resources-plugin, which imports 
the LICENSE, NOTICE and DEPENDENCIES files from the apache-jar-resource-bundle. 
 Then for each POM in our project, this plugin puts the files into a 
'target/maven-shared-archive-resources' folder.  The plugin also copies these 
files to the 'target/classes/META-INF' folder.  For jars this is perfect, 
because the build then copies everything in 'target/classes' to the jar top 
level.  But for wars, everything in 'target/classes' gets copied to 
'WEB-INF/classes'.  That's why we end up with the LICENSE, NOTICE and 
DEPENDENCIES files in 'WEB-INF/classes/META-INF/'.

To get around the problem, the Rave guys (Ravers?) added the following code to 
their top-level POM (see 
http://svn.apache.org/viewvc/rave/rave-master-pom/trunk/pom.xml):

{code}
<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-war-plugin</artifactId>
      <configuration>
        <!-- 
         copy legal files added/appended by maven-remote-resources-plugin 
         from /WEB-INF/classes/META-INF/ to root /META-INF folder as expected
         for war artifacts, see RAVE-168
        -->
        <webResources>
          <resource>
            <directory>${project.build.directory}/classes/META-INF</directory>
            <includes>
              <include>LICENSE</include>
              <include>NOTICE</include>
              <include>DEPENDENCIES</include>
            </includes>
            <targetPath>META-INF</targetPath>
            <filtering>false</filtering>
          </resource>
        </webResources>
        <!-- 
          exclude legal files added/appended by maven-remote-resources-plugin
          under /WEB-INF/classes/META-INF/ as for war artifacts these should 
(see above)
          be provided under /META-INF/ instead, see RAVE-168
        -->
        <packagingExcludes>
          WEB-INF/classes/META-INF/LICENSE,
          WEB-INF/classes/META-INF/NOTICE,
          WEB-INF/classes/META-INF/DEPENDENCIES
        </packagingExcludes>
      </configuration>
    </plugin>      
  </plugins>
</build>
{code}

I tried adding something similar to the sis-parent POM.  It seems to work.  The 
webResources configuration adds the META-INF files to the top level of the war 
and the 'packagingExcludes' part removes the LICENSE, NOTICE and DEPENDENCIES 
files from WEB-INF/classes/META-INF.

Would this be a suitable workaround for SIS?  Seems like this code is still 
very much part of the Rave project.


                  
> LICENSE/NOTICE file is in incorrect location in SIS webapp
> ----------------------------------------------------------
>
>                 Key: SIS-34
>                 URL: https://issues.apache.org/jira/browse/SIS-34
>             Project: Spatial Information Systems
>          Issue Type: Bug
>          Components: build process
>            Reporter: Kevan Miller
>            Assignee: Chris A. Mattmann
>            Priority: Critical
>             Fix For: 0.2-incubating
>
>
> Per [~kevan]:
> {quote}
> The LICENSE/NOTICE files in sis-webapp-0.2-incubating.war are not in the 
> correct location (WEB-INF/classes/META-INF/LICENSE) which is minor, IMO.
> {quote}
> Need to update Maven to put them in the right place.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to