Skip to content

Commit 9042049

Browse files
committed
undo changes
1 parent b331249 commit 9042049

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

plugin-maven/src/test/java/com/diffplug/spotless/maven/MavenIntegrationHarness.java

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2024 DiffPlug
2+
* Copyright 2016-2025 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -87,13 +87,13 @@ void gitAttributes() throws IOException {
8787
if (Jvm.version() >= 16) {
8888
// for GJF https://github.com/diffplug/spotless/issues/834
8989
setFile(".mvn/jvm.config").toContent(
90-
"--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" +
91-
" --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED" +
92-
" --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED" +
93-
" --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED" +
94-
" --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED" +
95-
// this last line is for Detekt
96-
" --add-opens java.base/java.lang=ALL-UNNAMED");
90+
"--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" +
91+
" --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED" +
92+
" --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED" +
93+
" --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED" +
94+
" --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED" +
95+
// this last line is for Detekt
96+
" --add-opens java.base/java.lang=ALL-UNNAMED");
9797
}
9898
// copy the mvnw resources
9999
copy("mvnw").setExecutable(true);
@@ -213,9 +213,15 @@ protected void writePom(String[] executions, String[] configuration, String[] de
213213
}
214214

215215
protected MavenRunner mavenRunner() throws IOException {
216-
return MavenRunner.create()
217-
.withProjectDir(rootFolder())
218-
.withRunner(runner);
216+
MavenRunner mavenRunner = MavenRunner.create()
217+
.withProjectDir(rootFolder())
218+
.withRunner(runner);
219+
System.getProperties().forEach((key, value) -> {
220+
if (key instanceof String && ((String) key).startsWith("spotless") && value instanceof String) {
221+
mavenRunner.withSystemProperty((String) key, (String) value);
222+
}
223+
});
224+
return mavenRunner;
219225
}
220226

221227
private static ProcessRunner runner;
@@ -337,8 +343,8 @@ protected static String[] formats(String... formats) {
337343

338344
protected static String[] formats(String[]... formats) {
339345
String[] formatsArray = Arrays.stream(formats)
340-
.flatMap(Arrays::stream)
341-
.toArray(String[]::new);
346+
.flatMap(Arrays::stream)
347+
.toArray(String[]::new);
342348
return formats(formatsArray);
343349
}
344350
}

0 commit comments

Comments
 (0)