Issue Details (XML | Word | Printable)

Key: MPEAR-18
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: johan Eltes
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Maven 1.x Ear Plugin

Deduct utility jars from module poms

Created: 14/Jul/04 01:25 PM   Updated: 08/Dec/04 10:27 PM
Return to search
Component/s: None
Affects Version/s: 1.4
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide

J2EE requires a utility jar loadable by the ear classloader to be referenced by the manifest (Class-Path entry) of each j2ee module that depends on it. Maven WAR-, EJB- and other J2EE module plug-ins have support for updating the manifest Classpath entry, using a plug-in property specific to each plug-in.

For the EJB plug-in, the related properties are ejb.manifest.classpath and ejb.bundle. For the WAR plug-in, the corresponding properties are war.manifest.classpath and war.bundle.

There is no way a j2ee module could depend on a utility jar without referencing it in the Class-Path entry of the manifest. It is then valid to assume that each dependency element declaring a dependency of a utility jar is tagged by a war.manifest.classpath=true or a ejb.manifest.classpath=true.

Using this information, there shouldn't be any reason for (redundantly) listing the utility jars in the dependencies element of the EAR pom (which is currently required).

To be able to exclude utility jars from the pom of an ear project, the ear plug-in would need to traverse the j2ee modules listed as dependencies of the ear pom. If the traversed node/module is an ejb-jar, the EAR plug-in would collect all dependencies of the ejb module for which the following conditions apply: ejb.manifest.classpath=true and ejb.bundle=false. The corresponding condition for a traversed WAR dependency would be war.manifest.classpath=true and war.bundle=false

For compatibility with current use model, the set of collected utility jars should then be merged with utility jars (redundantly) listed in the pom of the ear project. The resulting set of dependent jars should be included in the generated ear.



Felipe Leme added a comment - 08/Dec/04 10:27 PM

Just as a side note, that would depend on maven being able to resolve transitive dependencies, which is not going to happen in the maven 1.x series (only at M2).