Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] How to correct Tycho generics compile error -- JDT compile gives no error

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.

On 03/08/2016 10:26 PM, Gerald Rosenberg wrote:
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> 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" 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
tycho-user@xxxxxxxxxxx
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.

Back to the top