Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.0.7
-
Fix Version/s: Issues to be reviewed for 3.x
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
When trying to package a j2ee project's ejb-client artifact in the ear /lib directory the war plugin's optional attribute is ignored if building from the parent app project. If you build from the parent project you get the ejb-client packaged in the web-inf/lib directory. If you build the ejb, war, and ear independently you get the ejb-client packaged in the ear /lib directory. It seems when run from the parent project the dependency/artifact doesn't have the optional attribute set.
Perhaps this is b/c the artifact is a project artifact that was attached from the ejb plugin it is not resolved as optional when the dependency is resolved from the war project.
Attaching Geronimo's mytime sample with modifications to reproduce the behavior.
Activity
Tim Reilly
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Attachment | MWAR114-maven-war-plugin-2.0.2.patch [ 29736 ] |
Tim Reilly
made changes -
| Attachment | MWAR114-maven-war-plugin-2.0.2.patch [ 29739 ] |
Tim Reilly
made changes -
| Attachment | MWAR114-maven-war-plugin-2.1-alpha-1.patch [ 29740 ] |
Stéphane Nicoll
made changes -
| Affects Version/s | 2.1-alpha-1 [ 13300 ] | |
| Fix Version/s | 2.1-alpha-2 [ 13804 ] | |
| Affects Version/s | 2.1 [ 12616 ] |
Stéphane Nicoll
made changes -
| Project | Maven 2.x War Plugin [ 11150 ] | Maven 2 [ 10500 ] |
| Key | MWAR-114 | MNG-3269 |
| Affects Version/s | 2.0.7 [ 13138 ] | |
| Affects Version/s | 2.1-alpha-1 [ 13300 ] | |
| Fix Version/s | 2.1-alpha-2 [ 13804 ] |
Brett Porter
made changes -
| Fix Version/s | 2.1 [ 13142 ] |
Jason van Zyl
made changes -
| Fix Version/s | 3.0 [ 13142 ] | |
| Fix Version/s | 3.x [ 13145 ] |
I think the underlying issue is a possible false assumption.
The WAR plugin assumes that all of it's dependencies will be resolved to artifacts from it's pom. But in a multimodule build, some artifact's such as an attached an attached ejb-client artifact are not resolved from the war's dependency list. It's already attached to the project. Due to this declaring the ejb-client as optional has no effect.
I will attach the patch we are using as a candidate patch. The patch iterates the dependency list to develop an optional artifacts sub-list. It then iterates the optional artifacts list and ensures the resolved artifacts reflect the optional attribute.