Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-Maven locations cannot depend on Maven locations in PDE target definition #374

Open
sewe opened this issue Oct 13, 2021 · 7 comments
Open
Labels
pde-integration M2Eclipse PDE Integration upstream-pde

Comments

@sewe
Copy link
Contributor

sewe commented Oct 13, 2021

An Eclipse 2021-09 PDE with the latest m2e snapshot (1.18.2.20211011-2139) installed cannot resolve a target definition if a non-Maven location references a location of type Maven. Tycho 1.5.0, on the other hand, can resolve the following just fine:

<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
	<repository location="https://subclipse.github.io/updates/subclipse/4.2.0/"/>
	<unit id="org.tigris.subversion.subclipse.feature.group" version="0.0.0"/>
	<unit id="org.tigris.subversion.clientadapter.svnkit.feature.feature.group" version="0.0.0"/>
</location>
<location includeDependencyScope="compile" includeSource="true" missingManifest="generate" type="Maven">
	<groupId>org.tmatesoft.svnkit</groupId>
	<artifactId>svnkit</artifactId>
	<version>1.8.14</version>
	<type>jar</type>
	<instructions><![CDATA[
Bundle-Name:           Bundle derived from maven artifact ${mvnGroupId}:${mvnArtifactId}:${mvnVersion}
version:               ${version_cleanup;${mvnVersion}}
Bundle-SymbolicName:   ${mvnGroupId}
Bundle-Version:        ${version}
Import-Package:        *;resolution:=optional
Export-Package:        *;version="${version}";-noimport:=true
DynamicImport-Package: *
]]></instructions>
</location>

With PDE, this merely yields the following error:

Problems occurred while resolving the target contents
	Cannot complete the install because one or more required items could not be found.
		Missing requirement: SVNKit Client Adapter 1.8.12.1 (org.tigris.subversion.clientadapter.svnkit.feature.feature.group 1.8.12.1) requires 'org.eclipse.equinox.p2.iu; org.tmatesoft.svnkit [1.8.0,1.9.0)' but it could not be found
		Software being installed: SVNKit Client Adapter 1.8.12.1 (org.tigris.subversion.clientadapter.svnkit.feature.feature.group 1.8.12.1)

Should it be possible for a non-Maven location to depend on the OSGi bundles generated by a Maven location? Or is this not (yet 🙏) possible?

@laeubi
Copy link
Member

laeubi commented Oct 13, 2021

This is not possible due to current PDE design (this is not a limitation of the m2e target location but of PDE IUTargetlocation), Tycho behave a bit "non-standard" here.

@sewe
Copy link
Contributor Author

sewe commented Oct 13, 2021

I was afraid that this is the case. 😞

But thanks for confirming this so quickly.

@laeubi
Copy link
Member

laeubi commented Oct 13, 2021

Just for curiosity why do you require a maven artifact for something that seems also be available as an update-site? If it is feasible you can use the slicer mode instead of planer that allows to mix any combination of target type or fetch the artifact from the p2 site and include the maven one additionally (if you like to have just another version fro this specific artifact).

@laeubi
Copy link
Member

laeubi commented Oct 13, 2021

By the way: The same problem arises if one uses a directory location or alike, as the planner-mode only supports other IU-Locations. Technically I think it would be possible to enhance the IU location but this might require some discussions with the PDE team :-)

@sewe
Copy link
Contributor Author

sewe commented Oct 13, 2021

Just for curiosity why do you require a maven artifact for something that seems also be available as an update-site? If it is feasible you can use the slicer mode instead of planer that allows to mix any combination of target type or fetch the artifact from the p2 site and include the maven one additionally (if you like to have just another version fro this specific artifact).

Because the artifact available on the Subclipse p2 update site is broken: The use a wrong value for Bundle-RequiredExecutionEnvironment (JavaSE-1.5 rather than J2SE-1.5) and Tycho, honouring the OSGi spec, trips over it (eclipse-tycho/tycho#98).

Now, Subclipse merely redistributes SVNKit and SQLJet. But the upstream update site published by the SVNKit project (https://eclipse.svnkit.com/1.10.x/) still only includes a broken SQLJet 1.1.12 (https://eclipse.svnkit.com/1.10.x/plugins/org.tmatesoft.sqljet_1.1.12.r1336.jar). Moreover, the SVNKit project still publishes an old-style update site – which Tycho cannot consume. This is something that has been reported upstream (https://support.tmatesoft.com/t/no-repository-found-at-http-eclipse-svnkit-com-1-10-x/2388/6) but not acted upon. 😞

Also, I already reported the broken header upstream (https://support.tmatesoft.com/t/sqljet-bundle-requiredexecutionenvironment-header-violates-osgi-spec/2610) and, indeed, SQLJet 1.1.14 finally has correct Bundle-RequiredExecutionEnvironment header. But that is only available from Maven Central (https://search.maven.org/artifact/org.tmatesoft.sqljet/sqljet-osgi/1.1.14/jar), but AFAIK not a p2 update site. So we are again in the same situation.

I will give slice mode a try, I think, getting everything from p2 update sites except for the fixed SQLJet 1.1.14. Hopefully, that works. 🤞

@laeubi
Copy link
Member

laeubi commented Oct 13, 2021

What a mess, good luck :-D
Maybe it would work to exclude the offending item from the tycho target configuration and reinject the fixed one using the maven target option?

@sewe
Copy link
Contributor Author

sewe commented Oct 13, 2021

Maybe it would work to exclude the offending item from the tycho target configuration and reinject the fixed one using the maven target option?

Thank you for your suggestion; it brought me onto the right track. 😅

It is actually even simpler than what you suggested: I don't need to declare <filters> on my target-platform-configuration. All I need to do is offer Tycho a non-broken org.tmatesoft.sqljet bundle. Apparently, that is sufficient for it not to attempt to parse the broken manifest of the older version.

<location includeSource="true" missingManifest="error" type="Maven">
	<dependencies>
		<dependency>
			<groupId>org.tmatesoft.sqljet</groupId>
			<artifactId>sqljet-osgi</artifactId>
			<version>1.1.14</version>
			<type>jar</type>
		</dependency>
	</dependencies>
</location>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pde-integration M2Eclipse PDE Integration upstream-pde
Projects
None yet
Development

No branches or pull requests

4 participants