Fix the broken build (no JDK has no src.zip in CI)

This commit is contained in:
BoykoAlex
2018-11-07 21:01:10 -05:00
parent d3faadef7b
commit 5e34506eae
2 changed files with 15 additions and 12 deletions

View File

@@ -11,7 +11,6 @@
package org.springframework.ide.vscode.commons.java;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -68,16 +67,8 @@ public class BootProjectUtil {
private static Path sourceZip(Path containerFolder) {
Path sourcesZip = containerFolder.resolve("src.zip");
if (Files.isReadable(sourcesZip)) {
if (Files.exists(sourcesZip)) {
return sourcesZip;
} else if (Files.isSymbolicLink(sourcesZip)) {
try {
Path realPath = sourcesZip.toRealPath();
System.out.println("Symlink points to -> " + realPath);
return realPath;
} catch (IOException e) {
log.error("", e);
}
}
return null;
}

View File

@@ -1705,12 +1705,24 @@ public class ApplicationPropertiesEditorTest extends AbstractPropsEditorTest {
assertLinkTargets(editor, "org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy", project, "org.springframework.data.mapping.model.PropertyNameFieldNamingStrategy");
//Linking should also work for types that aren't valid based on the constraints
// java.lang.String commented out - CI build node open JDK comes with no src.zip in the JDK
// Well... src.zip in the open JDK in the CI is a symlink pointing non-existant file
// editor = newEditor(
// "#stuff\n" +
// "spring.data.mongodb.field-naming-strategy=java.lang.String\n" +
// "#more stuff"
// );
// assertLinkTargets(editor, "java.lang.String", project, "java.lang.String");
// Instead of java.lang.String
editor = newEditor(
"#stuff\n" +
"spring.data.mongodb.field-naming-strategy=java.lang.String\n" +
"spring.data.mongodb.field-naming-strategy=org.springframework.core.io.Resource\n" +
"#more stuff"
);
assertLinkTargets(editor, "java.lang.String", project, "java.lang.String");
assertLinkTargets(editor, "org.springframework.core.io.Resource", project, "org.springframework.core.io.Resource");
}
@Test public void testCommaListReconcile() throws Exception {