pom.xml配置
1、使用eclipse编译
<build>
... <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>${java.version}</source> <target>${java.version}</target> <compilerId>eclipse</compilerId> </configuration> <dependencies> <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-compiler-eclipse</artifactId> <version>2.2</version> </dependency> </dependencies> </plugin> .... </plugins> ... </build>2、使用javac
org.apache.maven.plugins maven-compiler-plugin 3.5.1 org.codehaus.plexus plexus-compiler-javac 2.8 org.codehaus.plexus plexus-compiler-api 2.8