mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-26 05:58:27 +00:00
Yet another workaround for #281
This commit is contained in:
@@ -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
|
||||
* {@code node} itself is not a part of the returned set.
|
||||
*
|
||||
* @param node the node for which the transitive upstream should be computed
|
||||
* @return the set of transitive upstreams
|
||||
* @param node the node for which the transitive upstream should be computed
|
||||
* @return the set of transitive upstreams
|
||||
*/
|
||||
Set<K> transitiveUpstreams(K node) {
|
||||
Set<K> result = transitiveUpstreams.get(node);
|
||||
|
@@ -89,6 +89,7 @@
|
||||
<os.detected.arch>${os.detected.arch}</os.detected.arch>
|
||||
<mvnd.test.hostLocalMavenRepo>${settings.localRepository}</mvnd.test.hostLocalMavenRepo>
|
||||
<surefire.version>${surefire.version}</surefire.version>
|
||||
<junit-platform-launcher.version>${junit-platform-launcher.version}</junit-platform-launcher.version>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
</plugin>
|
||||
@@ -172,6 +173,7 @@
|
||||
<os.detected.arch>${os.detected.arch}</os.detected.arch>
|
||||
<mvnd.test.hostLocalMavenRepo>${settings.localRepository}</mvnd.test.hostLocalMavenRepo>
|
||||
<surefire.version>${surefire.version}</surefire.version>
|
||||
<junit-platform-launcher.version>${junit-platform-launcher.version}</junit-platform-launcher.version>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
@@ -230,20 +230,28 @@ public class MvndTestExtension implements BeforeAllCallback, BeforeEachCallback,
|
||||
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 Path hostLocalMavenRepo = Paths.get(System.getProperty("mvnd.test.hostLocalMavenRepo"));
|
||||
Stream.of(
|
||||
"org/apache/maven/surefire/surefire-providers/" + surefireVersion + "/surefire-providers-"
|
||||
+ surefireVersion + ".pom",
|
||||
"org/apache/maven/surefire/surefire-providers/" + surefireVersion + "/surefire-providers-"
|
||||
+ surefireVersion + ".pom.sha1")
|
||||
"org/apache/maven/surefire/surefire-providers/" + surefireVersion,
|
||||
"org/junit/platform/junit-platform-launcher/" + junitPlatformLauncherVersion)
|
||||
.forEach(relPath -> {
|
||||
final Path src = hostLocalMavenRepo.resolve(relPath);
|
||||
final Path dest = localMavenRepository.resolve(relPath);
|
||||
try {
|
||||
Files.createDirectories(dest.getParent());
|
||||
Files.copy(src, dest);
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
if (Files.isDirectory(src)) {
|
||||
try (Stream<Path> files = Files.list(src)) {
|
||||
files.forEach(file -> {
|
||||
final Path dest = localMavenRepository.resolve(relPath).resolve(file.getFileName());
|
||||
try {
|
||||
Files.createDirectories(dest.getParent());
|
||||
Files.copy(src, dest);
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
|
||||
});
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
3
pom.xml
3
pom.xml
@@ -59,7 +59,8 @@
|
||||
<maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
|
||||
<maven-install-plugin.version>2.4</maven-install-plugin.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-provisio.version>1.0.15</takari-provisio.version>
|
||||
|
||||
|
Reference in New Issue
Block a user