Failed to execute goal maven-compiler-plugin compile on project aliddns Fatal error compiling

Scroll Down

maven 打包报错

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project aliddns: Fatal error compiling

问题是项目不适用默认的jdk版本,在pom.xml中指定编译版本即可,如下

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.0</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

END