From 718a6b3b8e41fae01aac8a8842fa9889bd86773d Mon Sep 17 00:00:00 2001 From: Rodin Aarssen Date: Tue, 27 Aug 2024 09:43:41 +0200 Subject: [PATCH] Correctly extracting class path from maven output --- src/org/rascalmpl/library/util/PathConfig.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/org/rascalmpl/library/util/PathConfig.java b/src/org/rascalmpl/library/util/PathConfig.java index 709c44e2885..40ad6d38f31 100644 --- a/src/org/rascalmpl/library/util/PathConfig.java +++ b/src/org/rascalmpl/library/util/PathConfig.java @@ -634,10 +634,6 @@ private static ISourceLocation setTargetScheme(ISourceLocation projectLoc) { } } - - private static final Pattern FIND_CLASS_PATH = Pattern.compile("org.apache.maven.plugins.dependency.fromDependencies.BuildClasspathMojo - Dependencies classpath:\\s+(.+)$", Pattern.MULTILINE); - - /** * See if there is a pom.xml and extract the compile-time classpath from a mvn run * if there is such a file. @@ -663,11 +659,9 @@ private static IList getPomXmlCompilerClasspath(ISourceLocation manifestRoot) { maven.doMain(buildRequest(new String[] {"-o", "dependency:build-classpath", "-DincludeScope=compile", "-Dmdep.outputFile=" + tempFile.toString()}, manifestRoot)); - var mavenOutput = Files.readAllLines(tempFile); - var match = FIND_CLASS_PATH.matcher(mavenOutput.get(0)); - var foundClassPath = match.find() ? match.group(1) : ""; + var foundClassPath = Files.readAllLines(tempFile); - return Arrays.stream(foundClassPath.split(File.pathSeparator)) + return Arrays.stream(foundClassPath.get(0).split(File.pathSeparator)) .filter(fileName -> new File(fileName).exists()) .map(elem -> { try {