Skip to content

Commit 0c4cf79

Browse files
committed
[MSOURCES-149] Switch to the Maven 4 API
IT MSOURCES-140 is broken because of apache/maven#1587
1 parent 68b3dcb commit 0c4cf79

31 files changed

Lines changed: 540 additions & 1313 deletions

.github/workflows/maven-verify.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ jobs:
2525
build:
2626
name: Verify
2727
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4
28+
with:
29+
ff-maven: "4.0.0-beta-3" # Maven version for fail-fast-build
30+
maven-matrix: '[ "4.0.0-beta-3" ]'

pom.xml

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ under the License.
2323
<parent>
2424
<groupId>org.apache.maven.plugins</groupId>
2525
<artifactId>maven-plugins</artifactId>
26-
<version>41</version>
26+
<version>42</version>
2727
<relativePath />
2828
</parent>
2929

3030
<artifactId>maven-source-plugin</artifactId>
31-
<version>3.3.2-SNAPSHOT</version>
31+
<version>4.0.0-SNAPSHOT</version>
3232
<packaging>maven-plugin</packaging>
3333

3434
<name>Apache Maven Source Plugin</name>
@@ -77,92 +77,78 @@ under the License.
7777
</distributionManagement>
7878

7979
<properties>
80-
<javaVersion>8</javaVersion>
81-
<mavenVersion>3.2.5</mavenVersion>
82-
<project.build.outputTimestamp>2024-03-30T01:49:10Z</project.build.outputTimestamp>
80+
<javaVersion>17</javaVersion>
81+
<mavenVersion>4.0.0-beta-3</mavenVersion>
82+
<project.build.outputTimestamp>2023-05-17T21:31:27Z</project.build.outputTimestamp>
8383
</properties>
8484

8585
<dependencyManagement>
8686
<dependencies>
8787
<dependency>
8888
<groupId>commons-io</groupId>
8989
<artifactId>commons-io</artifactId>
90-
<version>2.16.1</version>
90+
<version>2.11.0</version>
9191
</dependency>
9292
</dependencies>
9393
</dependencyManagement>
9494

9595
<dependencies>
9696
<dependency>
9797
<groupId>org.apache.maven</groupId>
98-
<artifactId>maven-model</artifactId>
98+
<artifactId>maven-api-core</artifactId>
9999
<version>${mavenVersion}</version>
100100
<scope>provided</scope>
101101
</dependency>
102-
<dependency>
103-
<groupId>org.apache.maven</groupId>
104-
<artifactId>maven-plugin-api</artifactId>
105-
<version>${mavenVersion}</version>
106-
<scope>provided</scope>
107-
</dependency>
108-
<dependency>
109-
<groupId>org.apache.maven</groupId>
110-
<artifactId>maven-artifact</artifactId>
111-
<version>${mavenVersion}</version>
112-
<scope>provided</scope>
113-
</dependency>
114-
<dependency>
115-
<groupId>org.apache.maven</groupId>
116-
<artifactId>maven-core</artifactId>
117-
<version>${mavenVersion}</version>
118-
<scope>provided</scope>
119-
</dependency>
120-
121-
<!-- dependencies to annotations -->
122-
<dependency>
123-
<groupId>org.apache.maven.plugin-tools</groupId>
124-
<artifactId>maven-plugin-annotations</artifactId>
125-
<scope>provided</scope>
126-
</dependency>
127102

128103
<dependency>
129104
<groupId>org.apache.maven</groupId>
130105
<artifactId>maven-archiver</artifactId>
131-
<version>3.6.2</version>
106+
<version>4.0.0-SNAPSHOT</version>
132107
</dependency>
133108
<dependency>
134109
<groupId>org.codehaus.plexus</groupId>
135110
<artifactId>plexus-archiver</artifactId>
136-
<version>4.9.2</version>
111+
<version>4.8.0</version>
137112
</dependency>
138113
<dependency>
139114
<groupId>org.codehaus.plexus</groupId>
140115
<artifactId>plexus-utils</artifactId>
141-
<version>3.5.1</version>
116+
<version>4.0.0</version>
142117
</dependency>
143118

