Skip to content

Commit e0353fe

Browse files
committed
Fix buildSrc:test failing on JDKs before JDK 25 with Non-English locale
See #35777 (comment) Signed-off-by: Yanming Zhou <[email protected]>
1 parent f80b79b commit e0353fe

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

buildSrc/src/test/java/org/springframework/build/multirelease/MultiReleaseJarPluginTests.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,13 @@ public class MultiReleaseJarPluginTests {
4343

4444
private File buildFile;
4545

46+
private File propertiesFile;
47+
4648
@BeforeEach
4749
void setup(@TempDir File projectDir) {
4850
this.projectDir = projectDir;
4951
this.buildFile = new File(this.projectDir, "build.gradle");
52+
this.propertiesFile = new File(this.projectDir, "gradle.properties");
5053
}
5154

5255
@Test
@@ -131,6 +134,9 @@ void validateJar() throws IOException {
131134
}
132135
multiRelease { releaseVersions 17 }
133136
""");
137+
writeGradleProperties("""
138+
org.gradle.jvmargs=-Duser.language=en
139+
""");
134140
writeClass("src/main/java17", "Main.java", """
135141
public class Main {
136142
@@ -152,6 +158,12 @@ private void writeBuildFile(String buildContent) throws IOException {
152158
}
153159
}
154160

161+
private void writeGradleProperties(String properties) throws IOException {
162+
try (PrintWriter out = new PrintWriter(new FileWriter(this.propertiesFile))) {
163+
out.print(properties);
164+
}
165+
}
166+
155167
private void writeClass(String path, String fileName, String fileContent) throws IOException {
156168
Path folder = this.projectDir.toPath().resolve(path);
157169
Files.createDirectories(folder);

0 commit comments

Comments
 (0)