<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<verbal>true</verbal>
<compilerArguments>
<verbose />
<bootclasspath>${java.home}\jre\lib\rt.jar;${java.home}\jre\lib\jce.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin>
确保<source><target>中的版本正确。按CTRL点击${java.home}时可以找到JDK的位置。
mvn clean package -Dmaven.test_skip=true 编译成功