在pom.xml文件中加入:
<dependency> <groupId>jdk.tools</groupId> <artifactId>jdk.tools</artifactId> <version>1.7.0._11</version> <scope>system</scope> <!-- systemPath>C:/Program Files/Java/jdk1.7.0_11/lib/tools.jar</systemPath--> <systemPath>${JAVA_HOME}/lib/tools.jar</systemPath> </dependency>