Bug 184159 - [j2ee properties] J2EE Module Dependencies incorrectly changes a plug-in project to a J2EE utility project.
Summary: [j2ee properties] J2EE Module Dependencies incorrectly changes a plug-in proj...
Status: NEW
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Chuck Bridgham CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-26 00:44 EDT by Ivan Biddles CLA
Modified: 2007-05-13 23:37 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Biddles CLA 2007-04-26 00:44:59 EDT
USE CASE:

There is a project containing common base and utility classes that is needed to be deployed as a plug-in in an RCP application and also included within a WAR file created from a separate server project.

ISSUE:

If you add the common project to the server project via J2EE Module Dependencies, a META-INF directory and MANIFEST.MF file (Jar-file style) are added to the src directory of the common project.

Also, a .settings directory is added with three files in it -- org.eclipse.wst.common.component file, org.eclipse.wst.common.project.facet.core.xml, and org.eclipse.jdt.core.prefs. Rob Frost told me that this causes the project to be converted to a J2EE utility project.

Howver, the added manifest effectively overrides the plug-in manifest in the resultant plug-in JAR file when the common project is exported as a "deployable plugin or fragment".

I proved this by renaming the added MANIFEST.MF to MANIFEST.MF2 and both files are output to the plug-in JAR file.

WORKAROUND:

The workaround is to rename the MANIFEST.MF added by the J2EE Module Dependencies to MANIFEST.MF2 (or even to delete it), which allows the plug-in manifest to be correctly exported but does not cause any problems when the project is exported as a simple JAR file within the WAR file of the server project.

RECOMMENDATION:

Do not add a MANIFEST.MF file when the common project is made a dependency.

The added MANIFEST.MF file does not appear to be necessary. THe entries in the .settings directory ought to be enough to mark the project with a J2EE utilty facet without removing its plug-in nature. It should be possible for the manifest to be created automatically by the JDK JAr utility.
Comment 1 Nitin Dahyabhai CLA 2007-04-26 03:44:13 EDT
Related to bug 141056.