1 2 idea中maven项目的编译: 3 方案1:maven的settings.xml中指定全局默认编译版本 4 5 <profile> 6 <id>jdk-1.8</id> 7 8 <activation> 9 <activeByDefault>true</activeByDefault> 10 <jdk>1.8</jdk> 11 </activation> 12 13 <properties> 14 <maven.compiler.source>1.8</maven.compiler.source> 15 <maven.compiler.target>1.8</maven.compiler.target> 16 <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> 17 </properties> 18 </profile> 19 20 方案2:在pom.xml中指定项目的编译版本 21 方式1:plugin 22 方式2:properties 23 24 <build> 25 <plugins> 26 <plugin> 27 <groupId>org.apache.maven.plugins</groupId> 28 <artifactId>maven-compiler-plugin</artifactId> 29 <version>3.8.0</version> 30 <configuration> 31 <source>1.8</source> 32 <target>1.8</target> 33 </configuration> 34 </plugin> 35 </plugins> 36 </build> 37 38 <properties> 39 <maven.compiler.source>1.8</maven.compiler.source> 40 <maven.compiler.target>1.8</maven.compiler.target> 41 </properties>
转载于:https://www.cnblogs.com/mozq/p/10985573.html