when i try to run the maven-release-plugin it changes the version in the pom.xml file. Prior to the maven release every line ending has unix style <lf>
but after running it on my windows machine, the plugin changes every line in the file to <cr><lf>
.
My questions are:
a) Is there a way to tell maven to leave everything as it is or to use a specific line ending
or
b) Is there a general way to tell windows what the line ending should be? Even a tool that hacks something deep down in the OS would be considered helpful.
I had a look at this https://issues.jfrog.org/jira/browse/BI-111 and it says "resolved" but i am using the latest version and it doesn't work for me.
The plugin will extract file revisions associated with the current release. Maven will compile, test and package the versioned project source code into an artifact. The final deliverable will then be released into an appropriate maven repository.
When you depend on a plugin or a dependency, you can use the a version value of LATEST or RELEASE. LATEST refers to the latest released or snapshot version of a particular artifact, the most recently deployed artifact in a particular repository. RELEASE refers to the last non-snapshot release in the repository.
There are four possible solutions.
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.
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.
"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");
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With