eclipse-m2e/m2e-core

Target platform resolution fails with certain Maven artifacts

Opened this issue · 5 comments

An error occurs in the latest version of the m2e PDE integration when resolving the following target platform file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="maven">
	<locations>
		<location includeDependencyDepth="infinite" includeDependencyScopes="compile" missingManifest="generate" type="Maven">
			<dependencies>
				<dependency>
					<groupId>commons-io</groupId>
					<artifactId>commons-io</artifactId>
					<version>2.15.1</version>
					<type>jar</type>
				</dependency>
			</dependencies>
		</location>
		<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
			<repository location="https://download.eclipse.org/eclipse/updates/4.30/"/>
			<unit id="org.eclipse.jdt.feature.group" version="3.19.300.v20231201-0110"/>
		</location>
	</locations>
</target>
Problems occurred while resolving the target contents
	An error occurred while collecting items to be installed
		No repository found containing: osgi.bundle,org.apache.commons.commons-io,2.15.1
		session context was:(profile=TARGET_DEFINITION:resource:/my-tp/maven.target, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).

This looks like a regression from previous version. This error does not occur with Tycho 4.0.4.

There is similar complain from @rgrunber at eclipse-jdtls/eclipse.jdt.ls#2998 which I can't reproduce.
@laeubi Any idea what could be going wrong?

laeubi commented

This looks like a regression from previous version.

Can you try to replicate the behavior with:

https://github.com/eclipse-m2e/m2e-core/tree/master/org.eclipse.m2e.pde.target.tests/src/org/eclipse/m2e/pde/target/tests

this are the ones we also share with Tycho to ensure m2e and Tycho work (mostly) the same.

laeubi commented

There is similar complain from @rgrunber at eclipse-jdtls/eclipse.jdt.ls#2998 which I can't reproduce.

Also please note that MIXING maven targets + and site targets where one shadow the other might suffer from this bug recently fixed in PDE:

I can confirm it as a duplicate of eclipse-pde/eclipse.pde#874
(Romain & I work together on the same project)

The target platform that fails has:

  • org.apache.commons.commons-io P2 plugin

  • commons-io:commons-io maven plugin shadowed

  • org.jdom2 P2 plugin

  • org.jdom:jdom2 maven plugin shadowed

I've opened it with a snaphot IDE from https://download.eclipse.org/eclipse/downloads/drops4/I20231218-1800/ and, after adding the m2e integration, the target platform is correctly resolved. So it should be fixed in 2024-03.

Meantime, as a workaround, commenting the maven plugin out from the target platform also works, since only the P2 plugins are left then.

ah so this is a problem because of the target platform through the sites already includes this?
because i also now have it for slf4j-api
(besides the commons-io described above)

But i guess i can just remove them from the current mvn target because they should come from the other eclipse "normal" p2 sites i guess

By the way this is for me just a target file editor problem, tycho works fine with it and the stupid thing is if i quickly change it through the mvn editor of the target file so commons io back to 2.15.0 and then quickly back to 2.15.1 i can use the target..