Discussion:
How to correct Tycho generics compile error -- JDT compile gives no error
(too old to reply)
Gerald Rosenberg
2016-03-08 21:26:23 UTC
Permalink
First time Tycho user (using Eclipse Mars.2), converting a plugin
project to use Tycho to do the build.

Problem is that the Maven Build is throwing a compiler error, where the
JDT compiler shows no error.

Tried to ensure that the build would use the JDT, but still getting the
same error.

What am I missing?

Thanks ...
------------------------
The error is:

[INFO] --- tycho-compiler-plugin:0.24.0:compile (default-compile) @
net.certiv.dsl.ui ---
[INFO] Compiling 315 source files to
D:\DevFiles\Eclipse\Dsl\net.certiv.dsl\net.certiv.dsl.ui\target\classes
....
[INFO] BUILD FAILURE
....
[ERROR] Failed to execute goal
org.eclipse.tycho:tycho-compiler-plugin:0.24.0:compile
(default-compile) on project net.certiv.dsl.ui: Compilation failure:
Compilation failure:
[ERROR] ICommandService commandSvc =
PlatformUI.getWorkbench().getAdapter(ICommandService.class);
[ERROR] Type mismatch: cannot convert from Object to ICommandService

The interface definition of `getAdapter(..)` is generic -- <T
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime%28IAdaptable.class%E2%98%83IAdaptable%7EgetAdapter%7ELjava.lang.Class%5C%3CTT;%3E;]T>>
T
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime%28IAdaptable.class%E2%98%83IAdaptable%7EgetAdapter%7ELjava.lang.Class%5C%3CTT;%3E;%E2%98%82T>
org
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg>.eclipse
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse>.core
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core>.runtime
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime>.IAdaptable
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime%28IAdaptable.class%E2%98%83IAdaptable>.getAdapter(Class
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime%28IAdaptable.class%E2%98%83IAdaptable%7EgetAdapter%7ELjava.lang.Class%5C%3CTT;%3E;%E2%98%82java.lang.Class><T
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime%28IAdaptable.class%E2%98%83IAdaptable%7EgetAdapter%7ELjava.lang.Class%5C%3CTT;%3E;%E2%98%82T>>
adapter) -- but the implementation is not.

------------------------
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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.certiv.dsl</groupId>
<artifactId>net.certiv.dsl</artifactId>
<version>0.5.5-SNAPSHOT</version>
<packaging>pom</packaging>
<name>net.certiv.dsl :: parent</name>
<description>net.certiv.dsl parent</description>

<prerequisites>
<maven>3.0</maven>
</prerequisites>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<tycho.version>0.24.0</tycho.version>
<tycho.extras.version>0.24.0</tycho.extras.version>
<tycho.test.platformArgs/>
<tycho.test.jvmArgs>-Xmx512m</tycho.test.jvmArgs>

</properties>

<repositories>
<repository>
<id>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>${tycho.version}</version>
<extensions>true</extensions>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<compilerId>jdt</compilerId>
<compilerArgs>
<arg>-warn:-raw,unchecked</arg>
</compilerArgs>
</configuration>
</plugin>

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<resolver>p2</resolver>
<pomDependencies>consider</pomDependencies>
<ignoreTychoRepositories>true</ignoreTychoRepositories>
<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>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<execution>
<id>attach-source</id>
<goals>
<goal>plugin-source</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<format>yyyyMMdd-HHmm</format>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<useUIHarness>true</useUIHarness>
<argLine>${tycho.test.jvmArgs}</argLine>
<!-- kill test JVM if tests take more than 1 minute (60
seconds) to finish -->
<forkedProcessTimeoutInSeconds>60</forkedProcessTimeoutInSeconds>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

<profiles>
<profile>
<id>macosx</id>
<activation>
<os><family>mac</family></os>
</activation>
<properties>
<tycho.test.platformArgs>-XstartOnFirstThread</tycho.test.platformArgs>
</properties>
</profile>
<profile>
<id>source-feature</id>
<activation>
<file>
<exists>feature.xml</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-source-feature-plugin</artifactId>
<version>${tycho.extras.version}</version>
<executions>
<execution>
<id>source-feature</id>
<phase>package</phase>
<goals>
<goal>source-feature</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<execution>
<id>attach-p2-metadata</id>
<phase>package</phase>
<goals>
<goal>p2-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<modules>
<module>net.certiv.dsl.core</module>
<module>net.certiv.dsl.test</module>
<module>net.certiv.dsl.feature</module>
<module>net.certiv.dsl.site</module>
<module>net.certiv.dsl.ui</module>
</modules>
</project>
Sievers, Jan
2016-03-09 08:09:58 UTC
Permalink
hard to tell without a sample project.
Tycho 0.24.0 is using the JDT compiler version from Mars.1 [1]

