Maven打包错误:
No compiler is provided in this environment. Perhaps you are running on a JRE or JDK
产生原因,没有声明JDK版本
<build>
<plugins>
<plugin>
<!-- 指定maven编译的jdk版本 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<verbose>true</verbose>
<fork>true</fork>
<!--你的jdk地址-->
<executable>/Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home/bin/javac</executable>
</configuration>
</plugin>
</plugins>
</build>
JDK地址查找自行百度