From Maven's website:
...
<profiles>
<profile>
<id>default-tools.jar</id>
<activation>
<property>
<name>java.vendor</name>
<value>Sun Microsystems Inc.</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.4.2</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
...
tools.jar is already inclduded on Macs, embedded with classes.jar. Was there no way to specify !mac in the activation settings (except for listing every os except the mac) in the pom.xml, instead of always getting:
ERROR>warning: [path] bad path element ""/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/lib/tools.jar"": no such file or directory
I found another method. Have the dependency in an "activeByDefault" profile. Have another profile (profile-2) which gets activated if the OS is mac. According to this the "activeByDefault" profiles get deactivated if any of the other profiles get activated. So if the OS is mac, profile-2 will get activated, which will deactivate the "activeByDefault" profile.