Quantcast
Channel: tycho-user
Viewing all articles
Browse latest Browse all 4647

[tycho-user] Work around for Maven persistently using JDK 1.5 by default

$
0
0
Hello,Â

I am running Maven Tycho on an Eclipse Project that is using Java 8. The whole system knows I am using JDK 1.8. and even my POM mentions it.Â

<plugin>
<groupId>org.apache.maven.plugins</groupId>
 Â<artifactId>maven-compiler-plugin</artifactId>
 Â<version>3.5.1</version>
 Â<configuration>
     <source>1.8</source>
     <target>1.8</target>
  Â<compilerId>groovy-eclipse-compiler</compilerId>
  Â<verbose>true</verbose> ÂÂ
  Â<fork>true</fork>Â
  Â<compilerArguments>
   Â<javaAgentClass>lombok.launch.Agent</javaAgentClass>
  Â</compilerArguments>
 Â</configuration>
...

I tried different things to work around the issue including using org.codehaus.mojo and specifying 1.8 in the manifest.mf.Â

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
Â<executions>
 Â<execution>
  Â<phase>validate</phase>
  Â<goals>
   Â<goal>maven-version</goal>
  Â</goals>
 Â</execution>
Â</executions>
</plugin>Â

but regardless I have Âthe same error due to Maven using jdk 1.5 regardless of what is written in pom and manifest.Â


Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.0.0:compile (default-compile) on project com.company.bbcode.parser: Compilation failure: Compilation failure:
...
ÂLambda expressions are allowed only at source level 1.8 or above

In my POM I mentioned as one of the plugins
<plugin>
<groupId>org.apache.maven.plugins</groupId>
ÂÂ Â<artifactId>maven-compiler-plugin</artifactId>
ÂÂ Â<version>3.5.1</version>
ÂÂ Â<configuration>
     <source>1.8</source>
     <target>1.8</target>
ÂÂ Â Â<compilerId>groovy-eclipse-compiler</compilerId>
ÂÂ Â Â<verbose>true</verbose> ÂÂ
ÂÂ Â Â<fork>true</fork>Â
ÂÂ Â Â<compilerArguments>
ÂÂ Â Â Â<javaAgentClass>lombok.launch.Agent</javaAgentClass>
ÂÂ Â Â</compilerArguments>
ÂÂ Â</configuration>
ÂÂ Â<dependencies>
ÂÂ Â Â Â<dependency>
ÂÂ Â Â Â Â Â<groupId>org.codehaus.groovy</groupId>
ÂÂ Â Â Â Â Â<artifactId>groovy-eclipse-compiler</artifactId>
ÂÂ Â Â Â Â Â<version>2.9.1-01</version>
ÂÂ Â Â Â</dependency>
ÂÂ Â Â Â<!-- for 2.8.0-01 and later you must have an explicit dependency on groovy-eclipse-batch -->
ÂÂ Â Â Â<dependency>
ÂÂ Â Â Â Â Â<groupId>org.codehaus.groovy</groupId>
ÂÂ Â Â Â Â Â<artifactId>groovy-eclipse-batch</artifactId>
ÂÂ Â Â Â Â Â<version>2.3.7-01</version>
ÂÂ Â Â Â</dependency>
ÂÂ Â Â Â<dependency>
ÂÂ Â Â Â Â Â<groupId>com.company.lombok</groupId>
ÂÂ Â Â Â Â Â<artifactId>lombok</artifactId>
ÂÂ Â Â Â Â Â<version>1.16.8</version>
ÂÂ Â Â Â</dependency>
ÂÂ Â</dependencies>
</plugin>

--
Best regards,Â

Khady L. Seck
Full Stack Java Developer
Tel: 438-830-4117

Viewing all articles
Browse latest Browse all 4647

Trending Articles