Yet another workaround for #281

This commit is contained in:
Peter Palaga
2021-01-04 17:38:50 +01:00
parent a81aa7c397
commit eb11f64db7
4 changed files with 24 additions and 13 deletions

View File

@@ -375,8 +375,8 @@ public class DependencyGraph<K> {
* Compute the set of nodes reachable from the given {@code node} through the {@code is upstream of} relation. The * Compute the set of nodes reachable from the given {@code node} through the {@code is upstream of} relation. The
* {@code node} itself is not a part of the returned set. * {@code node} itself is not a part of the returned set.
* *
* @param node the node for which the transitive upstream should be computed * @param node the node for which the transitive upstream should be computed
* @return the set of transitive upstreams * @return the set of transitive upstreams
*/ */
Set<K> transitiveUpstreams(K node) { Set<K> transitiveUpstreams(K node) {
Set<K> result = transitiveUpstreams.get(node); Set<K> result = transitiveUpstreams.get(node);

View File

@@ -89,6 +89,7 @@
<os.detected.arch>${os.detected.arch}</os.detected.arch> <os.detected.arch>${os.detected.arch}</os.detected.arch>
<mvnd.test.hostLocalMavenRepo>${settings.localRepository}</mvnd.test.hostLocalMavenRepo> <mvnd.test.hostLocalMavenRepo>${settings.localRepository}</mvnd.test.hostLocalMavenRepo>
<surefire.version>${surefire.version}</surefire.version> <surefire.version>${surefire.version}</surefire.version>
<junit-platform-launcher.version>${junit-platform-launcher.version}</junit-platform-launcher.version>
</systemPropertyVariables> </systemPropertyVariables>
</configuration> </configuration>
</plugin> </plugin>
@@ -172,6 +173,7 @@
<os.detected.arch>${os.detected.arch}</os.detected.arch> <os.detected.arch>${os.detected.arch}</os.detected.arch>
<mvnd.test.hostLocalMavenRepo>${settings.localRepository}</mvnd.test.hostLocalMavenRepo> <mvnd.test.hostLocalMavenRepo>${settings.localRepository}</mvnd.test.hostLocalMavenRepo>
<surefire.version>${surefire.version}</surefire.version> <surefire.version>${surefire.version}</surefire.version>
<junit-platform-launcher.version>${junit-platform-launcher.version}</junit-platform-launcher.version>
</systemPropertyVariables> </systemPropertyVariables>
</configuration> </configuration>
</execution> </execution>

View File

@@ -230,20 +230,28 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback,
private static void prefillLocalRepo(final Path localMavenRepository) { private static void prefillLocalRepo(final Path localMavenRepository) {
/* Workaround for https://github.com/mvndaemon/mvnd/issues/281 */ /* Workaround for https://github.com/mvndaemon/mvnd/issues/281 */
final String surefireVersion = System.getProperty("surefire.version"); final String surefireVersion = System.getProperty("surefire.version");
final String junitPlatformLauncherVersion = System.getProperty("junit-platform-launcher.version");
final Path hostLocalMavenRepo = Paths.get(System.getProperty("mvnd.test.hostLocalMavenRepo")); final Path hostLocalMavenRepo = Paths.get(System.getProperty("mvnd.test.hostLocalMavenRepo"));
Stream.of( Stream.of(
"org/apache/maven/surefire/surefire-providers/" + surefireVersion + "/surefire-providers-" "org/apache/maven/surefire/surefire-providers/" + surefireVersion,
+ surefireVersion + ".pom", "org/junit/platform/junit-platform-launcher/" + junitPlatformLauncherVersion)
"org/apache/maven/surefire/surefire-providers/" + surefireVersion + "/surefire-providers-"
+ surefireVersion + ".pom.sha1")
.forEach(relPath -> { .forEach(relPath -> {
final Path src = hostLocalMavenRepo.resolve(relPath); final Path src = hostLocalMavenRepo.resolve(relPath);
final Path dest = localMavenRepository.resolve(relPath); if (Files.isDirectory(src)) {
try { try (Stream<Path> files = Files.list(src)) {
Files.createDirectories(dest.getParent()); files.forEach(file -> {
Files.copy(src, dest); final Path dest = localMavenRepository.resolve(relPath).resolve(file.getFileName());
} catch (IOException e) { try {
throw new UncheckedIOException(e); Files.createDirectories(dest.getParent());
Files.copy(src, dest);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
});
} catch (IOException e) {
throw new UncheckedIOException(e);
}
} }
}); });
} }

View File

@@ -59,7 +59,8 @@
<maven-jar-plugin.version>3.2.0</maven-jar-plugin.version> <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
<maven-install-plugin.version>2.4</maven-install-plugin.version> <maven-install-plugin.version>2.4</maven-install-plugin.version>
<mrm.version>1.2.0</mrm.version> <mrm.version>1.2.0</mrm.version>
<surefire.version>2.22.2</surefire.version> <surefire.version>2.22.2</surefire.version><!-- keep in sync with junit-platform-launcher.version -->
<junit-platform-launcher.version>1.3.1</junit-platform-launcher.version><!-- keep in sync with surefire.version -->
<takari-lifecycle.version>1.13.9</takari-lifecycle.version> <takari-lifecycle.version>1.13.9</takari-lifecycle.version>
<takari-provisio.version>1.0.15</takari-provisio.version> <takari-provisio.version>1.0.15</takari-provisio.version>