[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] How to bundle JRE with a product?

Hi,

I am using root files to achieve this. In the feature project I put the JRE in rootfiles/win32/jre using maven-dependency-plugin. I zipped it up and deployed it to the maven repository, then you can use the following to copy it in at build time:

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>copy-library</id>
            <goals>
              <goal>unpack</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <outputDirectory>rootfiles/win32/jre</outputDirectory>
          <artifactItems>
            <artifactItem>
              <groupId>com.oracle</groupId>
              <artifactId>jre-win32</artifactId>
              <version>1.3.0.33</version>
              <type>zip</type>
            </artifactItem>
          </artifactItems>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.4.1</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>rootfiles/win32/jre</directory>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
    </plugins>
  </build>

Then in the build.properties add the following line:

root.win32.win32.x86 = rootfiles/win32

And that should be it - the only problem is with the way P2 director works, it also copies a zip file of the JRE in p2/org.eclipse.equinox.p2.core/cache/binary which means your installation has the JRE twice which adds to the download size.

I have logged the following enhancement request to filter this out: https://bugs.eclipse.org/bugs/show_bug.cgi?id=385456
But I have a workaround in the meantime - let me know if you want more details of the workaround.

David

-----Original Message-----
From: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-bounces@xxxxxxxxxxx] On Behalf Of Simon Goodall
Sent: Wednesday, 1 August 2012 12:35 AM
To: Tycho user list
Subject: Re: [tycho-user] How to bundle JRE with a product?

Hi Klaus,

There are two ways to handle this with Tycho.  The first way is to use root files - although there are problems using this approach if you want to upgrade the jre on window platforms - see [1].
The alternative is to bundle it with a feature (include the jre folder in build.properties) and use the p2 setJvm touchpoint instruction.
Place something similar to the following in the features' p2.inf file (also p2.inf in build.properties)

instructions.configure=\
org.eclipse.equinox.p2.touchpoint.eclipse.setJvm(jvm:features/feature-name_1.0.0/jre/bin);
instructions.unconfigure=\
org.eclipse.equinox.p2.touchpoint.eclipse.setJvm(jvm:null);

This will add the -jvm arg to the generated eclipse.ini (or equivalent). Remember to set the correct platform filters!

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

Simon

On 31 July 2012 14:53, Kopecz, Klaus <klaus.kopecz@xxxxxxx> wrote:
> I would like to bundle the JRE with a product built by tycho-p2-director-plugin's materialize-product goal.
> The PDE product configuration editor offers the flag "Bundle JRE for this environment with the product" which results in a "jre" folder in the PDE product build result. When building the same product with tycho, the jre folder is missing. Is this not supported by tycho or do I need configure additional dependencies?
> Thanks,
> _______________________________________________
> tycho-user mailing list
> tycho-user@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user