eclipse-m2e/m2e-core

cannot expand target locations with 2 bundles

Opened this issue · 3 comments

Something seems to be wrong around the getChildren/hasChildren implementation of the maven target locations. We have several locations with just a single bundle, plus source. All those locations with 2 bundles cannot be expanded:
grafik

This does not happen for update site locations with 1 or 2 bundles. You can reproduce with this target file, which is from the above screenshot, cut down to only the AssertJ entry.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="Chevron missing" sequenceNumber="1690180284">
  <locations>
    <location includeDependencyDepth="none" includeDependencyScopes="test" includeSource="true" missingManifest="error" type="Maven" label="AssertJ">
    <dependencies>
    	<dependency>
    		<groupId>org.assertj</groupId>
    		<artifactId>assertj-core</artifactId>
    		<version>3.24.2</version>
    		<type>jar</type>
    	</dependency>
    </dependencies>
    </location>
  </locations>
</target>

We have several locations with just a single bundle, plus source. All those locations with 2 bundles cannot be expanded

Why do you expect them to be expanded? In your example you have chosen includeDependencyDepth="none" what means there can't be any child.

All those locations with 2 bundles cannot be expanded

If you like to see the bundles itself, you need to tick the "Show location contents" in the target.

Okay, I get the point about the bundles being shown only when using the checkbox. Agreed.

Still, not displaying the single dependency node doesn't make sense. The maven location does have that single child node. And it's surely not about includeDependencyDepth, that's the same for all entries visible in the screenshot. It's really just about the number. If I add the same dependency again, just with a different version number, the display changes to this:
grafik
Now I can see which dependencies are actually under that location. IMO that should also be possible if there is only a single dependency. Therefore the display of the original entry should be like this screenshot, minus the second child node.

Still, not displaying the single dependency node doesn't make sense.

There is no dependency node as you have disabled fetching dependencies and instead used a label for that, where normally the artifact (!) GAV would be displayed

If I add the same dependency again, just with a different version number

The display is different because you now have not a single artifact location but a composite one (where the individual items still don't show anything as child).