tycho: Bug 380152 - Support Maven option --also-make-dependents, and --resume-from
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=380152
The bug is still occurring. Due to an architectural change in Maven 3.2.1 in the Reactor, Tycho can no longer compute the dependencies if the input modules are filtered with options like -pl. Therefore, options like -am, -amd and -rf do not work.
See the original BugZilla issue for details and also see https://bugs.eclipse.org/bugs/show_bug.cgi?id=494760 which is likely caused by the same problem.
Pascal Rapicault CLA Friend 2012-05-21 10:29:58 EDT
Created attachment 215967 [details] Test projects
Running maven with -amd or -rf will cause the build to fail because of the artifacts that are normally part of a full reactor build can’t be found as they are not being built.
For example, in the following projects (see attachment)
- testA (bundle)
- testB (bundle, depends on A)
- testFeature (include testA and testB)
executing mvn clean install -amd -pl net.rapicault.demo:testB will fail with the following error message.
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:0.14.1:package-feature (default-package-feature) on project testFeature: Execution default-package-feature of goal org.eclipse.tycho:tycho-packaging-plugin:0.14.1:package-feature failed: net.rapicault.demo:testA:eclipse-plugin:1.0.0-SNAPSHOT does not provide an artifact with classifier ‘null’ -> [Help 1]
I tried various tricks like adding a p2 repository that would include the artifacts from a previous successful build but again, no luck here.
[tag] [reply] [−] Comment 1 Tobias Oberlies CLA Friend 2012-05-23 12:17:38 EDT
I wouldn’t consider this a bug - I don’t believe that Tycho was ever meant to work with this option. We can keep this bug as enhancement request though.
[tag] [reply] [−] Comment 2 Pascal Rapicault CLA Friend 2012-05-23 12:27:05 EDT
What about the -rf option?
[tag] [reply] [−] Comment 3 Tobias Oberlies CLA Friend 2012-05-29 03:06:53 EDT
I don’t know enough about these options to say if it would make sense to support these in Tycho.
Maven experts: What do you think?
[tag] [reply] [−] Comment 4 Tobias Oberlies CLA Friend 2012-10-04 13:14:37 EDT
This is what seems to happen in Maven: With --projects (and probably similarly with -rf), Maven scans all projects aggregated by the entry point POM, but then only executes the build for some of the projects.
In Tycho, this means the following:
- The dependency resolution is done for all projects because Tycho listens to the afterProjectsRead Maven event that is fired for all aggregated projects. This cannot be changed, because Tycho currently uses its dependency resolution to determine the build order.
- The dependency resolution result then contains references between reactor projects. Unlike with a full build, it is not guaranteed that upstream reactor artifacts have been built, leading to the described error.
To fix this, we’d need to recompute the target platform at the beginning of a module build (from a regular mojo) and either re-do dependency resolution or amend the previous dependency resolution result. All this is close to what needs to be done for bug 353889, so I don’t think that this will be implemented independently of that major restructuring.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 26 (25 by maintainers)
I believe the proper API for that is already available: https://maven.apache.org/ref/3.8.3/maven-core/apidocs/org/apache/maven/graph/GraphBuilder.html
It is possible to implement (or extend the org.apache.maven.graph.DefaultGraphBuilder) and tell maven to use that via a maven extension:
.mvn/extension.xml:
We have been looking into this already and I believe we have a PoC of this somewhere. I can see if we can dig that out.
Maybe it would be possible for Tycho to register such an extension by default and supply a custom
GraphBuilder.You probably could use the waiting time to prepare a patch for this 😃