You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Wendy Smoak (JIRA)" <ji...@codehaus.org> on 2008/10/16 17:27:19 UTC

[jira] Issue Comment Edited: (MWAR-82) setting archiveClasses to true create the jar in WEB-INF/lib but does not remove WEB-INF/classes

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

wsmoak edited comment on MWAR-82 at 10/16/08 10:25 AM:
------------------------------------------------------------

Comment edited:  2.0 does not have the <archiveClasses> feature, and I can't reproduce the problem of getting both WEB-INF/classes and WEB-INF/lib in any version.

With 2.0 - files in WEB-INF/classes, nothing in WEB-INF/lib
{noformat}
     0 Thu Oct 16 08:11:56 MST 2008 META-INF/
   221 Thu Oct 16 08:11:54 MST 2008 META-INF/MANIFEST.MF
     0 Thu Oct 16 08:11:56 MST 2008 WEB-INF/
     0 Thu Oct 16 08:11:56 MST 2008 WEB-INF/classes/
     0 Thu Oct 16 08:11:56 MST 2008 WEB-INF/classes/net/
     0 Thu Oct 16 08:11:56 MST 2008 WEB-INF/classes/net/wsmoak/
    52 Thu Oct 16 08:11:56 MST 2008 index.jsp
   535 Thu Oct 16 08:11:56 MST 2008 WEB-INF/classes/net/wsmoak/App.class
   215 Thu Oct 16 08:11:56 MST 2008 WEB-INF/web.xml
     0 Thu Oct 16 08:11:56 MST 2008 META-INF/maven/
     0 Thu Oct 16 08:11:56 MST 2008 META-INF/maven/com.example/
     0 Thu Oct 16 08:11:56 MST 2008 META-INF/maven/com.example/mywebapp/
   946 Thu Oct 16 08:11:50 MST 2008 META-INF/maven/com.example/mywebapp/pom.xml
   111 Thu Oct 16 08:11:56 MST 2008 META-INF/maven/com.example/mywebapp/pom.properties
{noformat}

With 2.0.1, 2.1-alpha-2 - jar in WEB-INF/lib, nothing in WEB-INF/classes

{noformat}
     0 Thu Oct 16 08:12:48 MST 2008 META-INF/
   125 Thu Oct 16 08:12:46 MST 2008 META-INF/MANIFEST.MF
     0 Thu Oct 16 08:12:46 MST 2008 WEB-INF/
     0 Thu Oct 16 08:12:46 MST 2008 WEB-INF/lib/
    52 Thu Oct 16 08:02:02 MST 2008 index.jsp
  2208 Thu Oct 16 08:12:46 MST 2008 WEB-INF/lib/mywebapp.jar
   215 Thu Oct 16 08:02:02 MST 2008 WEB-INF/web.xml
     0 Thu Oct 16 08:12:48 MST 2008 META-INF/maven/
     0 Thu Oct 16 08:12:48 MST 2008 META-INF/maven/com.example/
     0 Thu Oct 16 08:12:48 MST 2008 META-INF/maven/com.example/mywebapp/
   948 Thu Oct 16 08:12:40 MST 2008 META-INF/maven/com.example/mywebapp/pom.xml
   111 Thu Oct 16 08:12:46 MST 2008 META-INF/maven/com.example/mywebapp/pom.properties
{noformat}

      was (Author: wsmoak):
    I can reproduce it in 2.0 and it's fixed in 2.0.1 and later versions.

mvn clean install; jar -tvf target/mywebapp.war

With 2.0:
{noformat}
     0 Thu Oct 16 08:11:56 MST 2008 META-INF/
   221 Thu Oct 16 08:11:54 MST 2008 META-INF/MANIFEST.MF
     0 Thu Oct 16 08:11:56 MST 2008 WEB-INF/
     0 Thu Oct 16 08:11:56 MST 2008 WEB-INF/classes/
     0 Thu Oct 16 08:11:56 MST 2008 WEB-INF/classes/net/
     0 Thu Oct 16 08:11:56 MST 2008 WEB-INF/classes/net/wsmoak/
    52 Thu Oct 16 08:11:56 MST 2008 index.jsp
   535 Thu Oct 16 08:11:56 MST 2008 WEB-INF/classes/net/wsmoak/App.class
   215 Thu Oct 16 08:11:56 MST 2008 WEB-INF/web.xml
     0 Thu Oct 16 08:11:56 MST 2008 META-INF/maven/
     0 Thu Oct 16 08:11:56 MST 2008 META-INF/maven/com.example/
     0 Thu Oct 16 08:11:56 MST 2008 META-INF/maven/com.example/mywebapp/
   946 Thu Oct 16 08:11:50 MST 2008 META-INF/maven/com.example/mywebapp/pom.xml
   111 Thu Oct 16 08:11:56 MST 2008 META-INF/maven/com.example/mywebapp/pom.properties
{noformat}

