Skip to content

Commit 9dc957d

Browse files
committed
[MCOMPILER-593] Switch to Maven 4 API
1 parent 7df998f commit 9dc957d

File tree

34 files changed

+1689
-1495
lines changed

34 files changed

+1689
-1495
lines changed

.github/workflows/maven-verify.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ jobs:
2727
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4
2828
with:
2929
# maven-args: "-Dinvoker.parallelThreads=2" cannot do this as this generate some concurrent download issues
30+
ff-maven: "4.0.0-beta-3" # Maven version for fail-fast-build
3031
jdk-distribution-matrix: '[ "temurin", "zulu", "microsoft", "adopt-openj9" ]'
31-
jdk-matrix: '[ "8", "11", "17", "21" ]'
32-
matrix-exclude: '[
33-
{ "jdk": "8", "distribution": "microsoft" },
34-
{ "jdk": "8", "distribution": "temurin", "os": "macos-latest" },
35-
{ "jdk": "8", "distribution": "adopt-openj9", "os": "macos-latest" }
36-
]'
37-
maven-matrix: '[ "3.6.3", "3.8.8", "3.9.6" ]' # Maven versions matrix for verify builds
32+
jdk-matrix: '[ "17", "21" ]'
33+
maven-matrix: '[ "4.0.0-beta-3" ]' # Maven versions matrix for verify builds

pom.xml

Lines changed: 94 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ under the License.
2828
</parent>
2929

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

3434
<name>Apache Maven Compiler Plugin</name>
@@ -67,145 +67,173 @@ under the License.
6767
</distributionManagement>
6868

6969
<properties>
70-
<mavenVersion>3.6.3</mavenVersion>
71-
<plexusCompilerVersion>2.15.0</plexusCompilerVersion>
70+
<javaVersion>17</javaVersion>
71+
<mavenVersion>4.0.0-beta-3</mavenVersion>
7272

73+
<asmVersion>9.7</asmVersion>
7374
<groovyVersion>2.4.21</groovyVersion>
7475
<groovyEclipseCompilerVersion>3.7.0</groovyEclipseCompilerVersion>
7576
<groovy-eclipse-batch>2.5.14-02</groovy-eclipse-batch>
76-
<plexus-java.version>1.2.0</plexus-java.version>
77-
<javaVersion>8</javaVersion>
77+
<guiceVersion>6.0.0</guiceVersion>
78+
<junit4Version>4.13.2</junit4Version>
79+
<junitVersion>5.10.1</junitVersion>
80+
<mockitoVersion>5.12.0</mockitoVersion>
81+
<mavenPluginTestingHarnessVersion>4.0.0-alpha-3-SNAPSHOT</mavenPluginTestingHarnessVersion>
82+
<plexusCompilerVersion>2.15.0</plexusCompilerVersion>
83+
<plexusJavaVersion>1.2.0</plexusJavaVersion>
84+
<sisuPlexusVersion>0.9.0.M2</sisuPlexusVersion>
85+
<slf4jVersion>2.0.13</slf4jVersion>
86+
<surefire.version>3.2.1</surefire.version>
87+
<version.maven-invoker-plugin>3.7.0</version.maven-invoker-plugin>
88+
<version.maven-plugin-tools-3.x>3.13.1</version.maven-plugin-tools-3.x>
89+
<version.maven-plugin-tools>4.0.0-SNAPSHOT</version.maven-plugin-tools>
90+
<version.plexus-xml>4.0.1</version.plexus-xml>
91+
92+
<invoker.junitPackageName>org.apache.maven.plugins.compiler.its</invoker.junitPackageName>
7893
<maven.it.failure.ignore>false</maven.it.failure.ignore>
94+
7995
<project.build.outputTimestamp>2024-03-15T07:28:09Z</project.build.outputTimestamp>
80-
<invoker.junitPackageName>org.apache.maven.plugins.compiler.its</invoker.junitPackageName>
8196
</properties>
8297

