Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 348990

Summary: ExtensionLocationMetadataRepository is attempted before composite.
Product: [Eclipse Project] Equinox Reporter: Thomas Hallgren <thomas>
Component: p2Assignee: Pascal Rapicault <pascal>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david_williams, pascal
Version: 3.6.2   
Target Milestone: Juno M1   
Hardware: All   
OS: All   
Whiteboard:

Description Thomas Hallgren CLA 2011-06-10 03:17:49 EDT
The b3 aggregator will create a repository that might contain a composite metadata co-located with one single artifact repository. The layout of the resulting folder looks like this:

artifacts.jar
compositeContent.jar
plugins/
features/
aggregate/
    composite-child-1/
    composite-child-2/

When attempting to install from this repository into an IDE, it shows up empty. I found the reason for this to be that the "eclipse" type (the ExtensionLocationMetadataRepository) is tested before the composite type. The "eclipse" type will recognize any folder with a plugins/ and features/ folder and thus become the designated factory. I.e. the isBaseDirectory() method returns true.

The containsStandardP2Repository() method returns false since the ".jar" extensions is missing from the list and this causes the validate() method to succeed.

I added a p2.index file as a quick workaround for this problem but the proper fix is probably to extend the list of standard p2 repositories with the .jar extended ones.
Comment 1 Pascal Rapicault CLA 2011-06-10 16:25:51 EDT
Fixed in ExtensionLocationMetadataRepository with the following change:
public static final List<String> STANDARD_P2_REPOSITORY_FILE_NAMES = Arrays.asList("artifacts.jar", "content.jar", "artifacts.xml", "content.xml", "compositeArtifacts.xml", "compositeContent.xml", "compositeArtifacts.jar", "compositeContent.jar"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$