diff --git a/sbm-support-rewrite/src/main/java/org/springframework/sbm/parsers/maven/MavenSettingsInitializer.java b/sbm-support-rewrite/src/main/java/org/springframework/sbm/parsers/maven/MavenSettingsInitializer.java index e3753934f..656360db3 100644 --- a/sbm-support-rewrite/src/main/java/org/springframework/sbm/parsers/maven/MavenSettingsInitializer.java +++ b/sbm-support-rewrite/src/main/java/org/springframework/sbm/parsers/maven/MavenSettingsInitializer.java @@ -45,7 +45,7 @@ public class MavenSettingsInitializer { * @deprecated initialization in ExecutionoContext is done in ProjectParser */ public void initializeMavenSettings() { - String repo = "file://" + Path.of(System.getProperty("user.home")).resolve(".m2/repository") + "/"; + String repo = "file:" + Path.of(System.getProperty("user.home")).resolve(".m2/repository") + "/"; MavenRepository mavenRepository = new MavenRepository("local", repo, "true", "true", true, null, null, false); MavenSettings mavenSettings = new MavenSettings(repo, mavenRepository, null, null, null, null); // Read .m2/settings.xml diff --git a/sbm-support-rewrite/src/test/java/org/springframework/sbm/test/util/ParserParityTestHelper.java b/sbm-support-rewrite/src/test/java/org/springframework/sbm/test/util/ParserParityTestHelper.java index 23d705c71..5685ba0ad 100644 --- a/sbm-support-rewrite/src/test/java/org/springframework/sbm/test/util/ParserParityTestHelper.java +++ b/sbm-support-rewrite/src/test/java/org/springframework/sbm/test/util/ParserParityTestHelper.java @@ -32,6 +32,7 @@ import org.springframework.sbm.parsers.RewriteProjectParsingResult; import java.net.URI; +import java.net.URISyntaxException; import java.nio.file.Path; import java.util.*; import java.util.function.BiConsumer; @@ -287,6 +288,17 @@ private void compareMavenResolutionResultMarker(SoftAssertions softAssertions, M f1.getHost().equals(f2.getHost()) && f1.getPath().equals(f2.getPath()) && f1.getFragment().equals(f2.getFragment()); + } else if(fi1 instanceof String) { + try { + URI f1 = new URI((String) fi1); + URI f2 = new URI((String) fi2); + return equals ? true : f1.getScheme().equals(f2.getScheme()) && + f1.getHost() == null ? (f2.getHost() == null ? true : false) : f1.getHost().equals(f2.getHost()) && + f1.getPath().equals(f2.getPath()) && + f1.getFragment().equals(f2.getFragment()); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } } else { return false; }