diff --git a/src/main/java/ch/ivyteam/ivy/maven/compile/CompileTestProjectMojo.java b/src/main/java/ch/ivyteam/ivy/maven/compile/CompileTestProjectMojo.java index 554243eb..80c5ca0e 100644 --- a/src/main/java/ch/ivyteam/ivy/maven/compile/CompileTestProjectMojo.java +++ b/src/main/java/ch/ivyteam/ivy/maven/compile/CompileTestProjectMojo.java @@ -18,9 +18,11 @@ import java.io.File; import java.nio.file.Files; +import java.nio.file.Path; import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; @@ -52,8 +54,7 @@ protected void engineExec(MavenProjectBuilderProxy projectBuilder) throws Except } getLog().info("Compiling test sources..."); - Map result = projectBuilder.testCompile(project.getBasedir(), getDependencyIarJars(), - getOptions()); + Map result = projectBuilder.testCompile(project.getBasedir(), getDependencyIarJars(), getOptions()); CompilerResult.store(result, project); } @@ -65,8 +66,7 @@ private List getDependencyIarJars() { if (!Files.exists(iarJarClasspath)) { return Collections.emptyList(); } - List iarJars = new ClasspathJar(iarJarClasspath).getFiles(); - return iarJars; + var iarJars = new ClasspathJar(iarJarClasspath).getFiles(); + return iarJars.stream().map(Path::toFile).collect(Collectors.toList()); } - } diff --git a/src/main/java/ch/ivyteam/ivy/maven/util/ClasspathJar.java b/src/main/java/ch/ivyteam/ivy/maven/util/ClasspathJar.java index 3cf94169..ee434103 100644 --- a/src/main/java/ch/ivyteam/ivy/maven/util/ClasspathJar.java +++ b/src/main/java/ch/ivyteam/ivy/maven/util/ClasspathJar.java @@ -90,15 +90,15 @@ private static List getClassPathUris(Collection classpathEntries) .collect(Collectors.toList()); } - public List getFiles() { + public List getFiles() { String urlClasspath = getClasspathUrlEntries(); if (StringUtils.isBlank(urlClasspath)) { return Collections.emptyList(); } - List files = new ArrayList<>(); + var files = new ArrayList(); for (String entry : urlClasspath.split(" ")) { - files.add(new File(uriToAbsoluteFilePath(entry))); + files.add(new File(uriToAbsoluteFilePath(entry)).toPath()); } return files; }