144119
<dependency>
145120
<groupId>org.apache.maven.plugin-testing</groupId>
146121
<artifactId>maven-plugin-testing-harness</artifactId>
147-
<version>3.3.0</version>
122+
<version>4.0.0-alpha-3-SNAPSHOT</version>
148123
<scope>test</scope>
149124
</dependency>
150125
<dependency>
151126
<groupId>org.apache.maven</groupId>
152-
<artifactId>maven-compat</artifactId>
127+
<artifactId>maven-core</artifactId>
153128
<version>${mavenVersion}</version>
154129
<scope>test</scope>
155130
</dependency>
156131
<dependency>
157-
<groupId>junit</groupId>
158-
<artifactId>junit</artifactId>
159-
<version>4.13.2</version>
132+
<groupId>com.google.inject</groupId>
133+
<artifactId>guice</artifactId>
134+
<version>6.0.0</version>
135+
<scope>test</scope>
136+
</dependency>
137+
<dependency>
138+
<groupId>org.junit.jupiter</groupId>
139+
<artifactId>junit-jupiter</artifactId>
140+
<version>5.10.1</version>
160141
<scope>test</scope>
161142
</dependency>
162143
</dependencies>
163144

164145
<build>
165146
<plugins>
147+
<plugin>
148+
<groupId>org.apache.maven.plugins</groupId>
149+
<artifactId>maven-plugin-plugin</artifactId>
150+
<version>4.0.0-SNAPSHOT</version>
151+
</plugin>
166152
<plugin>
167153
<groupId>org.apache.rat</groupId>
168154
<artifactId>apache-rat-plugin</artifactId>

src/it/MSOURCES-121/verify.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919

2020
File buildLog = new File( basedir, 'build.log' )
2121

22-
assert buildLog.text =~ /\[ERROR\] Artifact org.apache.maven.its.sources:jar-no-fork:java-source:sources:1.0-SNAPSHOT already attached to a file target.jar-no-fork-1.0-SNAPSHOT-sources.jar: attach to target.jar-no-fork-1.0-SNAPSHOT-secondary-sources.jar should be done with another classifier/
22+
assert buildLog.text =~ /\[ERROR\] Artifact org.apache.maven.its.sources:jar-no-fork:jar:sources:1.0-SNAPSHOT already attached to a file target\/jar-no-fork-1.0-SNAPSHOT-sources.jar: attach to target\/jar-no-fork-1.0-SNAPSHOT-secondary-sources.jar should be done with another classifier/

src/it/MSOURCES-140/invoker.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@
1616
# under the License.
1717
invoker.buildResult = success
1818
invoker.goals = package clean install
19+
20+
# maven 4.0.0-beta-3 is broken because of https://github.com/apache/maven/pull/1587
21+
invoker.maven.version = 4.0.0-beta-4+

src/it/MSOURCES-140/verify.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919

2020
File buildLog = new File( basedir, 'build.log' )
2121

22-
assert buildLog.text =~ /\[INFO\] Artifact org.apache.maven.its.sources:jar-no-fork:java-source:sources:1.0-SNAPSHOT already attached to target.jar-no-fork-1.0-SNAPSHOT-sources.jar: ignoring same re-attach \(same artifact, same file\)/
22+
assert buildLog.text =~ /\[INFO\] Artifact org.apache.maven.its.sources:jar-no-fork:jar:sources:1.0-SNAPSHOT already attached to target\/jar-no-fork-1.0-SNAPSHOT-sources.jar: ignoring same re-attach \(same artifact, same file\)/

src/it/MSOURCES-62/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ under the License.
4141
<phase>package</phase>
4242
<configuration>
4343
<archive>
44-
<index>true</index>
4544
<addMavenDescriptor>false</addMavenDescriptor>
4645
<compress>true</compress>
4746
<manifestEntries>

0 commit comments

Comments
 (0)