免費(fèi)微商城平臺官網(wǎng)最優(yōu)化方法
目錄
方案一: 我沒有使用
方案二:修改maven配置文件
前言:每次創(chuàng)建一個maven模塊時java compiler版本就是1.6與實(shí)際版本不一致
使用的使用maven3.9.1 jdk17,但是每次創(chuàng)建一個maven模塊都是會影響之前的模塊。網(wǎng)上都是修改pom.xml
方案一: 我沒有使用
因?yàn)樵陧?xiàng)目中如果沒有指定jdk的版本,重新運(yùn)行的時候都會默認(rèn)恢復(fù)為1.X版本
<profile> <id>java-8</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> </properties>
</profile>
方案二:修改maven配置文件
<!-- ${MAVEN_HOME}/conf/settings.xml 文件添加如下profile配置,建立的java項(xiàng)目默認(rèn)使用java 17 -->
<profiles><profile><id>jdk-17</id><activation><activeByDefault>true</activeByDefault><jdk>17</jdk></activation><properties><maven.compiler.source>17</maven.compiler.source><maven.compiler.target>17</maven.compiler.target><maven.compiler.compilerVersion>17</maven.compiler.compilerVersion></properties></profile>
</profiles>
參照博主:
https://www.cnblogs.com/east7/p/13363069.html