98+
<dependencyManagement>
99+
<dependencies>
100+
<dependency>
101+
<groupId>com.google.guava</groupId>
102+
<artifactId>guava</artifactId>
103+
<version>32.0.1-jre</version>
104+
</dependency>
105+
</dependencies>
106+
</dependencyManagement>
107+
83108
<dependencies>
109+
<!-- Maven -->
84110
<dependency>
85-
<groupId>org.apache.maven.plugin-tools</groupId>
86-
<artifactId>maven-plugin-annotations</artifactId>
111+
<groupId>org.apache.maven</groupId>
112+
<artifactId>maven-api-core</artifactId>
113+
<version>${mavenVersion}</version>
87114
<scope>provided</scope>
88115
</dependency>
89-
<!-- Maven -->
90116
<dependency>
91117
<groupId>org.apache.maven</groupId>
92-
<artifactId>maven-plugin-api</artifactId>
118+
<artifactId>maven-api-di</artifactId>
93119
<version>${mavenVersion}</version>
94120
<scope>provided</scope>
95121
</dependency>
96122
<dependency>
97123
<groupId>org.apache.maven</groupId>
98-
<artifactId>maven-artifact</artifactId>
124+
<artifactId>maven-api-meta</artifactId>
99125
<version>${mavenVersion}</version>
100126
<scope>provided</scope>
101127
</dependency>
102128
<dependency>
103129
<groupId>org.apache.maven</groupId>
104-
<artifactId>maven-core</artifactId>
130+
<artifactId>maven-api-model</artifactId>
105131
<version>${mavenVersion}</version>
106132
<scope>provided</scope>
107133
</dependency>
108134
<dependency>
109-
<groupId>org.apache.maven.shared</groupId>
110-
<artifactId>maven-shared-utils</artifactId>
111-
<version>3.4.2</version>
135+
<groupId>org.codehaus.plexus</groupId>
136+
<artifactId>plexus-utils</artifactId>
112137
</dependency>
113138
<dependency>
114-
<groupId>org.apache.maven.shared</groupId>
115-
<artifactId>maven-shared-incremental</artifactId>
116-
<version>1.1</version>
117-
<exclusions>
118-
<exclusion>
119-
<groupId>org.apache.maven</groupId>
120-
<artifactId>maven-core</artifactId>
121-
</exclusion>
122-
<exclusion>
123-
<groupId>org.apache.maven</groupId>
124-
<artifactId>maven-plugin-api</artifactId>
125-
</exclusion>
126-
<exclusion>
127-
<groupId>org.apache.maven.shared</groupId>
128-
<artifactId>maven-shared-utils</artifactId>
129-
</exclusion>
130-
<exclusion>
131-
<groupId>org.codehaus.plexus</groupId>
132-
<artifactId>plexus-component-annotations</artifactId>
133-
</exclusion>
134-
</exclusions>
139+
<groupId>org.eclipse.sisu</groupId>
140+
<artifactId>org.eclipse.sisu.plexus</artifactId>
141+
<version>${sisuPlexusVersion}</version>
135142
</dependency>
136-
137143
<dependency>
138144
<groupId>org.codehaus.plexus</groupId>
139145
<artifactId>plexus-java</artifactId>
140-
<version>${plexus-java.version}</version>
146+
<version>${plexusJavaVersion}</version>
147+
</dependency>
148+
<dependency>
149+
<groupId>org.ow2.asm</groupId>
150+
<artifactId>asm</artifactId>
151+
<version>${asmVersion}</version>
141152
</dependency>
142153