To verify this is not a JDT bug, you could

- use an eclipse Mars.1 IDE and check if compilation using the IDE works fine
- if it consistently fails with Mars.1, try using a newer version of org.eclipse.jdt.core, see e.g.

https://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/tree/eclipse-platform-parent/pom.xml#n459


also, mvn -X will give you the compilation classpath, so you could check if there is anything different.

For reference, [2] are the fixes for the JDT compiler done for Mars.2. On first glance there are some fixes related to generics, so looks like it's possible this is/was a JDT bug.

Regards,
Jan

[1] https://wiki.eclipse.org/Tycho/Release_Notes/0.24#Other
[2] https://bugs.eclipse.org/bugs/buglist.cgi?classification=Eclipse&component=Core&list_id=13980417&product=JDT&query_format=advanced&target_milestone=4.5.2
First time Tycho user (using Eclipse Mars.2), converting a plugin project to use Tycho to do the build.
Problem is that the Maven Build is throwing a compiler error, where the JDT compiler shows no error.
Tried to ensure that the build would use the JDT, but still getting the same error.
What am I missing?
Thanks ...
------------------------
[INFO] Compiling 315 source files to D:\DevFiles\Eclipse\Dsl\net.certiv.dsl\net.certiv.dsl.ui\target\classes
....
[INFO] BUILD FAILURE
....
[ERROR] ICommandService commandSvc = PlatformUI.getWorkbench().getAdapter(ICommandService.class);
[ERROR] Type mismatch: cannot convert from Object to ICommandService
The interface definition of `getAdapter(..)` is generic -- <T <eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime%28IAdaptable.class%E2%98%83IAdaptable%7EgetAdapter%7ELjava.lang.Class%5C%3CTT;%3E;]T>>
T <eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime%28IAdaptable.class%E2%98%83IAdaptable%7EgetAdapter%7ELjava.lang.Class%5C%3CTT;%3E;%E2%98%82T>
org <eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg>.eclipse <eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse>.core <eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core>.runtime <eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime>.IAdaptable <eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime%28IAdaptable.class%E2%98%83IAdaptable>.getAdapter(Class <eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%
5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime%28IAdaptable.class%E2%98%83IAdaptable%7EgetAdapter%7ELjava.lang.Class%5C%3CTT;%3E;%E2%98%82java.lang.Class><T <eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime%28IAdaptable.class%E2%98%83IAdaptable%7EgetAdapter%7ELjava.lang.Class%5C%3CTT;%3E;%E2%98%82T>>
adapter) -- but the implementation is not.
------------------------
Parent POM
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" <http://maven.apache.org/POM/4.0.0> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <http://www.w3.org/2001/XMLSchema-instance>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" <http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd>>
<modelVersion>4.0.0</modelVersion>
<groupId>net.certiv.dsl</groupId>
<artifactId>net.certiv.dsl</artifactId>
<version>0.5.5-SNAPSHOT</version>
<packaging>pom</packaging>
<name>net.certiv.dsl :: parent</name>
<description>net.certiv.dsl parent</description>
<prerequisites>
<maven>3.0</maven>
</prerequisites>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<tycho.version>0.24.0</tycho.version>
<tycho.extras.version>0.24.0</tycho.extras.version>
<tycho.test.platformArgs/>
<tycho.test.jvmArgs>-Xmx512m</tycho.test.jvmArgs>
</properties>
<repositories>
<repository>
<id>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>${tycho.version}</version>
<extensions>true</extensions>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<compilerId>jdt</compilerId>
<compilerArgs>
<arg>-warn:-raw,unchecked</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<resolver>p2</resolver>
<pomDependencies>consider</pomDependencies>
<ignoreTychoRepositories>true</ignoreTychoRepositories>
<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>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<execution>
<id>attach-source</id>
<goals>
<goal>plugin-source</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<format>yyyyMMdd-HHmm</format>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<useUIHarness>true</useUIHarness>
<argLine>${tycho.test.jvmArgs}</argLine>
<!-- kill test JVM if tests take more than 1 minute (60 seconds) to finish -->
<forkedProcessTimeoutInSeconds>60</forkedProcessTimeoutInSeconds>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>macosx</id>
<activation>
<os><family>mac</family></os>
</activation>
<properties>
<tycho.test.platformArgs>-XstartOnFirstThread</tycho.test.platformArgs>
</properties>
</profile>
<profile>
<id>source-feature</id>
<activation>
<file>
<exists>feature.xml</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-source-feature-plugin</artifactId>
<version>${tycho.extras.version}</version>
<executions>
<execution>
<id>source-feature</id>
<phase>package</phase>
<goals>
<goal>source-feature</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<execution>
<id>attach-p2-metadata</id>
<phase>package</phase>
<goals>
<goal>p2-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<modules>
<module>net.certiv.dsl.core</module>
<module>net.certiv.dsl.test</module>
<module>net.certiv.dsl.feature</module>
<module>net.certiv.dsl.site</module>
<module>net.certiv.dsl.ui</module>
</modules>
</project>
Gerald Rosenberg
2016-03-09 22:27:33 UTC
Permalink
Post by Sievers, Jan
hard to tell without a sample project.
Tycho 0.24.0 is using the JDT compiler version from Mars.1 [1]
To verify this is not a JDT bug, you could
- use an eclipse Mars.1 IDE and check if compilation using the IDE works fine
- if it consistently fails with Mars.1, try using a newer version of org.eclipse.jdt.core, see e.g.
https://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/tree/eclipse-platform-parent/pom.xml#n459
also, mvn -X will give you the compilation classpath, so you could check if there is anything different.
For reference, [2] are the fixes for the JDT compiler done for Mars.2. On first glance there are some fixes related to generics, so looks like it's possible this is/was a JDT bug.
Regards,
Jan
[1] https://wiki.eclipse.org/Tycho/Release_Notes/0.24#Other
[2] https://bugs.eclipse.org/bugs/buglist.cgi?classification=Eclipse&component=Core&list_id=13980417&product=JDT&query_format=advanced&target_milestone=4.5.2
FWIW

