Alex
Alex

Reputation: 2649

Tycho puts "p2" folder in the product with eclipse-repository and tycho-p2-director-plugin plugins

I changed my Tycho+Maven build (RCP application) to use Tycho 0.13 and eclipse-repository plus tycho-p2-director-plugin (instead of my old "eclipse-application" in Tycho 0.10). I managed to get the build working (producing the ZIP files), but they are 2 times bigger than they used to be. I see Tycho puts a lot of additional stuff my product does not need: 1) "p2" folder at the root level - 35 Mb. 2) a lot of useless plugins, like

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

how to configure "eclipse-repository" and "tycho-p2-director-plugin" to avoid this? At least to not put "p2" folder in the product. My software does not use "p2 update" mechanism for auto-updates.

Upvotes: 2

Views: 1756

Answers (3)

Alex
Alex

Reputation: 2649

I ended up removing "archive-products" completely - it's not flexible and requires a lot of horrible hacking with unpacking/repacking/renaming. I'm packing the ZIP files myself now:

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

Upvotes: 1

jsievers
jsievers

Reputation: 1853

your product may drag in transitive optional dependencies.

See [1] for how to avoid this.

The p2/ folder is always created but should not be 35MB. If you can provide a sample project to reproduce the problem, open a bug [2] and attach it along with steps how to reproduce.

[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

Upvotes: 1

Kane
Kane

Reputation: 8172

  1. "p2" folder, the folder is created by p2 itself when materializing the product. if your application doesn't support update itself, you can simply remove it from the built product.
  2. useless plugins. There is no way to remove them from your final materialized product, they are transitively required by your product. See this for detail.

Upvotes: 0

Related Questions