| Summary: | Optional dependencies broken in recent Tycho build | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Markus Kuppe <bugs.eclipse.org> |
| Component: | Tycho | Assignee: | Project Inbox <tycho-inbox> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | igor, kai |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Markus Kuppe
Can you confirm the problem was not present at https://github.com/sonatype/sonatype-tycho/commit/4393caf41c9e1968d2711b97fda4cdea021814d2 ? In case, jars.extra.classpath can be used to force compile-only dependencies. (In reply to comment #1) > Can you confirm the problem was not present at > https://github.com/sonatype/sonatype-tycho/commit/4393caf41c9e1968d2711b97fda4cdea021814d2 > ? I will check, but it will take a while. > In case, jars.extra.classpath can be used to force compile-only dependencies. In pom.xml? (In reply to comment #2) > > > In case, jars.extra.classpath can be used to force compile-only dependencies. > > In pom.xml? No, in build.properties http://help.eclipse.org/indigo/topic/org.eclipse.pde.doc.user/reference/pde_feature_generating_build.htm > > Can you confirm the problem was not present at > > https://github.com/sonatype/sonatype-tycho/commit/4393caf41c9e1968d2711b97fda4cdea021814d2 > > ? I can confirm, my build was still working with the 0.13.0-SNAPSHOT from August 25. The problem seems to be that Equinox p2 Juno treats optional dependencies non-greedy now, on indigo it was by default a greedy behaviour (see bug 247099). Unfortunately, this change now also impacts the scope during compile time, which was most likely not intended. I have created a very simple project to easily reproduce the problem: https://github.com/openhab/tycho-testing Note that you can work around it by defining the optional dependency as greedy. This is done by specifying "resolution:=optional;x-installation:=greedy" in the manifest for the dependency in question. Hope this helps! Kai (In reply to comment #4) > The problem seems to be that Equinox p2 Juno treats optional dependencies > non-greedy now, on indigo it was by default a greedy behaviour (see bug 247099). > Unfortunately, this change now also impacts the scope during compile time, which > was most likely not intended. This is correct. Greedy should only affect installation, but not compilation. Unfortunately this is an open issue in Tycho: bug 351842. > Note that you can work around it by defining the optional dependency as greedy. > This is done by specifying "resolution:=optional;x-installation:=greedy" in the > manifest for the dependency in question. This is a very bad idea, because this has an impact on your users: if the optionally required bundle is common (e.g. part of Indigo), it will be installed whenever your users install your bundle. If it is however truely optional, you should give your users the choice to install it by creating two features: one with just your bundle(s) and one with your bundles and requirements to the optional stuff. *** This bug has been marked as a duplicate of bug 351842 *** |