There are four possible solutions.
- Use the Maven Assemly Plugin
I think the best idea is investigate the Maven assembly plugin. It should allow you to update the line separator. See the section "fileSet" section for details.
- Use PowerShell to call
mvn
As a temporary work around, you can use PowerShell (Start->All Programs->Accessories->Windows PowerShell). Call maven like you would, with some extras around double quoting the -D statements. mvn assembly:assembly -P prod "-Dmaven.test.skip=true"
. Now add to this -Dline.separator=`n. This should cause PowerShell to add the escaped value.
- Write your own plugin to override
"line.separator"
before the pom is updated.
Follow the Maven Guide on creating a simple plugin. All it needs to do is override value. Configure the plugin to execute in the phase prior to the pom modification.
System.getProperties().setProperty("line.separator", "\n");
- Build in a Linux VM.
There is an option that doesn't correct the Windows compatibility issue, but should solve your core problem. Look at creating small VirtualBox Linux server. A simple NAT connection should suffice for Internet access. Install Maven, Java, etc on this machine. Build on it. Because it's Linux the line separator should be only '\n'. The VM would need 256 - 512 MB of RAM and 20 GB of storage space (Linux + a lot of possible Maven dependencies). If you end up liking it, you could even expand it to house a continuous integration product like Jenkins.