143154
<dependency>
144155
<groupId>org.codehaus.plexus</groupId>
145156
<artifactId>plexus-compiler-api</artifactId>
146157
<version>${plexusCompilerVersion}</version>
158+
<exclusions>
159+
<exclusion>
160+
<groupId>org.codehaus.plexus</groupId>
161+
<artifactId>plexus-component-api</artifactId>
162+
</exclusion>
163+
</exclusions>
147164
</dependency>
148165
<dependency>
149166
<groupId>org.codehaus.plexus</groupId>
150167
<artifactId>plexus-compiler-manager</artifactId>
151168
<version>${plexusCompilerVersion}</version>
169+
<exclusions>
170+
<exclusion>
171+
<groupId>org.codehaus.plexus</groupId>
172+
<artifactId>plexus-component-api</artifactId>
173+
</exclusion>
174+
</exclusions>
152175
</dependency>
153176
<dependency>
154177
<groupId>org.codehaus.plexus</groupId>
155178
<artifactId>plexus-compiler-javac</artifactId>
156179
<version>${plexusCompilerVersion}</version>
157-
<scope>runtime</scope>
180+
<exclusions>
181+
<exclusion>
182+
<groupId>org.codehaus.plexus</groupId>
183+
<artifactId>plexus-component-api</artifactId>
184+
</exclusion>
185+
</exclusions>
158186
</dependency>
187+
159188
<dependency>
160-
<groupId>org.codehaus.plexus</groupId>
161-
<artifactId>plexus-utils</artifactId>
189+
<groupId>org.apache.maven</groupId>
190+
<artifactId>maven-core</artifactId>
191+
<version>${mavenVersion}</version>
192+
<scope>test</scope>
162193
</dependency>
163-
164194
<dependency>
165-
<groupId>org.apache.maven.plugin-testing</groupId>
166-
<artifactId>maven-plugin-testing-harness</artifactId>
167-
<version>4.0.0-alpha-2</version>
195+
<groupId>org.apache.maven</groupId>
196+
<artifactId>maven-api-impl</artifactId>
197+
<version>${mavenVersion}</version>
168198
<scope>test</scope>
169199
</dependency>
170200
<dependency>
171-
<!-- used by maven-plugin-testing-harness -->
172-
<groupId>org.codehaus.plexus</groupId>
173-
<artifactId>plexus-xml</artifactId>
201+
<groupId>com.google.inject</groupId>
202+
<artifactId>guice</artifactId>
203+
<version>${guiceVersion}</version>
204+
<scope>test</scope>
205+
</dependency>
206+
<dependency>
207+
<groupId>org.apache.maven.plugin-testing</groupId>
208+
<artifactId>maven-plugin-testing-harness</artifactId>
209+
<version>${mavenPluginTestingHarnessVersion}</version>
174210
<scope>test</scope>
175211
</dependency>
176212
<dependency>
177213
<groupId>org.mockito</groupId>
178214
<artifactId>mockito-core</artifactId>
179-
<version>4.8.0</version>
215+
<version>${mockitoVersion}</version>
180216
<scope>test</scope>
181217
</dependency>
182218
<dependency>
183219
<groupId>org.junit.jupiter</groupId>
184220
<artifactId>junit-jupiter-api</artifactId>
185-
<version>5.10.2</version>
186221
<scope>test</scope>
187222
</dependency>
188223
<dependency>
189-
<groupId>org.junit.jupiter</groupId>
190-
<artifactId>junit-jupiter-params</artifactId>
191-
<version>5.10.2</version>
224+
<groupId>junit</groupId>
225+
<artifactId>junit</artifactId>
226+
<version>${junit4Version}</version>
227+
<scope>test</scope>
228+
</dependency>
229+
<dependency>
230+
<groupId>org.slf4j</groupId>
231+
<artifactId>slf4j-simple</artifactId>
232+
<version>${slf4jVersion}</version>
192233
<scope>test</scope>
193234
</dependency>
194235
</dependencies>
195236

196-
<repositories>
197-
<repository>
198-
<releases>
199-
<enabled>false</enabled>
200-
</releases>
201-
<snapshots>
202-
<enabled>true</enabled>
203-
</snapshots>
204-
<id>plexus.snapshots</id>
205-
<url>https://oss.sonatype.org/content/repositories/plexus-snapshots</url>
206-
</repository>
207-
</repositories>
208-
209237
<build>
210238
<pluginManagement>
211239
<plugins>
@@ -227,13 +255,6 @@ under the License.
227255
</plugin>
228256
</plugins>
229257
</pluginManagement>
230-
231-
<plugins>
232-
<plugin>
233-
<groupId>org.eclipse.sisu</groupId>
234-
<artifactId>sisu-maven-plugin</artifactId>
235-
</plugin>
236-
</plugins>
237258
</build>
238259

