我今天在工作中偶然发现了这个。
很抱歉恢复了这个,但也许这对某人有帮助。
它的工作方式是在我的产品文件中指定一个源特性,然后让 tycho 从现有特性生成源和源特性。
产品文件:
<feature id="com.some.feature" installMode="root"/>
<feature id="com.some.feature.source" installMode="root"/>
在我提供源代码的“API”包中,我在 pom.xml 中添加了这个:
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>doc</id>
<goals>
<goal>plugin-source</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
我创建了一个引用此捆绑包的功能项目。在这个项目的 pom.xml 中我添加了:
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-source-feature-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>doc</id>
<goals>
<goal>source-feature</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>attached-p2-metadata</id>
<phase>package</phase>
<goals>
<goal>p2-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
最后,在项目的父 POM 中我添加了:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>attached-p2-metadata</id>
<phase>package</phase>
<goals>
<goal>p2-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
产品编辑器本身包含一个错误标记,但可以忽略。
Tycho 自己构建产品,并且在运行的 Eclipse IDE 中自动设置源附件。