I have only two instances of Eclipse installed: Mars.1 from the standard
downloaded zip; and Mars.2 installed using the MSI installer, with its
plugins installed into a .p2/pool entirely separate from Mars.1.

For both Mars.1 and Mars.2, the Java(JDT) editor reports no errors - I
can find no preference setting to adjust, let alone turn off this type
of error. The standard Eclipse IDE export plugin works and the plugin
works without error.

The console output from running mvn -X is at
https://www.dropbox.com/s/f7yeff1yeyj2910/CompileOutput.txt?dl=0
I could see nothing that would indicate it using a wrong
compiler/setting, but I am still very new to Maven/Tycho.

The Java source file in question is just a local copy of Eclipse's own
/org.eclipse.jdt.internal.ui.preferences.CodeAssistAdvancedConfigurationBlock/

Casting is a short-term solution. I will try to prep a sample project
to demo the problem.

Thanks.
Gerald Rosenberg
2016-03-10 05:10:37 UTC
Permalink
Found it. The parent POM contained a reference to the Luna P2 repo. My
bad for failing to see it earlier.

Jens Reimann
2016-03-09 08:19:31 UTC
Permalink
Could it be that you are using an older version of
"org.eclipse.core.runtime" during the build time with Tycho? This would
explain the issue.
Post by Gerald Rosenberg
First time Tycho user (using Eclipse Mars.2), converting a plugin
project to use Tycho to do the build.
Problem is that the Maven Build is throwing a compiler error, where
the JDT compiler shows no error.
Tried to ensure that the build would use the JDT, but still getting
the same error.
What am I missing?
Thanks ...
------------------------
[INFO] --- tycho-compiler-plugin:0.24.0:compile (default-compile)
@ net.certiv.dsl.ui ---
[INFO] Compiling 315 source files to
D:\DevFiles\Eclipse\Dsl\net.certiv.dsl\net.certiv.dsl.ui\target\classes
....
[INFO] BUILD FAILURE
....
[ERROR] Failed to execute goal
org.eclipse.tycho:tycho-compiler-plugin:0.24.0:compile
(default-compile) on project net.certiv.dsl.ui: Compilation
[ERROR] ICommandService commandSvc =
PlatformUI.getWorkbench().getAdapter(ICommandService.class);
[ERROR] Type mismatch: cannot convert from Object to ICommandService
The interface definition of `getAdapter(..)` is generic -- <T
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime%28IAdaptable.class%E2%98%83IAdaptable%7EgetAdapter%7ELjava.lang.Class%5C%3CTT;%3E;]T>>
T
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime%28IAdaptable.class%E2%98%83IAdaptable%7EgetAdapter%7ELjava.lang.Class%5C%3CTT;%3E;%E2%98%82T>
org
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg>.eclipse
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse>.core
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core>.runtime
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime>.IAdaptable
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime%28IAdaptable.class%E2%98%83IAdaptable>.getAdapter(Class
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime%28IAdaptable.class%E2%98%83IAdaptable%7EgetAdapter%7ELjava.lang.Class%5C%3CTT;%3E;%E2%98%82java.lang.Class><T
<eclipse-javadoc:%E2%98%82=net.certiv.dsl.core/C:%5C/Users%5C/Gbr%5C/.p2%5C/pool%5C/plugins%5C/org.eclipse.equinox.common_3.7.0.v20150402-1709.jar%3Corg.eclipse.core.runtime%28IAdaptable.class%E2%98%83IAdaptable%7EgetAdapter%7ELjava.lang.Class%5C%3CTT;%3E;%E2%98%82T>>
adapter) -- but the implementation is not.
------------------------
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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.certiv.dsl</groupId>
<artifactId>net.certiv.dsl</artifactId>
<version>0.5.5-SNAPSHOT</version>
<packaging>pom</packaging>
<name>net.certiv.dsl :: parent</name>
<description>net.certiv.dsl parent</description>
<prerequisites>
<maven>3.0</maven>
</prerequisites>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<tycho.version>0.24.0</tycho.version>
<tycho.extras.version>0.24.0</tycho.extras.version>
<tycho.test.platformArgs/>
<tycho.test.jvmArgs>-Xmx512m</tycho.test.jvmArgs>
</properties>
<repositories>
<repository>
<id>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>${tycho.version}</version>
<extensions>true</extensions>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<compilerId>jdt</compilerId>
<compilerArgs>
<arg>-warn:-raw,unchecked</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<resolver>p2</resolver>
<pomDependencies>consider</pomDependencies>
<ignoreTychoRepositories>true</ignoreTychoRepositories>
<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>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<execution>
<id>attach-source</id>
<goals>
<goal>plugin-source</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<format>yyyyMMdd-HHmm</format>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<useUIHarness>true</useUIHarness>
<argLine>${tycho.test.jvmArgs}</argLine>
<!-- kill test JVM if tests take more than 1 minute (60
seconds) to finish -->
<forkedProcessTimeoutInSeconds>60</forkedProcessTimeoutInSeconds>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>macosx</id>
<activation>
<os><family>mac</family></os>
</activation>
<properties>
<tycho.test.platformArgs>-XstartOnFirstThread</tycho.test.platformArgs>
</properties>
</profile>
<profile>
<id>source-feature</id>
<activation>
<file>
<exists>feature.xml</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-source-feature-plugin</artifactId>
<version>${tycho.extras.version}</version>
<executions>
<execution>
<id>source-feature</id>
<phase>package</phase>
<goals>
<goal>source-feature</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<execution>
<id>attach-p2-metadata</id>
<phase>package</phase>
<goals>
<goal>p2-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<modules>
<module>net.certiv.dsl.core</module>
<module>net.certiv.dsl.test</module>
<module>net.certiv.dsl.feature</module>
<module>net.certiv.dsl.site</module>
<module>net.certiv.dsl.ui</module>
</modules>
</project>
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
IBH SYSTEMS GmbH
D-85235 Pfaffenhofen an der Glonn
Läutenring 43
Geschäftsführer / CEO: Dr. Thomas Heitzig

