M1 Tip #7: Referencing tools.jar

If you're writing a plugin you may have the need to add the tools.jar file to some classpath. You can't add a dependency in your plugin's POM as this Sun JAR cannot be redistributed by Maven on ibiblio.

However, Maven provides a ${tools.jar} property that you can use in your build code.

For example you can write:

[...]
<ant:classpath>
  <ant:pathelement location=${tools.jar}/>
[...]