1

我更改了我的 Tycho+Maven 构建(RCP 应用程序)以使用 Tycho 0.13 和 eclipse-repository 加上 tycho-p2-director-plugin(而不是我在 Tycho 0.10 中的旧“eclipse-application”)。我设法让构建工作(生成 ZIP 文件),但它们比以前大 2 倍。我看到第谷放了很多我的产品不需要的额外东西:1)根级别的“p2”文件夹 - 35 Mb。2)很多无用的插件,比如

plugins/org.eclipse.jdt.debug_3.6.1.v20100715_r361
plugins/org.eclipse.pde.build_3.6.2.R36x_20110203
plugins/org.junit_4.8.1.v4_8_1_v20100427-1100
......etc.........

如何配置“eclipse-repository”和“tycho-p2-director-plugin”来避免这种情况?至少不要将“p2”文件夹放在产品中。我的软件不使用“p2 更新”机制进行自动更新。

4

3 回答 3

1

您的产品可能会引入可传递的可选依赖项。

有关如何避免这种情况,请参阅 [1]。

始终创建 p2/ 文件夹,但不应为 35MB。如果您可以提供一个示例项目来重现该问题,请打开一个错误 [2] 并将其与如何重现的步骤一起附加。

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=342704

[2] https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Tycho&rep_platform=All&op_sys=All

于 2011-12-21T19:45:08.133 回答
1

我最终完全删除了“存档产品”——它不灵活,需要通过解包/重新打包/重命名进行大量可怕的黑客攻击。我现在自己打包 ZIP 文件:

<properties>
   <distributive.prefix>${project.build.directory}/products/taskadapter</distributive.prefix>
   <exclude_p2>**/p2/**</exclude_p2>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-p2-director-plugin</artifactId>
            <version>${tycho.version}</version>
            <executions>
                <execution>
                    <id>materialize-products</id>
                    <goals>
                        <goal>materialize-products</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.7</version>
            <executions>
                <execution>
                    <id>create-zip-files</id>
                    <phase>package</phase>
                    <configuration>
                        <target> 
                            <zip basedir="${distributive.prefix}/win32/win32/x86" 
                                 destfile="${project.build.directory}/taskadapter-win-${project.version}.zip"
                                 excludes="${exclude_p2}" />
                            <zip basedir="${distributive.prefix}/linux/gtk/x86" 
                                 destfile="${project.build.directory}/taskadapter-linuxgtk-${project.version}.zip"
                                 excludes="${exclude_p2}" />
                            <zip basedir="${distributive.prefix}/macosx/cocoa/x86" 
                                 destfile="${project.build.directory}/taskadapter-macos-${project.version}.zip"
                                 excludes="${exclude_p2}" />
                        </target>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
于 2011-12-23T00:42:13.997 回答
0
  1. “p2”文件夹,该文件夹是p2在物化产品时自己创建的。如果您的应用程序本身不支持更新,您可以简单地将其从构建的产品中删除。
  2. 无用的插件。没有办法从您的最终物化产品中删除它们,它们是您的产品传递性需要的。有关详细信息,请参阅
于 2011-12-21T02:36:47.513 回答