有时在Windows系统上使用某些MavenPlugin时,需要设置换行符风格。
下面的配置可以用于修改java system properties中的line separator
<build>
<plugins>
<!-- for windows, set line.separator to -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>set-system-properties</goal>
</goals>
<configuration>
<properties>
<line.separator xml:space="preserve"> </line.separator>
</properties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
xml:space="preserve" 这个重要,XML解析器默认忽略空格,TAB , 换行符
转义后的 '\n'
本文介绍如何通过MavenPlugin在Windows环境下配置Java系统的换行符风格,使用properties-maven-plugin设置line.separator属性为
,适用于需要统一代码换行格式的项目。

被折叠的 条评论
为什么被折叠?



