@@ -52,19 +52,19 @@ public void onNewProject(ProjectDefinition projectDefinition, Path dir) {
5252 final Path pom = dir .resolve ("pom.xml" );
5353 if (Files .isRegularFile (pom )) {
5454 try {
55- final List <String > strings = Files .readAllLines (pom );
56- if (strings .stream ().anyMatch (s -> s .contains ("<repositories>" ))) {
55+ final List <String > pomLines = Files .readAllLines (pom );
56+ if (pomLines .stream ().anyMatch (s -> s .contains ("<repositories>" ))) {
5757 return ;
5858 }
59- OptionalInt lineNumber = IntStream .range (0 , strings .size ())
60- .filter (i -> strings .get (i ).contains ("<dependencyManagement>" ))
59+ OptionalInt lineNumber = IntStream .range (0 , pomLines .size ())
60+ .filter (i -> pomLines .get (i ).contains ("<dependencyManagement>" ))
6161 .findFirst ();
6262 if (lineNumber .isEmpty ()) {
6363 throw new RuntimeException (
6464 "Platform generated pom.xml is not valid, please, report this error to the administrator." );
6565 }
66- strings .addAll (lineNumber .getAsInt (), repositories );
67- Files .writeString (pom , String .join ("\n " , strings ), StandardOpenOption .TRUNCATE_EXISTING );
66+ pomLines .addAll (lineNumber .getAsInt (), repositories );
67+ Files .writeString (pom , String .join ("\n " , pomLines ), StandardOpenOption .TRUNCATE_EXISTING );
6868 } catch (IOException e ) {
6969 throw new RuntimeException (e );
7070 }
0 commit comments