error occurs when importing maven project, conducting maven clean, and maven install:
[ERROR] Failed to execute goal. Org. Apache maven. Plugins: maven — the compiler plugin: 3.1: the compile (default – the compile) on project mvc2: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
is running on a JRE rather than a JDK version.
is running on a JRE rather than a JDK version- window – & gt; The preferences – & gt; Java – & gt; Installed JREs
li> - find JDK installation path
li> - select the JDK – & gt; apply li>
- maven clean again, maven install, if the problem remains, For the operation:
li> - open pom. The XML file, The following configuration under the plugins will source target to correspond to the JDK version (I was) 1.8:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
set the JDK version 1.8
maven clean again, maven install, no error, can be loaded, But the project may still be small Red Cross on the top left corner, specific error is as follows:
Dynamic Web Module 3.0 requires Java 1.6 or newer. strong>
specific solution is as follows:
find apache – maven installation path;
in Apache-maven-3.5.3 /conf/settings.xml file with the following configuration (depending on JDK version, mine is 1.8) :
<profiles>
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
</profiles>
re Maven > Update project can solve this problem.
this article reprinted in: https://blog.csdn.net/ZkD953/article/details/79935520 p>
Read More:
- Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.
- [Solved] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test
- Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar (default) on project
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)
- Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run (default-cli) on project
- “[warning] failed to retrieve plugin descriptor for caused by Maven security agent settings org.apache.maven . plugins:… “
- Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test)
- 解决Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile
- Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign
- Failed to execute goal in Maven build org.apache.tomcat .maven:
- Failed to execute goal org.apache.maven . plugins:maven-surefire-plugin :2.12.4:test
- RocketMQ Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check…
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on pr
- How to Fix Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile
- Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.0.0:clean (default-clean) on
- Error resolving version for plugin ‘org.apache.maven.plugins:maven-compiler-plugin’ from the repo…
- mvn install Error: Failed to read artifact descriptor org.apache.maven.plugins:maven-install-plugin:jar:2
- Cannot resolve plugin org.apache.maven.plugins:maven-jar-plugin:2.4
- Failed to execute goal org.apache.tomcat . maven:tomcat7-maven-plugin : 2.2: run solution
- Failed to execute goal org.apache.maven . plugins:maven-clean-plugin :2.6.1:cle