【问题标题】:Is it possible to have the materialize-products goal of tycho-p2-director-plugin include source features?tycho-p2-director-plugin 的 materialize-products 目标是否可以包含源特性?
【发布时间】:2018-08-14 23:56:45
【问题描述】:

我正在使用 tycho-source-plugin 和 tycho-source-feature-plugin 来生成插件源 jar 和源特性。

我正在生成一个使用 tycho-p2-repository-plugin 的 p2 存储库和一个使用 tycho-p2-director-plugin 的产品。

对于 p2 存储库,我可以通过添加 category.xml 并将“.source”附加到所有功能的 id 来包含源 jar。

对于该产品,我找不到任何文档或示例来说明如何将源 jar 包含在具体化产品或产品存档中。

有可能吗?

【问题讨论】:

    标签: eclipse eclipse-rcp rcp tycho


    【解决方案1】:

    我今天在工作中偶然发现了这个。 很抱歉恢复了这个,但也许这对某人有帮助。

    它的工作方式是在我的产品文件中指定一个源特性,然后让 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 中自动设置源附件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-24
      • 2019-01-06
      • 1970-01-01
      • 2019-01-02
      • 2011-03-08
      • 1970-01-01
      相关资源
      最近更新 更多