239260
<profiles>

src/it/MCOMPILER-192/verify.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ assert logFile.exists()
2222
def content = logFile.getText('UTF-8')
2323

2424
def causedByExpected = content.contains ( 'Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure' )
25-
def twoFilesBeingCompiled = content.contains ( '[INFO] Compiling 2 source files with javac ' )
25+
def twoFilesBeingCompiled = content.contains ( '[INFO] Compiling 2 source files ' )
2626
def checkResult = content.contains ( '[INFO] BUILD FAILURE' )
2727
def compilationFailure1 = content.contains( '[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:')
2828

src/it/MCOMPILER-525/invoker.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818
# NOTE: The first time, we run up to "integration-test" phase which includes the AntRun execution which saves the
1919
# timestamp of the first JAR for comparison with the timestamp of the JAR from the final "package" invocation.
2020
# Note:
21-
invoker.goals = clean integration-test package -Dmaven.compiler.showCompilationChanges=true
21+
invoker.goals.1 = clean integration-test
22+
invoker.goals.2 = package -Dmaven.compiler.showCompilationChanges=true

src/it/mcompiler-106/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ under the License.
3131
<version>@project.version@</version>
3232
<configuration>
3333
<fork>true</fork>
34-
<compilerArguments>
35-
<Xlint />
36-
<Averbose>true</Averbose>
37-
</compilerArguments>
34+
<compilerArgs>
35+
<arg>-Xlint</arg>
36+
<arg>-Averbose=true</arg>
37+
</compilerArgs>
3838
</configuration>
3939
</plugin>
4040
</plugins>

src/it/settings.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,21 @@ under the License.
3232
<url>@localRepositoryUrl@</url>
3333
<releases>
3434
<enabled>true</enabled>
35+
<checksumPolicy>ignore</checksumPolicy>
3536
</releases>
3637
<snapshots>
3738
<enabled>true</enabled>
39+
<checksumPolicy>ignore</checksumPolicy>
3840
</snapshots>
3941
</repository>
4042
<repository>
4143
<releases>
4244
<enabled>false</enabled>
45+
<checksumPolicy>ignore</checksumPolicy>
4346
</releases>
4447
<snapshots>
4548
<enabled>true</enabled>
49+
<checksumPolicy>ignore</checksumPolicy>
4650
</snapshots>
4751
<id>plexus-snapshots</id>
4852
<name>Plexus Snapshot Repository</name>
@@ -55,9 +59,11 @@ under the License.
5559
<url>@localRepositoryUrl@</url>
5660
<releases>
5761
<enabled>true</enabled>
62+
<checksumPolicy>ignore</checksumPolicy>
5863
</releases>
5964
<snapshots>
6065
<enabled>true</enabled>
66+
<checksumPolicy>ignore</checksumPolicy>
6167
</snapshots>
6268
</pluginRepository>
6369
</pluginRepositories>

src/it/setup_annotation-verify-plugin/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<dependency>
3030
<groupId>org.apache.maven.plugin-tools</groupId>
3131
<artifactId>maven-plugin-annotations</artifactId>
32-
<version>@version.maven-plugin-tools@</version>
32+
<version>@version.maven-plugin-tools-3.x@</version>
3333
<scope>provided</scope>
3434
</dependency>
3535
<dependency>
@@ -96,7 +96,7 @@
9696
<plugin>
9797
<groupId>org.apache.maven.plugins</groupId>
9898
<artifactId>maven-plugin-plugin</artifactId>
99-
<version>@version.maven-plugin-tools@</version>
99+
<version>@version.maven-plugin-tools-3.x@</version>
100100
<configuration>
101101
<goalPrefix>annotation-verify</goalPrefix>
102102
</configuration>

0 commit comments

Comments
 (0)