settings.xml自定义变量:
<profile>
<id>custom-compiler</id>
<properties>
<JAVA_HOME>C:\Program Files (x86)\Java\jdk1.8.0_73</JAVA_HOME>
</properties>
</profile>
<!--当然这里应该需要激活,所以settings.xml文件还应该有如下配置:-->
<activeProfiles>
<activeProfile>custom-compiler</activeProfile>
</activeProfiles>
pom.xml即可使用该变量:
<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>1.8</version>
<scope>system</scope>
<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>