Amtsgericht München
Handelsregister Nummer HRB 197959
USt ID: DE267945175

Office Munich
D 80992 München
Agnes-Pockels-Bogen 1
T +49 89 18 9 17 49 0

The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or pivileged
material. Any review, retransmission, dissemination or other use of,
or taking of any action in reliance upon, this information by persons
or entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender and delete the
material from any computer.
Jeff MAURY
2016-03-09 09:11:56 UTC
Permalink
I think you target platform is referring to an older version of
getAdapter() that does not use generics so a type cast is missing

Jeff
Post by Jens Reimann
Could it be that you are using an older version of
"org.eclipse.core.runtime" during the build time with Tycho? This would
explain the issue.
First time Tycho user (using Eclipse Mars.2), converting a plugin project
to use Tycho to do the build.
Problem is that the Maven Build is throwing a compiler error, where the
JDT compiler shows no error.
Tried to ensure that the build would use the JDT, but still getting the
same error.
What am I missing?
Thanks ...
------------------------
net.certiv.dsl.ui ---
[INFO] Compiling 315 source files to
D:\DevFiles\Eclipse\Dsl\net.certiv.dsl\net.certiv.dsl.ui\target\classes
....
[INFO] BUILD FAILURE
....
[ERROR] Failed to execute goal
org.eclipse.tycho:tycho-compiler-plugin:0.24.0:compile (default-compile) on
[ERROR] ICommandService commandSvc =
PlatformUI.getWorkbench().getAdapter(ICommandService.class);
[ERROR] Type mismatch: cannot convert from Object to ICommandService
The interface definition of `getAdapter(..)` is generic -- <T> T org.
eclipse.core.runtime.IAdaptable.getAdapter(Class<T> adapter) -- but the
implementation is not.
------------------------
Parent POM
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
<http://maven.apache.org/POM/4.0.0> xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
<http://www.w3.org/2001/XMLSchema-instance> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd"
<http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd>
<modelVersion>4.0.0</modelVersion>
<groupId>net.certiv.dsl</groupId>
<artifactId>net.certiv.dsl</artifactId>
<version>0.5.5-SNAPSHOT</version>
<packaging>pom</packaging>
<name>net.certiv.dsl :: parent</name>
<description>net.certiv.dsl parent</description>
<prerequisites>
<maven>3.0</maven>
</prerequisites>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<tycho.version>0.24.0</tycho.version>
<tycho.extras.version>0.24.0</tycho.extras.version>
<tycho.test.platformArgs/>
<tycho.test.jvmArgs>-Xmx512m</tycho.test.jvmArgs>
</properties>
<repositories>
<repository>
<id>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>${tycho.version}</version>
<extensions>true</extensions>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<compilerId>jdt</compilerId>
<compilerArgs>
<arg>-warn:-raw,unchecked</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<resolver>p2</resolver>
<pomDependencies>consider</pomDependencies>
<ignoreTychoRepositories>true</ignoreTychoRepositories>
<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>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<execution>
<id>attach-source</id>
<goals>
<goal>plugin-source</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<format>yyyyMMdd-HHmm</format>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<useUIHarness>true</useUIHarness>
<argLine>${tycho.test.jvmArgs}</argLine>
<!-- kill test JVM if tests take more than 1 minute (60
seconds) to finish -->
<forkedProcessTimeoutInSeconds>60</forkedProcessTimeoutInSeconds>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>macosx</id>
<activation>
<os><family>mac</family></os>
</activation>
<properties>
<tycho.test.platformArgs>-XstartOnFirstThread</tycho.test.platformArgs>
</properties>
</profile>
<profile>
<id>source-feature</id>
<activation>
<file>
<exists>feature.xml</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-source-feature-plugin</artifactId>
<version>${tycho.extras.version}</version>
<executions>
<execution>
<id>source-feature</id>
<phase>package</phase>
<goals>
<goal>source-feature</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<execution>
<id>attach-p2-metadata</id>
<phase>package</phase>
<goals>
<goal>p2-metadata</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<modules>
<module>net.certiv.dsl.core</module>
<module>net.certiv.dsl.test</module>
<module>net.certiv.dsl.feature</module>
<module>net.certiv.dsl.site</module>
<module>net.certiv.dsl.ui</module>
</modules>
</project>
_______________________________________________
To change your delivery options, retrieve your password, or unsubscribe from this list, visithttps://dev.eclipse.org/mailman/listinfo/tycho-user
--
IBH SYSTEMS GmbH
D-85235 Pfaffenhofen an der Glonn
LÀutenring 43
GeschÀftsfÌhrer / CEO: Dr. Thomas Heitzig
Amtsgericht MÃŒnchen
Handelsregister Nummer HRB 197959
USt ID: DE267945175
Office Munich
D 80992 MÃŒnchen
Agnes-Pockels-Bogen 1
T +49 89 18 9 17 49 0
The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or pivileged
material. Any review, retransmission, dissemination or other use of,
or taking of any action in reliance upon, this information by persons
or entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender and delete the
material from any computer.
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually
working and scaling.
- Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury
Continue reading on narkive:
Loading...