JDK tools.jar as maven dependency

That’s what profiles are for, extract the path to a property, setup profiles for windows, OSX, etc, and define the property values appropriately. Here’s the doc page that discussing profiles for OSes: Maven Local Settings Model It should endup looking something like this: <profiles> <profile> <id>windows_profile</id> <activation> <os> <family>Windows</family> </os> </activation> <properties> <toolsjar>${java.home}/../lib/tools.jar</toolsjar> </properties> </profile> … Read more