Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 363497

Summary: Tycho can not be adjusted to compile with java 7 compiler.
Product: z_Archived Reporter: Dimitar Donchev <dimitar.donchev>
Component: TychoAssignee: Project Inbox <tycho-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: dimitar.donchev, jan.sievers
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Sample project demonstrating the issue
none
fixed sample project none

Description Dimitar Donchev CLA 2011-11-10 11:30:55 EST
Created attachment 206795 [details]
Sample project demonstrating the issue

Hello,

I'm trying to compile an eclipse plug-in which contains java 7 compliant code.
I've added 
<plugin>
 <groupId>org.sonatype.tycho</groupId>
 <artifactId>maven-osgi-compiler-plugin</artifactId>
 <version>${tycho-version}</version>
 <configuration>
  <source>1.7</source>
  <target>1.7</target>
  <encoding>UTF-8</encoding>
 </configuration>
</plugin>
to the parent pom and 
"Bundle-RequiredExecutionEnvironment: JavaSE-1.7" 
in the manifest of the plug-in.

No matter if I remove one of those configurations or the other - the maven build still results in compilation failures though the project is built in eclipse with no errors.

I've made a sample project demonstrating the issue and attached it in an archive. 

If this could be a hint : 
If I run the build with Tycho version 0.9.0 the following line appear, though in the manifest java environment 1.7 is clearly stated.
"[WARNING] Overriding compiler source level 1.7 from POM with source level 1.6 from MANIFEST.MF"

If we'd like to adopt java 7 in our OSGI development but this issue needs to be solved. Please help!

Best Regards,
Dimitar
Comment 1 Tobias Oberlies CLA 2011-11-11 09:17:46 EST
Can your reproduce the problem with Tycho 0.13.0?

Please also don't change the priority field. This field is something only to be changed only by the project committers (see https://bugs.eclipse.org/bugs/page.cgi?id=fields.html#priority)
Comment 2 Jan Sievers CLA 2011-11-11 09:42:33 EST
Created attachment 206846 [details]
fixed sample project
Comment 3 Jan Sievers CLA 2011-11-11 09:44:48 EST
sample project works with tycho 0.13.0 (and when running maven with JDK 7), see attched.

BTW, no need to explicitly configure compiler source and target level as these are deduced from BREE.