diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 6a8adf529..043200d95 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -88,8 +88,14 @@
${os.detected.name}
${os.detected.arch}
${settings.localRepository}
- ${surefire.version}
- ${junit-platform-launcher.version}
+
+ 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}
+
@@ -172,8 +178,13 @@
${os.detected.name}
${os.detected.arch}
${settings.localRepository}
- ${surefire.version}
- ${junit-platform-launcher.version}
+
+ org/apache/maven/surefire/surefire-providers/${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}
+
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);
}