tycho
tycho copied to clipboard
[WARNING] Mirror tool: Problems resolving provisioning plan
Hi,
I have a small PDE based project with a Tycho build that should show how to publish an OSGi service via JAX-RS Whiteboard (Aries implementation). As the Aries implementation is only available via Maven and not via a p2 update site, I use the Maven locations in the target definition. Inside the IDE everything works as expected, the target definition resolves, the product definition is correctly setup, validates and I can start the product inside the IDE.
But the build using pom-less Tycho fails. I get the following warning:
[WARNING] Mirror tool: Problems resolving provisioning plan.: [Unable to satisfy dependency from org.fipro.modifier.jaxrs.product 1.0.0.202206200943 to org.eclipse.
equinox.p2.iu; org.osgi.service.jaxrs [1.0.0.201802012106,1.0.0.201802012106].; Unable to satisfy dependency from org.fipro.modifier.jaxrs.product 1.0.0.20220620094
3 to org.eclipse.equinox.p2.iu; org.apache.aries.jax.rs.whiteboard [1.0.1,1.0.1].; Unable to satisfy dependency from toolingwin32.win32.x86_64org.apache.aries.jax.r
s.whiteboard 1.0.0.202206200943 to osgi.bundle; org.apache.aries.jax.rs.whiteboard 1.0.1.; Unable to satisfy dependency from toolingwin32.win32.x86_64org.apache.ari
es.jax.rs.whiteboard 1.0.0.202206200943 to osgi.bundle; org.apache.aries.jax.rs.whiteboard 1.0.1.]
then the build fails with this message:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-director-plugin:2.7.3:materialize-products (materialize-products) on project org.fipro.modifier.jaxrs.prod
uct: Installation of product org.fipro.modifier.jaxrs.product for environment win32/win32/x86_64 failed: Call to p2 director application failed with exit code 13.
The explanation in the wiki talks about feature patches, but the example is a plug-in based product without features. So I am not sure what causes the issue and how it could be solved.
I have the minimal example attached to reproduce the issue.
The explanation in the wiki talks about feature patches, but the example is a plug-in based product without features. So I am not sure what causes the issue and how it could be solved.
Yep this warning is quite annoying and confusing, sometimes it cause issues, sometimes not. I'll take a look at it, can you tell if the issue also arise with 3.x snapshot?
I haven't tried with the 3.x SNAPSHOT. Is there an explanation how to do this quickly?
See try out the current tycho snapshot build. Snapshot generally also include newer eclipse releases so we can easier see if there is a bug maybe fixed by P2 already.
Ah, I remember and had it prepared already from previous reports.
The same issue occurs with 3.0.0-SNAPSHOT
Okay thanks, I'll try to take a look at it.
@fipro78 it seems your example is missing some files:
[FATAL] Non-resolvable parent POM for org.fipro.modifier:org.fipro.modifier.jaxrs.product:1.0.0-SNAPSHOT: Could not find artifact org.fipro.service:org.fipro.service.parent:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 7, column 10
I also added a .mvn
folder with the tycho-build extension.
Maybe you can transform your example into an integration-test to demonstrate the issue?
@laeubi sorry, this is an export issue on my side. I have updated the example with the corresponding .mvn folder and the parent pom.xml
I will try to create an integration test based on this. Will see how far I can get here. But to show the error fast, I attached the complete example now.
Just some observations:
The org.osgi.service.jaxrs
has Bundle-Version: 1.0.0.201802012106
, and mirror app complains about not finding
requires 'org.eclipse.equinox.p2.iu; org.osgi.service.jaxrs [1.0.0.201802012106,1.0.0.201802012106]'
but the artifact itself has a maven version of 1.0.0
so maybe either Tycho or the MirrorApp is confused.
Another one might be that the product is based on plugins and most (if not all) our tests using feature based products, so again here, either Tycho or MirrorApp might not handle plugin based products well.
Another possible issue is that we do not make the maven items correctly available to the mirrorapp... sadly the mirror app uses some strange handling of the artifacts.
Yes, the Bundle-Version and the Maven artifact version differ in the detail that the qualifier part is missing in the Maven artifact version. IIRC for publishing to Maven Central the .qualifier should be removed as this is an information that Maven does not use. Should Tycho in such a case not also avoid inspecting the qualifier information? Or at least have a fallback to search for the version without qualifier if the artifact with qualifier in the version is not found.
I think plugin based products are totally valid, especially if you want to extract a small dedicated set of plugins to create a service runtime with plain OSGi instead of the Eclipse feature based thing. In that case the integration test will be even more helpful as it would cover an additional aspect.
Yes tycho should work with this, and yes tycho should support plugin based products, I just think these aspects are (not yet) very well covered :-)
I have created https://github.com/eclipse/tycho/pull/1085 and hope that it works. I struggled the whole day with the setup. I followed the contribution documentation, but the Import as well as the Update of the project leads to endless loops and strange errors in the IDE I don't get fully. The project itself can be build in the project folder and shows the described error. If the integration in the test suite works I can't tell unfortunately.
If it doesn't work give me a hint and I will try to fix it. Not sure what the issue is with the project setup on my side.
@laeubi Any update on this? The test case is provided and actually fails as it shows the bug. :)
On setting up another project I ran into the same issue and remembered that I already reported this.
@fipro78 sorry I was not yet able to look into this yet :-\
I played around a bit with the example and it seems there is a specific problem with this artifact other maven items works fine and one can reproduce it with this simplified product:
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
<product uid="tycho-its-project.issue1052.jaxrs.product" version="1.0.0.qualifier" useFeatures="false" includeLaunchers="true" autoIncludeRequirements="false">
<plugins>
<plugin id="org.osgi.service.jaxrs"/>
</plugins>
</product>
Funny enough tycho seems to be able to resolve the version in the product processing part, so I fear this has to do with the "maven repository blackboard key" somehow (what remembers me we should really get rid of it) @mickaelistria are you aware of some code in that area that might have a problem with the fact that the maven-version=1.0.0
but the bundles OSGi-version=1.0.0.201802012106
@fipro78 can you try reducing your example even more? As mentioned above the product can be simplified and the api+impl bundles are not required to reproduce the problem, you can even remove InstallableUnit
location from target, and probably one can even then just add
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.jaxrs</artifactId>
<version>1.0.1</version>
</dependency>
including the compile and runtime dependencies so we get a much smaller reproducer.
@mickaelistria I think this is also a good example for what we need to solve when we want to allow Manifest Version != pom.xml version story.
are you aware of some code in that area that might have a problem with the fact that the maven-version=1.0.0 but the bundles OSGi-version=1.0.0.201802012106
I don't remember sorry. I'd need to investigate that and I'm currently more focused on other bits of code. A very minimal reproducer would be welcome, if I find some time to dedicate to this issue.
I finally found the problem is in
org.eclipse.tycho.p2.util.resolution.ProjectorResolutionStrategy.resolve(Map<String, String>, IProgressMonitor)
where in this example there are some warnings:
WARNING: Unable to satisfy dependency from org.osgi.service.jaxrs 1.0.1.202109301733 to java.package; javax.ws.rs.client 0.0.0.
WARNING: Unable to satisfy dependency from org.osgi.service.jaxrs 1.0.1.202109301733 to java.package; javax.ws.rs.core 0.0.0.
WARNING: Unable to satisfy dependency from org.osgi.service.jaxrs 1.0.1.202109301733 to java.package; javax.ws.rs.sse 0.0.0.
WARNING: Unable to satisfy dependency from org.osgi.service.jaxrs 1.0.1.202109301733 to java.package; org.osgi.dto [1.0.0,2.0.0).
WARNING: Unable to satisfy dependency from org.osgi.service.jaxrs 1.0.1.202109301733 to java.package; org.osgi.framework.dto [1.8.0,2.0.0).
WARNING: Unable to satisfy dependency from org.osgi.service.jaxrs 1.0.1.202109301733 to osgi.contract; (&(osgi.contract=JavaJAXRS)(version=2.1.0)).
I have not find out yet why these are only warnings, but this results in the repository missing the org.osgi.service.jaxrs
then you get a warning again in the assemble repository step:
[INFO] --- tycho-p2-repository-plugin:3.1.0-SNAPSHOT:assemble-repository (default-assemble-repository) @ tycho-its-project.issue1052.jaxrs.product ---
[WARNING] Mirror tool: Problems resolving provisioning plan.: [Unable to satisfy dependency from tycho-its-project.issue1052.jaxrs.product 1.0.0.202209250747 to org.eclipse.equinox.p2.iu; org.osgi.service.jaxrs [1.0.1.202109301733,1.0.1.202109301733].]
[WARNING] More information on the preceding warning(s) can be found here:
[WARNING] - https://wiki.eclipse.org/Tycho_Messages_Explained#Mirror_tool
and finally
[INFO] Installing product tycho-its-project.issue1052.jaxrs.product for environment win32/win32/x86_64 to ....
Installation failed.
Cannot complete the install because one or more required items could not be found.
Software being installed: tycho-its-project.issue1052.jaxrs.product 1.0.0.202209250747 (tycho-its-project.issue1052.jaxrs.product 1.0.0.202209250747)
Missing requirement: tycho-its-project.issue1052.jaxrs.product 1.0.0.202209250747 (tycho-its-project.issue1052.jaxrs.product 1.0.0.202209250747) requires 'org.eclipse.equinox.p2.iu; org.osgi.service.jaxrs [1.0.1.202109301733,1.0.1.202109301733]' but it could not be found
At first one might argue to simply treat warnings as error... but it is unclear if there are maybe warnings that can be ignored ... so this seems a very dangerous change. Beside that, the real limitation is the Mirror/DirectorApplication itself as we require here to do some hacks to pass the content to it for install that could better reuse the full target itself.
The relevant Method here is RepositoryReferenceTool#getVisibleRepositories
that is used in
- DirectorMojo
- MirrorMojo
- AssembleRepositoryMojo
In my case, I have a project of type eclipse-repository with a category.xml file to generate an update site with our product's features and plugins. The message looks like this for me:
[INFO] --- tycho-p2-repository-plugin:3.0.0:assemble-repository (default-assemble-repository) @ eclipse-update-site ---
[WARNING] Mirror tool: Problems resolving provisioning plan.: [Unable to satisfy dependency from 202210251612.Default 1.0.0.7L1-cM8lk677377537C5C5G to org.eclipse.equinox.p2.iu; com.example.mine.feature.feature.group [11.1.0.202210251517,11.1.0.202210251517].]
[WARNING] More information on the preceding warning(s) can be found here:
[WARNING] - https://wiki.eclipse.org/Tycho_Messages_Explained#Mirror_tool
I'm not sure where that 202210251612.Default 1.0.0.7L1-cM8lk677377537C5C5G
came from, and com.example.mine.feature
is the only feature in the category.xml file.
The category.xml file was made using the category editor in Eclipse which doesn't complain about anything.
I would consider this message an error because the update site is missing the feature now.
in lsp4j we see this with a plugin in category.xml
[WARNING] Mirror tool: Problems resolving provisioning plan.: [Unable to satisfy dependency from v20230223-0614.Default 1.0.0.7N7w5cKWk3-E_EkMgwQkR6AVY-H to org.eclipse.equinox.p2.iu; com.google.gson [2.10.1,2.10.1].]
[WARNING] More information on the preceding warning(s) can be found here:
[WARNING] - https://wiki.eclipse.org/Tycho_Messages_Explained#Mirror_tool
the category.xml has
<bundle id="com.google.gson" version="2.10.1.qualifier"/>
<bundle id="com.google.gson.source" version="2.10.1.qualifier"/>
and the feature.xml we also package
<requires>
<import plugin="com.google.gson" version="2.10.1" match="equivalent"/>
@fipro78 This is caused by missing requirements in the target, but Tycho does not correctly fails the resolve see:
- https://github.com/eclipse-tycho/tycho/pull/3393
@cdietrich @kjsmita6 the issue you describing is most likely fixed by:
- https://github.com/eclipse-tycho/tycho/pull/3389