[英]Can't compile Java 13 and Groovy 2.5.8
I have a project (Spring Boot application), in which I mix Java and Groovy.我有一个项目(Spring Boot 应用程序),其中混合了 Java 和 Groovy。
I can compile and run the project without problems inside IntelliJ Idea.我可以在 IntelliJ Idea 中毫无问题地编译和运行该项目。
But I can't compile it with Maven.但是我不能用 Maven 编译它。
Java 12 works fine, but when switching to 13 version it shows me next errors: Java 12 工作正常,但是当切换到 13 版本时,它会显示下一个错误:
Example of POM.xml configuration: POM.xml 配置示例:
<properties>
<java.version>13</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<javax.version>1.5.4</javax.version>
<groovy.version>2.5.8</groovy.version>
<lombok.version>1.18.10</lombok.version>
....
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
<source>{java.version}</source>
<target>{java.version}</target>
<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>3.6.0-03</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>${groovy.version}-01</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.10</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
Does anyone know which compiler/plugin compiles java and groovy code with the java 13 version?有谁知道哪个编译器/插件使用 java 13 版本编译 java 和 groovy 代码?
Java 13 support starts in groovy-eclipse-batch 2.5.8-03, which is based upon Eclipse 4.14. Java 13 支持从基于 Eclipse 4.14 的 groovy-eclipse-batch 2.5.8-03 开始。 https://www.eclipse.org/eclipse/news/4.13/jdt.php#Java_13 https://www.eclipse.org/eclipse/news/4.13/jdt.php#Java_13
You are using 2.5.8-01.您正在使用 2.5.8-01。 At this time, Groovy 2.5.10 is the latest release and groovy-eclipse-batch:2.5.10-01 matches that.目前,Groovy 2.5.10 是最新版本,groovy-eclipse-batch:2.5.10-01 与之匹配。 And both offer support for Java 13.并且两者都提供对 Java 13 的支持。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.