You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Zecas (JIRA)" <ji...@codehaus.org> on 2008/07/31 11:03:27 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=143711#action_143711 ] 

zecas edited comment on MWAR-82 at 7/31/08 4:02 AM:
----------------------------------------------------

Hi,

I came across this issue, and I'm having the same problem.

My pom.xml settings:
	&lt;build&gt;
		&lt;outputDirectory&gt;WebContent/WEB-INF/classes&lt;/outputDirectory&gt;
		&lt;plugins&gt;
			&lt;plugin&gt;
				&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
				&lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
				&lt;version&gt;2.0.1&lt;/version&gt;
				&lt;executions&gt;
					&lt;goal&gt;explode&lt;/goal&gt;
				&lt;/executions&gt;
				&lt;configuration&gt;				
					&lt;archiveClasses&gt;true&lt;/archiveClasses&gt;
					&lt;dependentWarIncludes&gt;
						**/resources/*.*
					&lt;/dependentWarIncludes&gt;							 
					&lt;webResources&gt;
						&lt;resource&gt;
							&lt;!-- this is relative to the pom.xml directory --&gt;
							&lt;directory&gt;${basedir}/WebContent&lt;/directory&gt;
						&lt;/resource&gt;
					&lt;/webResources&gt;
				&lt;/configuration&gt;
			&lt;/plugin&gt;			
		&lt;/plugins&gt;
	&lt;/build&gt;	

It creates a jar file inside the WEB-INF\lib folder, but doesn't remove classes from WEB-INF\classes folder.

Any workaround?

      was (Author: zecas):
    Hi,

I came across this issue, and I'm having the same problem.

My pom.xml settings:
	<build>
		<outputDirectory>WebContent/WEB-INF/classes</outputDirectory>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.0.1</version>
				<executions>
					<goal>explode</goal>
				</executions>
				<configuration>				
					<archiveClasses>true</archiveClasses>
					<dependentWarIncludes>
						**/resources/*.*
					</dependentWarIncludes>							 
					<webResources>
						<resource>
							<!-- this is relative to the pom.xml directory -->
							<directory>${basedir}/WebContent</directory>
						</resource>
					</webResources>
				</configuration>
			</plugin>			
		</plugins>
	</build>	

It creates a jar file inside the WEB-INF\lib folder, but doesn't remove classes from WEB-INF\classes folder.

Any workaround?
  
> 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
>            Reporter: Sebastien Brunot
>            Assignee: Stephane Nicoll
>
> 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