I am using a maven plugin that requires a class that is contained in the jdk's (windows) tools.jar (mac it's in classes.jar).
I add this as an explicit dependency of the plugin as follows:
<dependencies>
<dependency>
<groupId>sun.jdk</groupId>
<artifactId>classes</artifactId>
<version>1.6.0</version>
<scope>system</scope>
<systemPath>${java.home}/../Classes/classes.jar</systemPath>
</dependency>
</dependencies>
This works if I'm using OS X. However, it does not work if I'm developing on a Windows machine. Moreover, I dislike the use of ../Classes.
Is there perhaps a better way to load in the JDK provided classes?
note: I understand the default (Sun, now Oracle) is to ship the JDK with these classes in lib/tools.jar and that the only real outlier is those who develop using the repackaged Apple JDK. Be that as it may, I am still interested in a -system independent approach- that does not depend so much on the specific path.