Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 2.0
-
Fix Version/s: 2.0.1
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
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 )
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
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
Activity
| Field | Original Value | New Value |
|---|---|---|
| Resolution | Cannot Reproduce [ 5 ] | |
| Assignee | Stephane Nicoll [ sni ] | |
| Status | Open [ 1 ] | Closed [ 6 ] |
| Fix Version/s | 2.0.1 [ 12623 ] | |
| Affects Version/s | 2.0 [ 12160 ] |
What commands have you been using to generate your war ?
I have an idea that the scenario was:
" <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archiveClasses>false</archiveClasses><!-
or missing-></configuration>
</execution>
</executions>
</plugin>"
then:
mvn package
after that user changed in pom.xml to: <archiveClasses>true</archiveClasses>
then:
mvn package
In effect the final zzz.war constains both: classes and zzz.jar.
It is reason of the target/zzz directory, which constains zzz classes ofter first "mvn package",
and zzz.jar after the second "mvn package".
Instead the second "mvn package" the user should use "mvn clean package", to run the
war plugin on an empty target/zzz dir.
If the scenario is true - I think that this issue is not a bug.