1

Current situation: I am very new in developing on Eclipse Platform. I have old Eclipse RCP multi-module application (Java 6), I mavenized it (each module has its own pom.xml with dependencies) and I tried to integrate Maven Tycho (version 0.22.0) into it - main goal is to produce client distribution for windows platform (zip with exe file, eclipse plugins and features and some conf and init files).

I have problem (or I think that I have problem) with setup feature and target-platform. Feature has its own module with these files: pom.xml, feature.xml, Client.product, config.ini and build.properties.

Feature's pom.xml:

<parent>
   ...
</parent>

<groupId>myproject</groupId>
<artifactId>feature</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>

<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-maven-plugin</artifactId>
            <version>0.22.0</version>
            <extensions>true</extensions>
        </plugin>
    </plugins>
</build>

feature.xml contains version="1.0.0.qualifier and for example constains also includes and plugins like that:

   <includes
         id="org.eclipse.rcp"
         version="0.0.0"/>

   <plugin
         id="org.eclipse.equinox.preferences"
         download-size="0"
         install-size="0"
         version="0.0.0"
         unpack="false"/>

Question is how can I setup target-platform module with target-platform.target file to locate properly my plugins as JAR files?

target-platform's pom.xml:

    <parent>
       ...
    </parent>

    <groupId>myproject</groupId>
    <artifactId>target-platform</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>eclipse-target-definition</packaging>

    <build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-maven-plugin</artifactId>
                <version>0.22.0</version>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </build>

target-platform.target file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.6"?>
<target name="target-platform" sequenceNumber="9">
    <locations>
        <location path="v3_7_2/eclipse-platform" type="Directory"/>
    </locations>
    <environment>
        <os>win32</os>
        <ws>win32</ws>
        <nl>cs_CZ</nl>
    </environment>
    <targetJRE
            path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
    <launcherArgs>
        <vmArgs>-Xmx1024m</vmArgs>
        <programArgs>-consoleLog</programArgs>
    </launcherArgs>
</target>

target platform module, list of files

Pom files I created, other files were part of eclipse RCP project. When I call maven install a got this error:

...
[DEBUG] Using default execution environment 'JavaSE-1.6'
[DEBUG] Registered artifact repository org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey(uri=file:/resolution-context-artifacts@/tigra/cz.tigra.spl.client.feature)
[DEBUG] Added 0 locally built units to the target platform
[INFO] Resolving dependencies of MavenProject: cz.tigra.spl:cz.tigra.spl.client.feature:1.0.0-SNAPSHOT @ /tigra/cz.tigra.spl.client.feature/pom.xml
[DEBUG] No solution found because the problem is unsatisfiable.: [Unable to satisfy dependency from cz.tigra.spl.client.feature.feature.group 1.0.0.qualifier to org.eclipse.rcp.feature.group 0.0.0.; Unable to satisfy dependency from cz.tigra.spl.client.feature.feature.group 1.0.0.qualifier to org.eclipse.equinox.preferences 0.0.0.; 
etc....
...
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: cz.tigra.spl.client.feature.feature.group 1.0.0.qualifier
[ERROR]   Missing requirement: cz.tigra.spl.client.feature.feature.group 1.0.0.qualifier requires 'org.eclipse.rcp.feature.group 0.0.0' but it could not be found

I also read this article, which helps me to setup maven tycho - https://www.vogella.com/tutorials/EclipseTycho/article.html

BatmanGirl
  • 23
  • 5
  • Even if your plugins are written in Java 6, you should use the current Eclipse as platform for your RCP application. I doubt Tycho 2.2 will work with that old Eclipse. By the way, the screenshot looks like IntelliJ which does not provide support for Eclipse RCP. – howlger Apr 26 '21 at 13:20
  • I believe Tycho only supports software site ("InstallableUnit") entries in the target platform. The site for 3.7.2 would be `https://download.eclipse.org/eclipse/updates/3.7/R-3.7.2-201202080800/` – greg-449 Apr 26 '21 at 13:32
  • For many reasons we cannot migrate to newer Eclipse now (we cannot migrate to newer Java etc.). Is it problem, if I use IntelliJ? Because now I don't develope new java code, just creating maven tycho support for project... I don't like Eclipse IDE environment for work :-( – BatmanGirl Apr 26 '21 at 13:35
  • The screenshot shows a delta pack, which worked in PDE build, but Tycho requires a p2 repository to build a RCP application. The p2 repository can be created with Tycho in an additional step upfront, but there might be further problems preventing you from building the RCP application that is based on a nearly decade old Eclipse. Better spend your time solving the problems that prevents you to migrate to newer Java and Eclipse. IntelliJ does not understand p2 repositories to resolve dependencies, target definition files, etc. It's like using a text editor instead of a Java IDE to code Java. – howlger Apr 26 '21 at 14:21
  • @greg-449 installableUnit is supported from tycho version 0.23.0, I use 0.22.0 (see [eclipse wiki](https://wiki.eclipse.org/Tycho/Packaging_Types#p2-installable-unit)). I thought that if I have defined target platform, I can skip usage of p2 repository - am I wrong? – BatmanGirl Apr 27 '21 at 07:23
  • @BatmanGirl That link is a different thing. I am talking about the contents of the .target file which has to use `type="InstallableUnit"` not the `type="Directory"` you have. – greg-449 Apr 27 '21 at 07:27
  • @greg-449 `` gives the same mistake as above `[ERROR] Missing requirement: cz.tigra.spl.client.feature.feature.group 1.0.0.qualifier requires 'org.eclipse.rcp.feature.group 0.0.0' but it could not be found ` – BatmanGirl Apr 27 '21 at 07:59
  • My guess is that it is not even looking at the target , so something wrong with the POMs. I'm not enough of an expert in maven to help with that. – greg-449 Apr 27 '21 at 08:30

0 Answers0