diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 6a8adf529..641fe816d 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -33,6 +33,15 @@
11
11
${project.basedir}/../dist/target/mvnd-${project.version}-${os.detected.name}-${os.detected.arch}
+
+ org/apache/maven/surefire/surefire-providers/${surefire.version}
+ org/apache/maven/surefire/surefire-junit-platform/${surefire.version}
+ org/junit/platform/junit-platform-launcher/${junit-platform-launcher.version}
+ org/junit/platform/junit-platform-engine/${junit-platform-launcher.version}
+ org/junit/jupiter/junit-jupiter/${junit.jupiter.version}
+ org/junit/jupiter/junit-jupiter-api/${junit.jupiter.version}
+
+
@@ -88,8 +97,7 @@
${os.detected.name}
${os.detected.arch}
${settings.localRepository}
- ${surefire.version}
- ${junit-platform-launcher.version}
+ ${preinstall.artifacts}
@@ -172,8 +180,7 @@
${os.detected.name}
${os.detected.arch}
${settings.localRepository}
- ${surefire.version}
- ${junit-platform-launcher.version}
+ ${preinstall.artifacts}
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DaemonCrashTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DaemonCrashTest.java
index 91524039c..a91468b2a 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DaemonCrashTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/DaemonCrashTest.java
@@ -50,7 +50,6 @@ void cleanInstall() throws IOException, InterruptedException {
}
final Path localMavenRepo = parameters.mavenRepoLocal();
- TestUtils.deleteDir(localMavenRepo);
final Path[] installedJars = {
localMavenRepo.resolve(
"org/mvndaemon/mvnd/test/daemon-crash/daemon-crash-maven-plugin/0.0.1-SNAPSHOT/daemon-crash-maven-plugin-0.0.1-SNAPSHOT.jar"),
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ModuleAndPluginNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ModuleAndPluginNativeIT.java
index b90beddaa..82ae6409d 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ModuleAndPluginNativeIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/ModuleAndPluginNativeIT.java
@@ -51,7 +51,6 @@ void cleanInstall() throws IOException, InterruptedException {
});
final Path localMavenRepo = parameters.mavenRepoLocal();
- TestUtils.deleteDir(localMavenRepo);
final Path[] installedJars = {
localMavenRepo.resolve(
"org/mvndaemon/mvnd/test/module-and-plugin/module-and-plugin-maven-plugin/0.0.1-SNAPSHOT/module-and-plugin-maven-plugin-0.0.1-SNAPSHOT.jar"),
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MultiModuleTest.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MultiModuleTest.java
index 26527a5b6..03e438dfd 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MultiModuleTest.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/MultiModuleTest.java
@@ -59,7 +59,6 @@ void cleanInstall() throws IOException, InterruptedException {
});
final Path localMavenRepo = parameters.mavenRepoLocal();
- TestUtils.deleteDir(localMavenRepo);
final Path[] installedJars = {
localMavenRepo.resolve(
"org/mvndaemon/mvnd/test/multi-module/multi-module-api/0.0.1-SNAPSHOT/multi-module-api-0.0.1-SNAPSHOT.jar"),
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleNativeIT.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleNativeIT.java
index e9fd7e761..8294e1fc5 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleNativeIT.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/it/SingleModuleNativeIT.java
@@ -49,7 +49,6 @@ void cleanInstall() throws IOException, InterruptedException {
}
final Path localMavenRepo = parameters.mavenRepoLocal();
- TestUtils.deleteDir(localMavenRepo);
final Path installedJar = localMavenRepo.resolve(
"org/mvndaemon/mvnd/test/single-module/single-module/0.0.1-SNAPSHOT/single-module-0.0.1-SNAPSHOT.jar");
Assertions.assertThat(installedJar).doesNotExist();
diff --git a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTestExtension.java b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTestExtension.java
index 77862bd91..c07186892 100644
--- a/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTestExtension.java
+++ b/integration-tests/src/test/java/org/mvndaemon/mvnd/junit/MvndTestExtension.java
@@ -229,12 +229,10 @@ public static MvndResource create(String className, String rawProjectDir, boolea
private static void prefillLocalRepo(final Path localMavenRepository) {
/* Workaround for https://github.com/mvndaemon/mvnd/issues/281 */
- final String surefireVersion = System.getProperty("surefire.version");
- final String junitPlatformLauncherVersion = System.getProperty("junit-platform-launcher.version");
+ final String preinstallArtifacts = System.getProperty("preinstall.artifacts").trim();
final Path hostLocalMavenRepo = Paths.get(System.getProperty("mvnd.test.hostLocalMavenRepo"));
- Stream.of(
- "org/apache/maven/surefire/surefire-providers/" + surefireVersion,
- "org/junit/platform/junit-platform-launcher/" + junitPlatformLauncherVersion)
+
+ Stream.of(preinstallArtifacts.split("[\\s,]+"))
.forEach(relPath -> {
final Path src = hostLocalMavenRepo.resolve(relPath);
if (Files.isDirectory(src)) {
@@ -243,7 +241,7 @@ private static void prefillLocalRepo(final Path localMavenRepository) {
final Path dest = localMavenRepository.resolve(relPath).resolve(file.getFileName());
try {
Files.createDirectories(dest.getParent());
- Files.copy(src, dest);
+ Files.copy(file, dest);
} catch (IOException e) {
throw new UncheckedIOException(e);
}