In Maven, ${java.home} points to the JRE directory used by the JDK, not JDK itself. Please see this question:
Java_home in Maven
So instead of
${java.home}/lib/tools.jar
which assumes the JDK directory you should have used
${java.home}/../lib/tools.jar
However, this is only a half of the solution. The problem is that under Mac, the directory structure is different. You have to user profiles in order to make your build relibaly work cross-platform.
Please see this question:
JDK tools.jar as maven dependency
And, specificaly, this answer (which IS the correct answer and not the one accepted by the OP there).
This is how Oracle handles it in one of their POMs:
<!-- JDK dependencies -->
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.6</version>
<scope>system</scope>
<systemPath>${tools.jar}</systemPath>
</dependency>
And then in profiles
:
<profile>
<id>default-tools.jar</id>
<activation>
<file>
<exists>${java.home}/../lib/tools.jar</exists>
</file>
</activation>
<properties>
<tools.jar>${java.home}/../lib/tools.jar</tools.jar>
</properties>
</profile>
<profile>
<id>default-tools.jar-mac</id>
<activation>
<file>
<exists>${java.home}/../Classes/classes.jar</exists>
</file>
</activation>
<properties>
<tools.jar>${java.home}/../Classes/classes.jar</tools.jar>
</properties>
</profile>
On Mac, the JDK has a different file structure. This is why you have to define these profiles.
See also the following posts: