Bug 92071 - Duplicate entry on classpath with -promiscuous mode
Summary: Duplicate entry on classpath with -promiscuous mode
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 93088
Blocks:
  Show dependency tree
 
Reported: 2005-04-20 10:05 EDT by Jerome Lanneluc CLA
Modified: 2005-05-12 10:23 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 Jerome Lanneluc CLA 2005-04-20 10:05:50 EDT
I20050419

1. Workspace started with -promiscuous
2. Contains org.eclipse.jdt.core only (no required project)
3. Clean/rebuild
Observe: you get the following error: Build path contains duplicate entry:
'D:eclipse/sdk/eclipse/plugins/org.apache.ant_1.6.2/lib/ant.jar' for project
org.eclipse.jdt.core
Comment 1 Jerome Lanneluc CLA 2005-04-20 10:47:24 EDT
Note that org.eclipse.jdt.core was checked out from HEAD.
Comment 2 Wassim Melhem CLA 2005-04-20 11:35:29 EDT
jdt.core has a redundant optional dependency on org.apache.ant in their 
manifest.mf.  org.apache.ant is only needed to build and run the ant task.
The reason why it's redundant is that in your build.properties file, you 
declare a jars.extra.classpath key referencing the ant lib jars you need.

It is the jars.extra.classpath key that is used during the build process.  The 
org.apache.ant dependency in the manifest.mf is an overhead as it adds about 
27 jars to your classpath unnecessarily, one of which is the ant.jar.  It is 
never used at runtime.


PDE knows about the jars.extra.classpath key and takes it into account when 
computing the classpath.  Therefore, your plugin will compile fine at 
development time too.

Note that PDE always ensures that there are no duplicate entries in the 
classpath.  However, this is a tricky case.   A classpath entry that 
corresponds to a JAR referenced in the build.properties has no access 
restrictions on it.  yet, a dependency via the manifest.mf does have access 
restrictions on it.  So the two entries are technically unequal.

So I see two choices:
1. (recommended) remove the org.apache.ant dependency and everything will be 
fine.
    PRO: less JARs on your classpath at runtime
    CON: you must always have org.apache.ant in your workspace when you try to 
export the jdt.core plugin, since the jars.extra.classpath key references a 
relative path.

2. Remove the jars.extra.classpath key from the build.properties
    PRO: you are not required to have org.apache.ant in your workspace to 
compile.
    CON: about 27 unnecessary JARs on your classpath at runtime.  
Comment 3 Wassim Melhem CLA 2005-04-20 12:18:41 EDT
actually, it appears that bug 91310 has been resolved for this week.  This 
would mean that option 1 has no cons.

Please do not do anything until I verify this and get back with a final 
recommendation.
Comment 4 Philipe Mulet CLA 2005-04-26 18:39:09 EDT
Jerome - pls give a try to option 1.
Comment 5 Wassim Melhem CLA 2005-04-26 18:51:30 EDT
I just verified that using I-20050426-1700, the pde/build fix is in.

So if you do option 1, you will have no cons.

You can verify that it works fine by trying to export jdt.core.
Comment 6 Jerome Lanneluc CLA 2005-04-27 17:21:16 EDT
Thanks Wassim. I removed the dependency to org.apache.ant from MANIFEST.MF.
Comment 7 Jerome Lanneluc CLA 2005-04-28 05:31:02 EDT
Undoing the change and reopening as the ant.jar entry is not added on Linux.
Comment 8 Jerome Lanneluc CLA 2005-04-28 05:41:44 EDT
RequiredPluginsClasspathContainer#addExtraClasspathEntries
Comment 9 Jerome Lanneluc CLA 2005-05-03 10:52:56 EDT
Bug 93088 is now fixed. Releasing the change to the MANIFEST.MF file.
Comment 10 Frederic Fusier CLA 2005-05-12 10:23:15 EDT
Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.