Bump to maven-parent 40, maven 3.9.3 and 4.0.0-alpha-7 and maven-resolver 1.9.13 (#858)

This commit is contained in:
Guillaume Nodet
2023-07-03 16:27:23 +02:00
committed by GitHub
parent bf981d6ce0
commit 838b720342
6 changed files with 239 additions and 58 deletions

View File

@@ -81,7 +81,7 @@ public class DistroIT {
static class Avc implements Comparable<Avc> {
private static final Pattern JAR_NAME_PATTERN =
Pattern.compile("^(.*)(?:-([0-9]+(?:\\.[0-9]+)*))(?:-(.*))?.jar$");
Pattern.compile("^(.*)(?:-([0-9]+(?:\\.[0-9]+)*))(?:[-.](.*))?.jar$");
public static Avc of(String jarName) {
final Matcher m = JAR_NAME_PATTERN.matcher(jarName);

View File

@@ -48,6 +48,17 @@ public class InteractiveTest {
MvndTestUtil.version(parameters.multiModuleProjectDirectory().resolve("pom.xml"));
Assertions.assertEquals("0.0.1-SNAPSHOT", version);
final TestClientOutput output = new TestClientOutput();
client.execute(output, "-v").assertSuccess();
output.describeTerminal();
String mavenVersion = output.getMessages().stream()
.filter(m -> m.getType() == Message.BUILD_LOG_MESSAGE)
.map(m -> ((Message.StringMessage) m).getMessage())
.filter(s -> s.matches("[\\s\\S]*Apache Maven ([0-9][^ ]*) [\\s\\S]*"))
.map(s -> s.replaceAll("[\\s\\S]*Apache Maven ([0-9][^ ]*) [\\s\\S]*", "$1"))
.findFirst()
.get();
final TestClientOutput o = new TestClientOutput() {
@Override
public void accept(Message m) {
@@ -57,7 +68,11 @@ public class InteractiveTest {
super.accept(m);
}
};
client.execute(o, "versions:set").assertSuccess();
if (mavenVersion.startsWith("4")) {
client.execute(o, "--force-interactive", "versions:set").assertSuccess();
} else {
client.execute(o, "versions:set").assertSuccess();
}
final String newVersion =
MvndTestUtil.version(parameters.multiModuleProjectDirectory().resolve("pom.xml"));