You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Sergiy Shyrkov (JIRA)" <ji...@codehaus.org> on 2011/08/10 15:51:44 UTC

[jira] Commented: (MWAR-240) archiveClasses and attachClasses in 2.1

    [ https://jira.codehaus.org/browse/MWAR-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=275452#comment-275452 ] 

Sergiy Shyrkov commented on MWAR-240:
-------------------------------------

Confirm, same issue with Maven 3 and maven-war-plugin 2.1.1 on Windows.

Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

> archiveClasses and attachClasses in 2.1
> ---------------------------------------
>
>                 Key: MWAR-240
>                 URL: https://jira.codehaus.org/browse/MWAR-240
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
> Java version: 1.6.0_18
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows"
>            Reporter: Sergiy Shyrkov
>         Attachments: effective-pom.out, mwar-240-test-case.zip
>
>
> There seems to be a regression between 2.1-beta-1 and 2.1 with regard to archiveClasses and attachClasses options.
> My use case:
> I have a WAR project with Java classes and I am setting both archiveClasses and attachClasses to true.
> With 2.1-beta-1 it was working correctly (mvn clean install) --> I got classes packaged into a JAR and placed into WEB-INF/lib and I got that JAR artifact deployed to my Maven repository.
> Just upgraded to 2.1 and I got the following with the same use case: I got classes packaged into a JAR and placed into WEB-INF/lib (correct) and I got an empty JAR artifact (only META-INF/ present) deployed to my Maven repository (incorrect).
> Looking at the code in 2.1 of WarMojo (line 230) I am seeing that the classes folder (for classes to be included into attached artifact) is empty, because it was cleared before due to archiveClasses=true
> Trying to debug both code branches I am seeing a difference between 2.1-beta-1 and 2.1 in that the
> getJarArchiver().getDirs() before the call to packager.packageClasses() method (line 233/234)
> is empty in the 2.1:
> 	 (java.util.HashMap<K,V>) {}
> whereas it is not in 2.1-beta-1. It contains a list of all my classes, perhaps because the same archiver instance was used to package them into JAR for WEB-INF/lib.
> That is why I am getting all my classes in the attached artifact with 2.1-beta-1
> I would really need your help in understanding the "correct" behaviour.
> Is this a regression bug for 2.1 or I am completely wrong in my expectations about archiveClasses and attachClasses used together?
> Kind regards
> Sergiy Shyrkov

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira