Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-user] Generics problem

Hi,

When I compile a plugin that uses OSGi tycho strangely gives me a generics error that I don't have in my workspace:

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.15.0:compile (default-compile)
[ERROR] C:\Users\jongw\Workspaces\grav..
[ERROR] private ServiceRegistration<?> serviceTrackerEventListenerstener;
[ERROR] ^^^^^^^^^^^^^^^^^^^
[ERROR] The type ServiceRegistration is not generic; it cannot be parameterized with arguments <?>

..

There are no references to old java versions in build.properties or manifest.mf. It is only this bundle that complains about generics. Other bundles use generics as well but compile fine.

I have been searching the web but no others have this problem. I did, however, find a reference to defining source and target versions for the tycho compiler.

When I add the following to the pom of the plugin, Tycho compiles fine. Please see the source version 1.1 Why does tycho compile with this addition to the pom and failes otherwise?

Thanks for looking at this

Regards,

Wim


-- PLUGIN POM ADDITIONS

<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>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<source>1.1</source>
</configuration>
</plugin>
</plugins>
</build>

--- PLUGIN POM

<?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>
<parent>
<groupId>com.remainsoftware.gravity</groupId>
<artifactId>gravity-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../com.remainsoftware.gravity.parent</relativePath>
</parent>
<groupId>com.remainsoftware.gravity</groupId>
<artifactId>com.remainsoftware.gravity.rap.event.ui</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<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>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<source>1.1</source>
</configuration>
</plugin>
</plugins>
</build>

</project>



-- PARENT POM

<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.remainsoftware.gravity</groupId>
<artifactId>gravity-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>


<properties>
<tycho-version>0.15.0</tycho-version>
</properties>

<pluginRepositories>
<pluginRepository>
<id>tycho-snapshots</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</pluginRepository>
</pluginRepositories>

<repositories>

<repository>
<id>juno</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/juno</url>
</repository>


<repository>
<id>nebula-release</id>
<url>http://download.eclipse.org/technology/nebula/snapshot</url>
<layout>p2</layout>
</repository>

<repository>
<id>nebula-incubator</id>
<url>http://download.eclipse.org/technology/nebula/incubation/snapshot</url>
<layout>p2</layout>
</repository>

<repository>
<id>rap-runtime</id>
<url>http://download.eclipse.org/rt/rap/1.5/runtime</url>
<layout>p2</layout>
</repository>

<repository>
<id>rap-incubator</id>
<url>http://download.eclipse.org/rt/rap/1.5/incubator</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>
<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>
</plugins>
</build>
</project>


Back to the top