The simplest way to do this is to use maven profiles
One way to activate a profile is to use the os (operating system). You have to define a property. Let's say <ear.directory>/projects/shared_ears</ear.directory>
and use this property in your plugin configuration:
<configuration>
<outputDirectory>${ear.directory}</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}</directory>
<includes>
<include>project-${project.version}.ear</include>
</includes>
</resource>
</resources>
<overwrite>true</overwrite>
</configuration>
Now, you can specify this property in 2 distinct profiles and activate one profile or the other based on the current operating system. Here is how to do it:
<profiles>
<profile>
<id>WinProfile</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<properties>
<ear.directory>D:\projects_bin\shared_ears</ear.directory>
</properties>
...
</profile>
<profile>
<id>UnixProfile</id>
<activation>
<os>
<family>unix</family>
</os>
</activation>
<properties>
<ear.directory>/projects/shared_ears</ear.directory>
</properties>
...
</profile>
</profiles>
Additionnal info about profile and os detection here