Skip to content

Commit 3716fc1

Browse files
authored
[MRESOURCES-308] Switch to the Maven 4 API (#35)
1 parent 9b76379 commit 3716fc1

File tree

31 files changed

+973
-772
lines changed

31 files changed

+973
-772
lines changed

.github/workflows/maven-verify.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ 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" ]'
31+
jdk-matrix: '[ "17", "21" ]'

pom.xml

Lines changed: 58 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +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>
27+
<relativePath />
2728
</parent>
2829

2930
<artifactId>maven-resources-plugin</artifactId>
30-
<version>3.3.2-SNAPSHOT</version>
31+
<version>4.0.0-SNAPSHOT</version>
3132
<packaging>maven-plugin</packaging>
3233

3334
<name>Apache Maven Resources Plugin</name>
@@ -71,116 +72,104 @@ under the License.
7172
</distributionManagement>
7273

7374
<properties>
74-
<mavenFilteringVersion>3.3.2</mavenFilteringVersion>
75-
<mavenVersion>3.2.5</mavenVersion>
76-
<javaVersion>8</javaVersion>
75+
<mavenVersion>4.0.0-beta-3</mavenVersion>
76+
<javaVersion>17</javaVersion>
77+
78+
<mavenFilteringVersion>4.0.0-SNAPSHOT</mavenFilteringVersion>
79+
<mavenPluginPluginVersion>4.0.0-SNAPSHOT</mavenPluginPluginVersion>
80+
<mavenPluginTestingVersion>4.0.0-alpha-3-SNAPSHOT</mavenPluginTestingVersion>
81+
<plexusBuildApiVersion>0.0.7</plexusBuildApiVersion>
82+
<version.maven-invoker-plugin>3.7.0</version.maven-invoker-plugin>
83+
<version.maven-plugin-tools>${mavenPluginPluginVersion}</version.maven-plugin-tools>
84+
7785
<project.build.outputTimestamp>2023-03-21T12:01:37Z</project.build.outputTimestamp>
7886
</properties>
7987

8088
<dependencies>
8189
<dependency>
8290
<groupId>org.apache.maven</groupId>
83-
<artifactId>maven-plugin-api</artifactId>
91+
<artifactId>maven-api-core</artifactId>
8492
<version>${mavenVersion}</version>
8593
<scope>provided</scope>
8694
</dependency>
8795
<dependency>
8896
<groupId>org.apache.maven</groupId>
89-
<artifactId>maven-core</artifactId>
97+
<artifactId>maven-api-meta</artifactId>
9098
<version>${mavenVersion}</version>
9199
<scope>provided</scope>
92100
</dependency>
93101
<dependency>
94102
<groupId>org.apache.maven</groupId>
95-
<artifactId>maven-model</artifactId>
103+
<artifactId>maven-api-model</artifactId>
96104
<version>${mavenVersion}</version>
97105
<scope>provided</scope>
98106
</dependency>
99107
<dependency>
100108
<groupId>org.apache.maven</groupId>
101-
<artifactId>maven-settings</artifactId>
109+
<artifactId>maven-api-di</artifactId>
102110
<version>${mavenVersion}</version>
103111
<scope>provided</scope>
104112
</dependency>
105-
<dependency>
106-
<groupId>org.apache.maven.plugin-tools</groupId>
107-
<artifactId>maven-plugin-annotations</artifactId>
108-
<scope>provided</scope>
109-
</dependency>
110-
<dependency>
111-
<groupId>org.codehaus.plexus</groupId>
112-
<artifactId>plexus-interpolation</artifactId>
113-
<version>1.27</version>
114-
<scope>runtime</scope>
115-
</dependency>
116-
<dependency>
117-
<groupId>org.eclipse.sisu</groupId>
118-
<artifactId>org.eclipse.sisu.plexus</artifactId>
119-
<version>0.3.5</version>
120-
<scope>provided</scope>
121-
</dependency>
122-
<dependency>
123-
<groupId>org.codehaus.plexus</groupId>
124-
<artifactId>plexus-utils</artifactId>
125-
<scope>test</scope>
126-
</dependency>
127-
<dependency>
128-
<groupId>org.codehaus.plexus</groupId>
129-
<artifactId>plexus-xml</artifactId>
130-
<scope>test</scope>
131-
</dependency>
132113
<dependency>
133114
<groupId>org.apache.maven.shared</groupId>
134115
<artifactId>maven-filtering</artifactId>
135116
<version>${mavenFilteringVersion}</version>
136117
</dependency>
137118
<dependency>
138-
<groupId>commons-io</groupId>
139-
<artifactId>commons-io</artifactId>
140-
<version>2.16.0</version>
141-
<scope>test</scope>
119+
<groupId>org.sonatype.plexus</groupId>
120+
<artifactId>plexus-build-api</artifactId>
121+
<version>${plexusBuildApiVersion}</version>
142122
</dependency>
123+
143124
<dependency>
144-
<groupId>org.apache.commons</groupId>
145-
<artifactId>commons-lang3</artifactId>
146-
<version>3.14.0</version>
147-
<scope>compile</scope>
125+
<groupId>org.apache.maven.plugin-testing</groupId>
126+
<artifactId>maven-plugin-testing-harness</artifactId>
127+
<version>${mavenPluginTestingVersion}</version>
128+
<scope>test</scope>
148129
</dependency>
149-
150130
<dependency>
151-
<groupId>org.apache.maven</groupId>
152-
<artifactId>maven-compat</artifactId>
153-
<version>${mavenVersion}</version>
131+
<groupId>org.junit.jupiter</groupId>
132+
<artifactId>junit-jupiter-api</artifactId>
154133
<scope>test</scope>
155134
</dependency>
156135
<dependency>
157-
<groupId>org.apache.maven.plugin-testing</groupId>
158-
<artifactId>maven-plugin-testing-harness</artifactId>
159-
<version>3.3.0</version>
136+
<groupId>org.apache.maven</groupId>
137+
<artifactId>maven-core</artifactId>
138+
<version>${mavenVersion}</version>
160139
<scope>test</scope>
161140
</dependency>
162141
<dependency>
163-
<groupId>junit</groupId>
164-
<artifactId>junit</artifactId>
165-
<version>4.13.2</version>
142+
<groupId>org.apache.maven</groupId>
143+
<artifactId>maven-api-impl</artifactId>
144+
<version>${mavenVersion}</version>
166145
<scope>test</scope>
167146
</dependency>
168147
<dependency>
169-
<groupId>org.apache.maven.resolver</groupId>
170-
<artifactId>maven-resolver-api</artifactId>
171-
<version>1.6.3</version>
148+
<groupId>com.google.inject</groupId>
149+
<artifactId>guice</artifactId>
150+
<version>6.0.0</version>
172151
<scope>test</scope>
173152
</dependency>
174153
<dependency>
175-
<groupId>org.slf4j</groupId>
176-
<artifactId>slf4j-simple</artifactId>
177-
<version>1.7.36</version>
154+
<groupId>org.codehaus.plexus</groupId>
155+
<artifactId>plexus-utils</artifactId>
178156
<scope>test</scope>
179157
</dependency>
180158
</dependencies>
181159

182160
<build>
183161
<plugins>
162+
<plugin>
163+
<groupId>com.diffplug.spotless</groupId>
164+
<artifactId>spotless-maven-plugin</artifactId>
165+
<configuration>
166+
<java>
167+
<includes>
168+
<include>src/**/*.java</include>
169+
</includes>
170+
</java>
171+
</configuration>
172+
</plugin>
184173
<plugin>
185174
<groupId>org.apache.rat</groupId>
186175
<artifactId>apache-rat-plugin</artifactId>
@@ -191,6 +180,15 @@ under the License.
191180
</excludes>
192181
</configuration>
193182
</plugin>
183+
<plugin>
184+
<groupId>org.apache.maven.plugins</groupId>
185+
<artifactId>maven-plugin-plugin</artifactId>
186+
<version>${mavenPluginPluginVersion}</version>
187+
</plugin>
188+
<plugin>
189+
<groupId>org.apache.maven.plugins</groupId>
190+
<artifactId>maven-surefire-plugin</artifactId>
191+
</plugin>
194192
</plugins>
195193
</build>
196194

@@ -221,26 +219,6 @@ under the License.
221219
</plugin>
222220
</plugins>
223221
</pluginManagement>
224-
<plugins>
225-
<plugin>
226-
<groupId>org.eclipse.sisu</groupId>
227-
<artifactId>sisu-maven-plugin</artifactId>
228-
</plugin>
229-
<!--
230-
! The following is used within the src/it/user-filters test.
231-
-->
232-
<plugin>
233-
<groupId>org.apache.maven.plugins</groupId>
234-
<artifactId>maven-jar-plugin</artifactId>
235-
<executions>
236-
<execution>
237-
<goals>
238-
<goal>test-jar</goal>
239-
</goals>
240-
</execution>
241-
</executions>
242-
</plugin>
243-
</plugins>
244222
</build>
245223
</profile>
246224
</profiles>

src/it/MRESOURCES-131/src/main/java/org/apache/maven/plugins/resources/it/App.java

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
package org.apache.maven.plugins.resources.it;
220

321
/*
@@ -23,10 +41,8 @@
2341
* Hello world!
2442
*
2543
*/
26-
public class App
27-
{
28-
public static void main( String[] args )
29-
{
30-
System.out.println( "Hello World!" );
44+
public class App {
45+
public static void main(String[] args) {
46+
System.out.println("Hello World!");
3147
}
3248
}

src/it/MRESOURCES-131/src/test/java/org/apache/maven/plugins/resources/it/AppTest.java

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
119
package org.apache.maven.plugins.resources.it;
220

321
/*
@@ -26,32 +44,27 @@
2644
/**
2745
* Unit test for simple App.
2846
*/
29-
public class AppTest
30-
extends TestCase
31-
{
47+
public class AppTest extends TestCase {
3248
/**
3349
* Create the test case
3450
*
3551
* @param testName name of the test case
3652
*/
37-
public AppTest( String testName )
38-
{
39-
super( testName );
53+
public AppTest(String testName) {
54+
super(testName);
4055
}
4156

4257
/**
4358
* @return the suite of tests being tested
4459
*/
45-
public static Test suite()
46-
{
47-
return new TestSuite( AppTest.class );
60+
public static Test suite() {
61+
return new TestSuite(AppTest.class);
4862
}
4963

5064
/**
5165
* Rigourous Test :-)
5266
*/
53-
public void testApp()
54-
{
55-
assertTrue( true );
67+
public void testApp() {
68+
assertTrue(true);
5669
}
5770
}

src/it/MRESOURCES-18/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ under the License.
5757
</plugin>
5858
<plugin>
5959
<artifactId>maven-surefire-plugin</artifactId>
60-
<version>2.4.3</version>
60+
<version>3.2.1</version>
6161
<configuration>
6262
<systemProperties>
6363
<!-- pass this system property through to the tests -->

0 commit comments

Comments
 (0)