问题
I didn't understand how Tycho is bound to the Maven lifecyle as I did not see any pom.xml configuration which binds the Tycho goals.
My questions are:
How does Tycho hook into Maven's building reactor stage, i.e. when it prints below messages before reactor is computed?
[exec] [WARNING] No explicit target runtime environment configuration. Build is platform dependent.
How does Tycho bind its goals to Maven's build lifecycle? I see that there are goals executed during build which were not configured in the pom.xml:
[exec] [INFO] --- target-platform-configuration:0.21.0:target-platform (default-target-platform) @ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --- [exec] [INFO] [exec] [INFO] --- tycho-packaging-plugin:0.21.0:package-feature (default-package-feature) @ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ---
回答1:
Tycho is using Maven lifecycle hooks to do the dependency resolution before the actual reactor build starts. These lifecycle hooks are only available to Maven build extension and IIRC Tycho was one of the reasons they were introduced in Maven 3.0.
Tycho's implementation of the lifecycle hook is in the class TychoMavenLifecycleParticipant.
The goals that are being executed during the normal reactor build are selected via the packaging type. When you e.g. set the packaging eclipse-feature
in a project, a certain set of goals, defined by Tycho, is executed.
You can see the exact mapping of goals to Maven lifecycle phases is defined in this component.xml file in the Tycho sources.
来源:https://stackoverflow.com/questions/27013169/how-does-tycho-bind-its-goals-to-the-maven-lifecycle