[
https://issues.apache.org/jira/browse/MWAR-356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15147135#comment-15147135
]
Alberto Mozzone commented on MWAR-356:
--------------------------------------
Ok, I'll try to explanate.
My objective is to pack classes so the JAR can be a dependency, without any
resource of the WAR. I want to:
# put all and only classes (compiled from "src/main/java") in a JAR file in
"WEB-INF/lib" and outside of the WAR, to allow it to be a dependency (because
it is installed/deployed in the repo and, moreover, it should be the same JAR);
# put all non-classes files (present in "src/main/resources" and properly
filtered) in "WEB-INF/classes";
According to what you did, only one of the listed objectives can be
accomplished at a time, because:
# "archiveClasses" creates a JAR in "WEB-INF/lib" containing the classes
derived from source files in "src/main/java" and the filtered copy of
"src/main/resources" files;
# "attachClasses" creates a JAR named "<artifactId>-<version>-classes.jar"
outside of the war and puts the classes derived from source files in
"src/main/java" and the filtered copy of "src/main/resources" files under
"WEB-INF/classes".
HTH
> "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)