maven 3.8.0:project App上的testCompile(默认testCompile):编译时出现致命错误:无效标志:-发布->;[帮助1]
我在maven 3.8.0中使用jdk 11。请查找以下给定的pom.xml。我犯了一个错误maven 3.8.0:project App上的testCompile(默认testCompile):编译时出现致命错误:无效标志:-发布->;[帮助1],maven,maven-3,maven-plugin,java-11,Maven,Maven 3,Maven Plugin,Java 11,我在maven 3.8.0中使用jdk 11。请查找以下给定的pom.xml。我犯了一个错误 Aug 1 15:50:11 [WARNING] The requested profile "inttest" could not be activated because it does not exist. Aug 1 15:50:11 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3
Aug 1 15:50:11 [WARNING] The requested profile "inttest" could not be activated because it does not exist.
Aug 1 15:50:11 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:testCompile (default-testCompile) on project some-service: Fatal error compiling: invalid flag: --release -> [Help 1]
Aug 1 15:50:11 [ERROR]
Aug 1 15:50:11 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
Aug 1 15:50:11 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
Aug 1 15:50:11 [ERROR]
Aug 1 15:50:11 [ERROR] For more information about the errors and possible solutions, please read the following articles:
Aug 1 15:50:11 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
编译时出现致命错误:无效标志:-发布->[帮助1]
有没有关于如何解决这个问题的建议
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
<encoding>UTF-8</encoding>
</configuration>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>7.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
当您使用Java 9的
11
命令行功能,但使用Java 8构建它时,通常会发生此错误
mvn——版本
应该给你
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /opt/maven
Java version: 11.0.7, vendor: Oracle Corporation, runtime: /home/.../.sdkman/candidates/java/11.0.7-open
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.8.10-200.fc32.x86_64", arch: "amd64", family: "unix" ```
当您使用Java 9的
11
命令行功能,但使用Java 8构建它时,通常会发生此错误
mvn——版本
应该给你
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /opt/maven
Java version: 11.0.7, vendor: Oracle Corporation, runtime: /home/.../.sdkman/candidates/java/11.0.7-open
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.8.10-200.fc32.x86_64", arch: "amd64", family: "unix" ```
您是否使用java 11和$java_HOME变量设置了项目?首先,我建议使用最新版本的maven编译器插件(3.8.1)此外,无效标志表示您没有使用JDK 11构建或没有按照前面所述正确设置JAVA_HOME…不需要依赖于asm…@khmarbaise问题已解决感谢您使用JAVA 11和$JAVA_HOME变量设置项目吗?首先,我建议使用最新版本的maven编译器插件(3.8.1)此外,无效标志意味着您没有使用JDK 11进行构建,或者没有按照前面所述正确设置JAVA_HOME…不需要依赖于asm…@khmarbaise问题已解决,谢谢