| Summary: | Optional dependencies in test runtime depends on reactor | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Tobias Oberlies <t-oberlies> | ||||
| Component: | Tycho | Assignee: | Igor Fedorenko <igor> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | igor, pwebster | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Tobias Oberlies
Created attachment 208909 [details]
Example project to reproduce the problem:
(In reply to comment #1) > Created attachment 208909 [details] > Example project to reproduce the problem: Steps to reproduce: 1. Build the whole reactor with mvn clean install 2. Re-build testbundle In the second step, org.eclipse.equinox.frameworkadmin, optionally required by the reactorbundl is part of the test runtime. As a user, I expect optionalDepencencies to apply to both calculation of compile classpath and test runtime contents by default. The same applies to other aspects of dependency resolution behaviour, like jre execution profile (bug 364095) and additional resolver filters and constrains (bug 363331). I plan to work on a more elaborate dependency filtering/constraining as part of bug 363331 and will likely cover the problem described in this bug report. This should be fixed now. I had to make some changes to the provided test project to make it compile and show the problem, see [1] for more details. The problem is not limited to TestMojo and can appear in any scenario where 'other' reactor projects with optional dependencies use OptionalResolutionAction.REQUIRE (the default). The solution is to calculate dependency-only metadata for 'this' and 'other' reactor projects differently (see [2], which is a variation of option b) proposed in comment #0. In the long term I would like to change target platform to include final metadata of 'other' reactor projects, but this requires changes to maven core and will have to wait. Also note that fix for bug 363331 changed test runtime calculation to use final metadata of 'other' reactor projects. The test runtime includes optional dependencies of 'this' reactor project by default. I've opened bug 370290 to track this, but do not plan to work on the fix because this can be easily worked around by explicit optionalDependencies=ignore dependency resolution configuration. [1] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=0f68973a0bfcff92cac199eb58defdfe1c69cfa1 [2] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=9d71c422fb004896bbc8b81963393e7ede88b5cc |