With 2.0.1, 2.1-alpha-2:

{noformat}
     0 Thu Oct 16 08:12:48 MST 2008 META-INF/
   125 Thu Oct 16 08:12:46 MST 2008 META-INF/MANIFEST.MF
     0 Thu Oct 16 08:12:46 MST 2008 WEB-INF/
     0 Thu Oct 16 08:12:46 MST 2008 WEB-INF/lib/
    52 Thu Oct 16 08:02:02 MST 2008 index.jsp
  2208 Thu Oct 16 08:12:46 MST 2008 WEB-INF/lib/mywebapp.jar
   215 Thu Oct 16 08:02:02 MST 2008 WEB-INF/web.xml
     0 Thu Oct 16 08:12:48 MST 2008 META-INF/maven/
     0 Thu Oct 16 08:12:48 MST 2008 META-INF/maven/com.example/
     0 Thu Oct 16 08:12:48 MST 2008 META-INF/maven/com.example/mywebapp/
   948 Thu Oct 16 08:12:40 MST 2008 META-INF/maven/com.example/mywebapp/pom.xml
   111 Thu Oct 16 08:12:46 MST 2008 META-INF/maven/com.example/mywebapp/pom.properties
{noformat}
  
> setting archiveClasses to true create the jar in WEB-INF/lib but does not remove WEB-INF/classes
> ------------------------------------------------------------------------------------------------
>
>                 Key: MWAR-82
>                 URL: http://jira.codehaus.org/browse/MWAR-82
>             Project: Maven 2.x War Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Sebastien Brunot
>            Assignee: Stephane Nicoll
>             Fix For: 2.0.1
>
>
> This bug has been explained on the maven users mailing list:
> Hi Sebastien
>   It seems to be a bug.
>   In the code [1] we have :
>             if ( archiveClasses )
>             {
>                 createJarArchive( libDirectory );
>             }
>             else
>             {
>                 copyDirectoryStructureIfModified( classesDirectory, webappClassesDirectory );
>             }
>   The content of the classes directory is never removed (neither in createJarArchive nor somewhere else).
>   Can you create an issue please ?
> Thx
> Arnaud
> [1]
> http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java?revision=471624
> Sebastien Brunot wrote:
> > 
> > Hi all,
> >  
> > i've got a war project which pom build section contains the following
> > statements:
> >  
> >    <!-- Package webapp classes into a jar instead of under 
> > WEB-INF/classes -->
> >    <plugin>
> >     <groupId>org.apache.maven.plugins</groupId>
> >     <artifactId>maven-war-plugin</artifactId>
> >     <executions>
> >      <execution>
> >       <goals>
> >        <goal>war</goal>
> >       </goals>
> >       <configuration>
> >        <archiveClasses>true</archiveClasses>
> >       </configuration>
> >      </execution>
> >     </executions>
> >    </plugin>
> > 
> > As a result, all the classes and resources from my war project are 
> > packaged in a jar that is copied in the WEB-INF/lib directory of the 
> > war artifact.
> >  
> > But i don't understand why the war artifact still contains copy of the 
> > classes and resources under WEB-INF/classes... Does anybody think that 
> > i've misconfigured the war plugin ?
> >  
> > Thanks for your help,
> >  
> > Sebastien
> > 
> > 
> --
> View this message in context: http://www.nabble.com/Configuring-war-plugin-for-using-a-jar-instead-of-WEB-INF-classes-tf2589199s177.html#a7219855
> Sent from the Maven - Users mailing list archive at Nabble.com.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

-- 
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