Skip to content

Commit

Permalink
Yet another workaround for apache#281
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalaga committed Jan 4, 2021
1 parent a81aa7c commit eb11f64
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ DependencyGraph<K> reduce() {
* 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);
Expand Down
2 changes: 2 additions & 0 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,20 +230,28 @@ 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 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);
}
}
});
}
Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down

0 comments on commit eb11f64

Please sign in to comment.