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

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

The {{-classes.jar}} artifact (attached) is exactly for the purpose to be 
consumed as a dependency for others which contains {{src/main/java}} classes 
including the usual filtered/non filtered resources from {{src/main/resources}} 
(depending on your configuration).

If you like to have resources which are only for the war to be put into {{/}} 
of the WAR file [you have to go via 
this|http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filtering-webresources.html]:
{code:xml}
<configuration>
     <webResources>
         <resource>
           <!-- this is relative to the pom.xml directory -->
           <directory>src/main/webresources</directory>
         </resource>
     </webResources>
</configuration>
{code}
If you add a folder like {{src/main/webresources/WEB-INF/}} in the 
{{webresources}} folder those files will end up in {{WEB-INF}} folder...Those 
files will not be put into the {{-classes}} jar archive...

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