Skip to content

Commit 0cc43ce

Browse files
jorsolhboutemy
authored andcommitted
[MWRAPPER-40] Fix line separators in wrapper properties file
Signed-off-by: Jorge Solórzano <jorsol@gmail.com>
1 parent fd3cde4 commit 0cc43ce

File tree

1 file changed

+18
-17
lines changed
  • maven-wrapper-plugin/src/main/java/org/apache/maven/plugins/wrapper

1 file changed

+18
-17
lines changed

maven-wrapper-plugin/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.nio.charset.StandardCharsets;
2828
import java.nio.file.Files;
2929
import java.nio.file.Path;
30+
import java.util.Locale;
3031
import java.util.Map;
3132
import java.util.Properties;
3233

@@ -233,26 +234,26 @@ private void replaceProperties( String wrapperVersion, Path targetFolder ) throw
233234
getLog().info( "Configuring .mvn/wrapper/maven-wrapper.properties to use "
234235
+ buffer().strong( "Maven " + mavenVersion ) + " and download from " + repoUrl );
235236

236-
final String license = "# Licensed to the Apache Software Foundation (ASF) under one\n"
237-
+ "# or more contributor license agreements. See the NOTICE file\n"
238-
+ "# distributed with this work for additional information\n"
239-
+ "# regarding copyright ownership. The ASF licenses this file\n"
240-
+ "# to you under the Apache License, Version 2.0 (the\n"
241-
+ "# \"License\"); you may not use this file except in compliance\n"
242-
+ "# with the License. You may obtain a copy of the License at\n"
243-
+ "# \n"
244-
+ "# http://www.apache.org/licenses/LICENSE-2.0\n"
245-
+ "# \n"
246-
+ "# Unless required by applicable law or agreed to in writing,\n"
247-
+ "# software distributed under the License is distributed on an\n"
248-
+ "# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n"
249-
+ "# KIND, either express or implied. See the License for the\n"
250-
+ "# specific language governing permissions and limitations\n"
251-
+ "# under the License.\n";
237+
final String license = "# Licensed to the Apache Software Foundation (ASF) under one%n"
238+
+ "# or more contributor license agreements. See the NOTICE file%n"
239+
+ "# distributed with this work for additional information%n"
240+
+ "# regarding copyright ownership. The ASF licenses this file%n"
241+
+ "# to you under the Apache License, Version 2.0 (the%n"
242+
+ "# \"License\"); you may not use this file except in compliance%n"
243+
+ "# with the License. You may obtain a copy of the License at%n"
244+
+ "#%n"
245+
+ "# https://www.apache.org/licenses/LICENSE-2.0%n"
246+
+ "#%n"
247+
+ "# Unless required by applicable law or agreed to in writing,%n"
248+
+ "# software distributed under the License is distributed on an%n"
249+
+ "# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%n"
250+
+ "# KIND, either express or implied. See the License for the%n"
251+
+ "# specific language governing permissions and limitations%n"
252+
+ "# under the License.%n";
252253

253254
try ( BufferedWriter out = Files.newBufferedWriter( wrapperPropertiesFile, StandardCharsets.UTF_8 ) )
254255
{
255-
out.append( license );
256+
out.append( String.format( Locale.ROOT, license ) );
256257
out.append( "distributionUrl=" + distributionUrl + System.lineSeparator() );
257258
out.append( "wrapperUrl=" + wrapperUrl + System.lineSeparator() );
258259
}

0 commit comments

Comments
 (0)