Installing eclipse plug-in built by Tycho - eclipse

I want to install eclipse plug-in that was build with help of Tycho.
When I call mvn clean install Maven exits with SUCCESS, and in target directory there is .jar file.
I can't make Eclipse to work with this .jar, it says that file could not be found.
Am I missing something here? How to use my tycho built plug-in?
Here is my pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.my.example</groupId>
<artifactId>com.my.example.ExampleProject</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<repositories>
<repository>
<id>eclipse-luna</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/luna</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>0.22.0</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>0.22.0</version>
<configuration>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>

Related

maven cannot find javafx 11 when compiling an eclipse application

I have an eclipse application using javafx 11. For lack of better solution, I have javafx installed in /opt/javafx-sdk-11.0.2, the product definition contains --module-path /opt/javafx-sdk-11.0.2/lib/ --add-modules=javafx.controls as vm arguments, and .classpath contains these lines:
<classpathentry kind="lib" path="/opt/javafx-sdk-11.0.2/lib/javafx.base.jar"/>
<classpathentry kind="lib" path="/opt/javafx-sdk-11.0.2/lib/javafx.controls.jar"/>
<classpathentry kind="lib" path="/opt/javafx-sdk-11.0.2/lib/javafx.graphics.jar"/>
My pom.xml looks like this:
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.rulez.magwas</groupId>
<artifactId>zenta3</artifactId>
<version>3.0.0-SNAPSHOT</version>
</parent>
<groupId>zenta3-editor</groupId>
<artifactId>org.rulez.demokracia.zenta3.editor</artifactId>
<packaging>eclipse-plugin</packaging>
<build>
<plugins>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.1</version>
<configuration>
<mainClass>org.openjfx.App</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>${jdk.version}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>ZentaApplication</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11.0.2</version>
</dependency>
</dependencies>
</project>
The parent pom contains the properties, repos, and the following tycho build plugin configurations:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<archive>
<manifestEntries>
<Bundle-RequiredExecutionEnvironment>${jdk.full.version}</Bundle-RequiredExecutionEnvironment>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<executionEnvironment>${jdk.full.version}</executionEnvironment>
<dependency-resolution>
<extraRequirements>
<requirement>
<type>eclipse-plugin</type>
<id>org.eclipse.osgi.compatibility.state</id>
<versionRange>0.0.0</versionRange>
</requirement>
</extraRequirements>
</dependency-resolution>
<environments>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
jdk.version is 11, but tried it with 10 as well.
The weird thing about it that I remember I could compile it with maven, but cannot get it to compile now.
The error:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.4.0:compile (default-compile) on project org.rulez.demokracia.zenta3.editor: Compilation failure: Compilation failure:
[ERROR] /project/mag/Zenta/zenta3/ui/src/main/java/org/rulez/demokracia/zenta3/editor/parts/handles/DeleteElementHandlePart.java:
[ERROR] package org.rulez.demokracia.zenta3.editor.parts.handles;
[ERROR] ^
[ERROR] The type javafx.scene.paint.Color cannot be resolved. It is indirectly referenced from required .class files
[ERROR] /project/mag/Zenta/zenta3/ui/src/main/java/org/rulez/demokracia/zenta3/editor/parts/handles/DeleteElementHandlePart.java:[17]
[ERROR] public class DeleteElementHandlePart extends AbstractHandlePart<Group> {
[ERROR] ^^^^^
[ERROR] Group cannot be resolved to a type
[ERROR] 2 problems (2 errors)
Putting all the jars of javafx to the lib folder of the project, and listing them in classpath helped. But it seems more like a workaround than a solution, and I cannot figure out how to set the launch configuration of the product to be able actually launch it.

How to build a multiplatform Eclipse update site with Tycho

On my PDE/Tycho Eclipse environment I want to build a plugin of type eclipse-repository which contains 3 features each one for a specific platform.
The eclipse-repository plugin reads all its configuration from a parent plugin which content is the following:
<properties>
<tycho.version>0.26.0</tycho.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>neon</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/neon/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>
When I try to build the eclpse-repository project I get an error:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-repository-plugin:0.26.0:assemble-repository (default-assemble-repository) on project ... : Execution default-assemble-repository of goal org.eclipse.tycho:tycho-p2-repository-plugin:0.26.0:assemble-repository failed: Cannot resolve dependencies of MavenProject ...

Unresolveable build extension: Tycho cannot resolve dependency to bundle although present in the target file

Unresolveable build extension: Plugin org.eclipse.tycho:tycho-maven-plugin:0.26.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.tycho:tycho-maven-plugin:jar:0.26.0
below is my pom.xml file
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
com.in2soft.otx.checker
com.kpit.otx.checker.build
1.0.0-SNAPSHOT
<properties>
<tycho-version>0.26.0</tycho-version>
</properties>
<repositories>
<repository>
<id>Mars</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/mars</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<configuration>
<pomDependencies>consider</pomDependencies>
</configuration>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<environments>
<environment>
<os>${os}</os>
<ws>${ws}</ws>
<arch>${arch}</arch>
</environment>
</environments>
<target>
<artifact>
<groupId>com.in2soft.otx.checker</groupId>
<artifactId>rcp</artifactId>
<version>1.0.0-SNAPSHOT</version>
<classifier>rcp</classifier>
</artifact>
</target>
</configuration>
</plugin>
</plugins>
</build>

why plugin built via Tycho working with JDT but not CDT

I am so frustrated when trying to find out the reason why the Eclipse plugin I built via Tycho is not working in CDT, but working in JDT.
The parent pom.xml looks like the following:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.company.eclipse.plugin</groupId>
<artifactId>abc-master</artifactId>
<version>1.0.0</version>
<name>abc Master</name>
<packaging>pom</packaging>
<modules>
<module>../abc</module>
</modules>
<properties>
<tycho.version>0.20.0</tycho.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<kepler-repo.url>http://download.eclipse.org/releases/kepler</kepler-repo.url>
</properties>
<repositories>
<repository>
<id>kepler</id>
<url>${kepler-repo.url}</url>
<layout>p2</layout>
</repository>
<repository>
<id>cdt</id>
<url>http://download.eclipse.org/tools/cdt/releases/kepler</url>
<layout>p2</layout>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<resolver>p2</resolver>
<pomDependencies>consider</pomDependencies>
<environments>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>p2-composite</outputDirectory>
<resources>
<resource>
<directory>p2-composite-template</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
And the pom for abc plugin looke like the following
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<relativePath>../abc-master/pom.xml</relativePath>
<groupId>com.company.eclipse.plugin</groupId>
<artifactId>abc-master</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>com.company.eclipse.plugin.abc</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
Any help is most appreciated.
thanks a lot for helping me. I suspect it is due to the Eclipse for C/C++ is somehow corrupted. So I download a new CDT, and copy the files from the new CDT to old CDT folder by folder, and try start the old CDT to see if the plugin works. After I replaced the "configuration" folder using new downloaded copy, the plugin works. So means something in the configuration folder in the old CDT prevent the plugin from starting. Unfortunately I forgot to backup the old CDT, so now I am not able to re-product the issue to investigate what is wrong in configuration folder.
Closed as cannot reproduce

Why is update repo URL not configured on cross platform Tycho build for Windows artifact?

I have a cross-platform Tycho build running on Mac OS X that produces Windows, Mac and a p2 repo outputs.
Generally all is fine except that the Windows RCP does NOT get configured with the update repo URL details from my p2.inf addRepository instructions (and so p2 update fails) - it DOES for the Mac OS X app... which seems suspicious... why one and not the other?!
Is this a Tycho bug anyone might've come across? (I'm currently using Tycho 0.13.0, nervous about switching versions..) Or do I need explicit instructions for this to get applied to the Windows build?
It'll probably help to include some POMs here...
Here's the POM from the product project:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>com.myapp.main.product</artifactId>
<packaging>eclipse-repository</packaging>
<name>my product</name>
<parent>
<groupId>com.myapp</groupId>
<artifactId>parent</artifactId>
<version>1.9.0-SNAPSHOT</version>
<relativePath>../com.myapp.parent</relativePath>
</parent>
<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>
<execution>
<id>archive-products</id>
<goals>
<goal>archive-products</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- SEE: http://dev.eclipse.org/mhonarc/lists/tycho-user/msg00362.html
SEE: https://issues.sonatype.org/browse/TYCHO-300 -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/products/com.myapp.main.product/icons</outputDirectory>
<resources>
<resource>
<directory>icons</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<version>1.9.0-SNAPSHOT</version>
</project>
And the parent POM:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.myapp</groupId>
<artifactId>parent</artifactId>
<version>1.9.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>../com.myapp.doc</module>
<module>../com.myapp.lots.of.plugins</module>
<module>../com.myapp.main</module>
<module>../com.myapp.main.nl</module>
<module>../com.myapp.branding</module>
<module>../com.myapp.branding.nl</module>
<module>../com.myapp.feature.platform</module>
<module>../com.myapp.feature.core</module>
<module>../com.myapp.main.product</module>
</modules>
<properties>
<tycho-version>0.13.0</tycho-version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<resolver>p2</resolver>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86</arch>
</environment>
<environment>
<os>macosx</os>
<ws>carbon</ws>
<arch>x86</arch>
</environment>
<!-- 64 bit platforms
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
-->
<environment>
<os>macosx</os>
<ws>cocoa</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<!-- MacOS specific vm arguments for UI testing -->
<profile>
<id>osx</id>
<activation>
<property>
<name>java.vendor.url</name>
<value>http://www.apple.com/</value>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<appArgLine>-XstartOnFirstThread</appArgLine>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
<profile>
<id>coverage</id>
<activation>
<property>
<name>coverage</name>
</property>
</activation>
<properties>
<emma.session.out.file>${project.build.directory}/emma/${project.artifactId}.es</emma.session.out.file>
<emma.filter>com.myapp.*</emma.filter>
<eclemma.instrument.bundles>com.myapp.backup.tests,com.myapp.common.tests,com.myapp.model.tests</eclemma.instrument.bundles>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${emma.session.out.file}</file>
<type>es</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.tycho</groupId>
<artifactId>maven-osgi-test-plugin</artifactId>
<version>${tycho-version}</version>
<!--
<configuration>
<systemProperties combine.children="append">
<eclemma.help>true</eclemma.help>
<emma.session.out.file>${emma.session.out.file}</emma.session.out.file>
<emma.filter>${emma.filter}</emma.filter>
<eclemma.instrument.bundles>${eclemma.instrument.bundles}</eclemma.instrument.bundles>
</systemProperties>
<frameworkExtensions>
<frameworkExtension>
<groupId>org.eclemma.runtime.equinox</groupId>
<artifactId>org.eclemma.runtime.equinox</artifactId>
<version>1.1.0.200908261008</version>
</frameworkExtension>
</frameworkExtensions>
</configuration>
-->
<configuration>
<skip>${skipFunctional}</skip>
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
<product>org.eclipse.sdk.ide</product>
<application>org.eclipse.ui.ide.workbench</application>
<argLine>-Xmx512M</argLine>
<systemProperties combine.children="append">
<emma.session.out.file>${emma.session.out.file}</emma.session.out.file>
<emma.filter>${emma.filter}</emma.filter>
<eclemma.instrument.bundles>${emma.instrument.bundles}</eclemma.instrument.bundles>
</systemProperties>
<frameworkExtensions>
<frameworkExtension>
<groupId>org.eclemma.runtime.equinox</groupId>
<artifactId>org.eclemma.runtime.equinox</artifactId>
<version>1.1.0.200908261008</version>
</frameworkExtension>
</frameworkExtensions>
<application>org.eclipse.ui.ide.workbench</application>
<dependencies>
<dependency>
<type>p2-installable-unit</type>
<artifactId>org.eclipse.sdk.ide</artifactId>
<version>0.0.0</version>
</dependency>
</dependencies>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<repositories>
<repository>
<id>helios-platform</id>
<layout>p2</layout>
<url>${project.baseUri}../../../../targetplatform/org.eclipse.platform-3.7.1</url>
</repository>
<repository>
<id>myapp-targetplatform</id>
<layout>p2</layout>
<url>${project.baseUri}../../../../targetplatform/myapp-targetplatform</url>
</repository>
</repositories>
</project>
Upgraded Tycho to 0.17.0 but it turns out the issue indeed has nothing to do with Tycho - I realized I've tweaked the location properties on Windows in an attempt to prepare to support installation into c:\Program Files post-XP with UAC:
-Dosgi.instance.area=#user.home/Application Data/myapp
-Dosgi.configuration.area=#user.home/Application Data/myapp/.configuration
However moving the osgi.configuration.area out of the installation folder (which defaults to c:\myapp :P) is what causes my p2 problem.