How does Tycho bind its goals to the Maven lifecycle

余生颓废 提交于 2020-01-06 19:30:24

问题


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:

  1. 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.

  2. 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!