Skip to content

Commit

Permalink
Bump to maven-parent 40, maven 3.9.3 and 4.0.0-alpha-7 and maven-reso…
Browse files Browse the repository at this point in the history
…lver 1.9.13 (#858)
  • Loading branch information
gnodet authored Jul 3, 2023
1 parent bf981d6 commit 838b720
Show file tree
Hide file tree
Showing 6 changed files with 239 additions and 58 deletions.
257 changes: 205 additions & 52 deletions daemon-m40/src/main/java/org/apache/maven/cli/DaemonMavenCli.java

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist-m40/src/main/provisio/maven-distro.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
<artifact id="org.slf4j:jul-to-slf4j">
<exclusion id="*:*"/>
</artifact>
<artifact id="org.apache.maven.shared:maven-shared-utils">
<exclusion id="*:*"/>
</artifact>
</artifactSet>

<artifactSet to="/mvn/lib/mvnd">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private static List<Avc> listJars(Path mavenHome) {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ void versionsSet() throws IOException, InterruptedException {
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) {
Expand All @@ -57,7 +68,11 @@ public void accept(Message m) {
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"));
Expand Down
4 changes: 4 additions & 0 deletions logging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
</dependency>

<!-- Logging -->
<dependency>
Expand Down
14 changes: 10 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
<version>39</version>
<version>40</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -88,11 +88,11 @@
<jline.version>3.23.0</jline.version>
<junit.jupiter.version>5.9.2</junit.jupiter.version>
<logback.version>1.2.11</logback.version>
<maven.version>4.0.0-alpha-5</maven.version>
<maven3.version>3.9.1</maven3.version>
<maven.version>4.0.0-alpha-7</maven.version>
<maven3.version>3.9.3</maven3.version>
<maven4.version>${maven.version}</maven4.version>
<!-- Keep in sync with Maven -->
<maven.resolver.version>1.9.7</maven.resolver.version>
<maven.resolver.version>1.9.13</maven.resolver.version>
<slf4j.version>1.7.36</slf4j.version>
<sisu.version>0.9.0.M1</sisu.version>

Expand Down Expand Up @@ -230,6 +230,12 @@
<version>${maven.resolver.version}</version>
</dependency>

<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.4.2</version>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
Expand Down

0 comments on commit 838b720

Please sign in to comment.