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

Karl Heinz Marbaise commented on MWAR-356:
------------------------------------------

First thanks for your feedback. So i have checked with your example 
project...and i will get the same result as you described...based on the layout 
of your test project:
{noformat}
.
├── pom.xml
├── src
│   └── main
│       ├── java
│       │   └── org
│       │       └── apache
│       │           └── issues
│       │               └── MWAR356Test.java
│       ├── resources
│       │   └── test.properties
│       └── webapp
│           ├── META-INF
│           │   └── MANIFEST.MF
│           └── WEB-INF
│               ├── lib
│               └── web.xml
{noformat}
So the result is as you described:
{noformat}
Archive:  target/mwar-356-0.0.1-SNAPSHOT.war
    testing: META-INF/                OK
    testing: META-INF/MANIFEST.MF     OK
    testing: WEB-INF/                 OK
    testing: WEB-INF/classes/         OK
    testing: WEB-INF/lib/             OK
    testing: WEB-INF/lib/mwar-356-0.0.1-SNAPSHOT.jar   OK
    testing: WEB-INF/web.xml          OK
    testing: META-INF/maven/          OK
    testing: META-INF/maven/org.apache.issues/   OK
    testing: META-INF/maven/org.apache.issues/mwar-356/   OK
    testing: META-INF/maven/org.apache.issues/mwar-356/pom.xml   OK
    testing: META-INF/maven/org.apache.issues/mwar-356/pom.properties   OK
No errors detected in compressed data of target/mwar-356-0.0.1-SNAPSHOT.war.
{noformat}
So based on the configuration for the maven-war-plugin you have made in the 
project example:
{{<archiveClasses>true</archiveClasses>}} which means to create a jar file of 
the the classes which are in {{src/main/java}} including properties...If you 
don't like to create an archive of the classes in {{src/main/java}} you can 
simply omit this configuration option which will result in the following:
{noformat}
Archive:  target/mwar-356-0.0.1-SNAPSHOT.war
    testing: META-INF/                OK
    testing: META-INF/MANIFEST.MF     OK
    testing: WEB-INF/                 OK
    testing: WEB-INF/classes/         OK
    testing: WEB-INF/classes/org/     OK
    testing: WEB-INF/classes/org/apache/   OK
    testing: WEB-INF/classes/org/apache/issues/   OK
    testing: WEB-INF/classes/org/apache/issues/MWAR356Test.class   OK
    testing: WEB-INF/classes/test.properties   OK
    testing: WEB-INF/web.xml          OK
    testing: META-INF/maven/          OK
    testing: META-INF/maven/org.apache.issues/   OK
    testing: META-INF/maven/org.apache.issues/mwar-356/   OK
    testing: META-INF/maven/org.apache.issues/mwar-356/pom.xml   OK
    testing: META-INF/maven/org.apache.issues/mwar-356/pom.properties   OK
No errors detected in compressed data of target/mwar-356-0.0.1-SNAPSHOT.war.
{noformat}
You can the {{<attachClasses>true</attachClasses>}} option independent of the 
{{<archiveClasses>true</archiveClasses>}}  so you only get an supplemental 
archive being generated which contains the content of {{src/main/java}} 
including {{src/main/resources}} as a reusable archive.
If you use filtering for the {{src/main/resources}} parts they will be filtered 
as usual...

So in the end i have to admit i don't see the problem you have? Cause based on 
the given description the files are not put into {{src/main/resources}}....May 
be i misunderstand a thing here...Can you please elaborate more what you 
problem is ? 




> "archiveClasses" and "attachClasses" should archive/attach classes only
> -----------------------------------------------------------------------
>
>                 Key: MWAR-356
>                 URL: https://issues.apache.org/jira/browse/MWAR-356
>             Project: Maven WAR Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.6
>            Reporter: Alberto Mozzone
>             Fix For: waiting-for-feedback
>
>         Attachments: mwar-356-test.zip
>
>
> As their name implies, "archiveClasses" and "attachClasses" should avoid to 
> put in the resulting jar the files under "src/main/resources" because:
> # they're not classes
> # they should be left in "WEB-INF/classes"
> # they could be environment dependent: via filtering, the resources in the 
> deployed artifact could contain information which simply do not make sense in 
> the repository (or, worse, could contain sensitive information)
> Of course, to preserve backward compatibility, I just suggest 2 alternatives:
> # a brand new element which joins the behavior of "archiveClasses" and 
> "attachClasses" (e. g. "packageClasses/deployClasses") and a sibling element 
> "packageResources" which puts the resources in a jar file in "WEB-INF/lib", 
> but not in the repo
> # a new option used by the two elements which activates the new behavior.
> I'm assuming that the properties in subject should behave the same to avoid 
> differences in artifact naming or content; see also 
> [MWAR-215|https://issues.apache.org/jira/browse/MWAR-215].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to