Skip to content

Commit 9dbfb53

Browse files
committed
[MDEPLOY-301] Switch to the Maven 4 API
1 parent da2ad90 commit 9dbfb53

File tree

47 files changed

+1121
-2469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1121
-2469
lines changed

.github/workflows/maven-verify.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
jobs:
2525
build:
2626
name: Verify
27-
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4
27+
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v3
2828
with:
29-
maven4-enabled: true
30-
29+
ff-maven: "4.0.0-beta-3" # Maven version for fail-fast-build
30+
maven-matrix: '[ "4.0.0-beta-3" ]'

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ on:
2222
- master
2323
jobs:
2424
update_release_draft:
25-
uses: apache/maven-gh-actions-shared/.github/workflows/release-drafter.yml@v4
25+
uses: apache/maven-gh-actions-shared/.github/workflows/release-drafter.yml@v3

pom.xml

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

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

3434
<name>Apache Maven Deploy Plugin</name>
@@ -43,7 +43,7 @@ under the License.
4343
</contributors>
4444

4545
<prerequisites>
46-
<maven>3.6.3</maven>
46+
<maven>${mavenVersion}</maven>
4747
</prerequisites>
4848

4949
<scm>
@@ -68,156 +68,111 @@ under the License.
6868
</distributionManagement>
6969

7070
<properties>
71-
<javaVersion>8</javaVersion>
72-
<mavenVersion>3.9.6</mavenVersion>
71+
<javaVersion>17</javaVersion>
72+
<mavenVersion>4.0.0-beta-3</mavenVersion>
7373
<!-- Keep in sync with resolver used in maven above -->
74-
<slf4jVersion>1.7.36</slf4jVersion>
74+
<slf4jVersion>2.0.13</slf4jVersion>
7575
<!-- Keep in sync with resolver used in maven above -->
76-
<resolverVersion>1.9.20</resolverVersion>
76+
<project.build.outputTimestamp>2022-07-16T16:14:30Z</project.build.outputTimestamp>
7777

7878
<!-- plugins version used in IT tests -->
79-
<mavenAntrunPluginVersion>${version.maven-antrun-plugin}</mavenAntrunPluginVersion>
80-
<mavenCompilerPluginVersion>${version.maven-compiler-plugin}</mavenCompilerPluginVersion>
81-
<mavenEnforcerPluginVersion>${version.maven-enforcer-plugin}</mavenEnforcerPluginVersion>
82-
<mavenInstallPluginVersion>${version.maven-install-plugin}</mavenInstallPluginVersion>
83-
<mavenJarPluginVersion>${version.maven-jar-plugin}</mavenJarPluginVersion>
84-
<mavenJavadocPluginVersion>${version.maven-javadoc-plugin}</mavenJavadocPluginVersion>
85-
<mavenPluginToolsVersion>${version.maven-plugin-tools}</mavenPluginToolsVersion>
86-
<mavenResourcesPluginVersion>${version.maven-resources-plugin}</mavenResourcesPluginVersion>
87-
<mavenSourcePluginVersion>${version.maven-source-plugin}</mavenSourcePluginVersion>
88-
<mavenSurefirePluginVersion>${version.maven-surefire}</mavenSurefirePluginVersion>
89-
<mavenWarPluginVersion>${version.maven-war-plugin}</mavenWarPluginVersion>
90-
91-
<project.build.outputTimestamp>2024-04-26T10:30:44Z</project.build.outputTimestamp>
79+
<mavenAntrunPluginVersion>3.1.0</mavenAntrunPluginVersion>
80+
<mavenCompilerPluginVersion>3.11.0</mavenCompilerPluginVersion>
81+
<mavenEnforcerPluginVersion>3.1.0</mavenEnforcerPluginVersion>
82+
<mavenInstallPluginVersion>3.1.0</mavenInstallPluginVersion>
83+
<mavenJarPluginVersion>3.3.0</mavenJarPluginVersion>
84+
<mavenJavadocPluginVersion>3.4.1</mavenJavadocPluginVersion>
85+
<mavenPluginPluginVersion>4.0.0-SNAPSHOT</mavenPluginPluginVersion>
86+
<mavenPluginTestingHarnessVersion>4.0.0-alpha-3-SNAPSHOT</mavenPluginTestingHarnessVersion>
87+
<mavenResourcesPluginVersion>3.3.0</mavenResourcesPluginVersion>
88+
<mavenSourcePluginVersion>3.2.1</mavenSourcePluginVersion>
89+
<mavenSurefirePluginVersion>${surefire.version}</mavenSurefirePluginVersion>
90+
<mavenWarPluginVersion>3.3.2</mavenWarPluginVersion>
91+
92+
<version.plexus-xml>4.0.1</version.plexus-xml>
93+
94+
<project.build.outputTimestamp>2023-03-21T14:38:01Z</project.build.outputTimestamp>
9295
</properties>
9396

9497
<dependencies>
9598
<dependency>
9699
<groupId>org.apache.maven</groupId>
97-
<artifactId>maven-plugin-api</artifactId>
100+
<artifactId>maven-api-core</artifactId>
98101
<version>${mavenVersion}</version>
99-
<scope>provided</scope>
100102
</dependency>
101103
<dependency>
102104
<groupId>org.apache.maven</groupId>
103-
<artifactId>maven-core</artifactId>
105+
<artifactId>maven-api-model</artifactId>
104106
<version>${mavenVersion}</version>
105-
<scope>provided</scope>
106-
</dependency>
107-
<dependency>
108-
<groupId>org.apache.maven</groupId>
109-
<artifactId>maven-model</artifactId>
110-
<version>${mavenVersion}</version>
111-
<scope>provided</scope>
112-
</dependency>
113-
<dependency>
114-
<groupId>org.apache.maven</groupId>
115-
<artifactId>maven-artifact</artifactId>
116-
<version>${mavenVersion}</version>
117-
<scope>provided</scope>
118-
</dependency>
119-
120-
<dependency>
121-
<groupId>org.slf4j</groupId>
122-
<artifactId>slf4j-api</artifactId>
123-
<version>${slf4jVersion}</version>
124-
<scope>provided</scope>
125-
</dependency>
126-
<dependency>
127-
<groupId>org.codehaus.plexus</groupId>
128-
<artifactId>plexus-utils</artifactId>
129-
</dependency>
130-
<dependency>
131-
<groupId>org.codehaus.plexus</groupId>
132-
<artifactId>plexus-xml</artifactId>
133-
</dependency>
134-
<dependency>
135-
<groupId>org.apache.maven.resolver</groupId>
136-
<artifactId>maven-resolver-api</artifactId>
137-
<version>${resolverVersion}</version>
138-
<scope>provided</scope>
139-
</dependency>
140-
<dependency>
141-
<groupId>org.apache.maven.resolver</groupId>
142-
<artifactId>maven-resolver-util</artifactId>
143-
<version>${resolverVersion}</version>
144-
<!-- To work in Maven versions older than 3.9.0 -->
145-
<scope>compile</scope>
146-
</dependency>
147-
148-
<!-- dependencies to annotations -->
149-
<dependency>
150-
<groupId>org.apache.maven.plugin-tools</groupId>
151-
<artifactId>maven-plugin-annotations</artifactId>
152-
<scope>provided</scope>
153107
</dependency>
108+
<!-- <dependency>-->
109+
<!-- <groupId>jakarta.inject</groupId>-->
110+
<!-- <artifactId>jakarta.inject-api</artifactId>-->
111+
<!-- <version>2.0.1</version>-->
112+
<!-- </dependency>-->
154113

155114
<!-- Test -->
156115
<dependency>
157116
<groupId>org.apache.maven.plugin-testing</groupId>
158117
<artifactId>maven-plugin-testing-harness</artifactId>
159-
<version>3.3.0</version>
118+
<version>${mavenPluginTestingHarnessVersion}</version>
160119
<scope>test</scope>
161120
</dependency>
162121
<dependency>
163-
<!-- used by maven-plugin-testing-harness, don't give it compile scope! -->
164122
<groupId>org.apache.maven</groupId>
165-
<artifactId>maven-compat</artifactId>
166-
<version>${mavenVersion}</version>
167-
<scope>test</scope>
168-
</dependency>
169-
<dependency>
170-
<groupId>org.apache.maven</groupId>
171-
<artifactId>maven-resolver-provider</artifactId>
123+
<artifactId>maven-core</artifactId>
172124
<version>${mavenVersion}</version>
173125
<scope>test</scope>
174126
</dependency>
175-
<dependency>
176-
<groupId>org.apache.maven.resolver</groupId>
177-
<artifactId>maven-resolver-connector-basic</artifactId>
178-
<version>${resolverVersion}</version>
179-
<scope>test</scope>
180-
</dependency>
181-
<dependency>
182-
<groupId>org.apache.maven.resolver</groupId>
183-
<artifactId>maven-resolver-transport-file</artifactId>
184-
<version>${resolverVersion}</version>
185-
<scope>test</scope>
186-
</dependency>
187-
<dependency>
188-
<groupId>org.apache.maven.resolver</groupId>
189-
<artifactId>maven-resolver-transport-http</artifactId>
190-
<version>${resolverVersion}</version>
191-
<scope>test</scope>
192-
</dependency>
193127
<dependency>
194128
<groupId>org.mockito</groupId>
195-
<artifactId>mockito-core</artifactId>
129+
<artifactId>mockito-junit-jupiter</artifactId>
196130
<version>4.11.0</version>
197131
<scope>test</scope>
198132
</dependency>
199133
<dependency>
200-
<groupId>junit</groupId>
201-
<artifactId>junit</artifactId>
202-
<version>4.13.2</version>
134+
<groupId>org.slf4j</groupId>
135+
<artifactId>slf4j-api</artifactId>
136+
<version>${slf4jVersion}</version>
203137
<scope>test</scope>
204138
</dependency>
205139
<dependency>
206140
<groupId>org.slf4j</groupId>
207-
<artifactId>slf4j-nop</artifactId>
141+
<artifactId>slf4j-simple</artifactId>
208142
<version>${slf4jVersion}</version>
209143
<scope>test</scope>
210144
</dependency>
145+
<dependency>
146+
<groupId>org.junit.jupiter</groupId>
147+
<artifactId>junit-jupiter-api</artifactId>
148+
<version>5.10.0</version>
149+
<scope>test</scope>
150+
</dependency>
151+
152+
<!-- <dependency>-->
153+
<!-- <groupId>org.apache.maven.plugin-tools</groupId>-->
154+
<!-- <artifactId>maven-plugin-annotations</artifactId>-->
155+
<!-- <scope>none</scope>-->
156+
<!-- </dependency>-->
157+
211158
</dependencies>
212159

213160
<build>
214161
<plugins>
215162
<plugin>
216163
<groupId>org.apache.maven.plugins</groupId>
217-
<artifactId>maven-compiler-plugin</artifactId>
164+
<artifactId>maven-plugin-plugin</artifactId>
165+
<version>${mavenPluginPluginVersion}</version>
166+
</plugin>
167+
<plugin>
168+
<groupId>com.diffplug.spotless</groupId>
169+
<artifactId>spotless-maven-plugin</artifactId>
218170
<configuration>
219-
<proc>none</proc>
220-
<showDeprecation>true</showDeprecation>
171+
<java>
172+
<includes>
173+
<include>src/**/*.java</include>
174+
</includes>
175+
</java>
221176
</configuration>
222177
</plugin>
223178
</plugins>
@@ -232,6 +187,7 @@ under the License.
232187
<plugin>
233188
<groupId>org.apache.maven.plugins</groupId>
234189
<artifactId>maven-invoker-plugin</artifactId>
190+
<version>3.6.0</version>
235191
<configuration>
236192
<debug>true</debug>
237193
<showErrors>true</showErrors>

src/it/MDEPLOY-178_deployfile-with-embedded-pom/verify.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
import groovy.xml.*;
1920

2021
assert new File( basedir, "target/repo/org/apache/maven/plugins/deploy/its/mdeploy178/1.0/mdeploy178-1.0.jar" ).exists()
2122
File deployedPom = new File( basedir, "target/repo/org/apache/maven/plugins/deploy/its/mdeploy178/1.0/mdeploy178-1.0.pom" )

src/it/MDEPLOY-202_deployfile-with-multiple-executions/verify.groovy

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,6 @@
1717
* under the License.
1818
*/
1919

20-
def expectedDeploys = [
21-
'org/apache/maven/its/mdeploy-170/configperproject/1.0/configperproject-1.0.pom',
22-
'org/apache/maven/plugins/deploy/it/org.eclipse.equinox.common/1.0/org.eclipse.equinox.common-1.0-sources.jar',
23-
'org/apache/maven/plugins/deploy/it/org.eclipse.equinox.common/1.0/org.eclipse.equinox.common-1.0.jar',
24-
'org/apache/maven/plugins/deploy/it/org.eclipse.equinox.common/1.0/org.eclipse.equinox.common-1.0.pom',
25-
'org/apache/maven/plugins/deploy/it/org.eclipse.osgi/1.0/org.eclipse.osgi-1.0-sources.jar',
26-
'org/apache/maven/plugins/deploy/it/org.eclipse.osgi/1.0/org.eclipse.osgi-1.0.jar',
27-
'org/apache/maven/plugins/deploy/it/org.eclipse.osgi/1.0/org.eclipse.osgi-1.0.pom'
28-
]
29-
30-
def repoDir = new File ( basedir, 'target/repo')
31-
32-
def missingDeploys = expectedDeploys.findAll { ! new File(repoDir, it).isFile() }
33-
34-
assert missingDeploys.size() == 0
20+
def buildLog = new File ( basedir, "build.log")
3521

22+
assert buildLog.text =~ /Uploading.*file:target\/repo\/org\/apache\/maven\/plugins\/deploy\/it\/org\.eclipse\.osgi\/1\.0\/org\.eclipse\.osgi-1\.0-sources\.jar/
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package org.apache.maven.test;
2-
31
/*
42
* Licensed to the Apache Software Foundation (ASF) under one
53
* or more contributor license agreements. See the NOTICE file
@@ -9,7 +7,7 @@
97
* "License"); you may not use this file except in compliance
108
* with the License. You may obtain a copy of the License at
119
*
12-
* http://www.apache.org/licenses/LICENSE-2.0
10+
* http://www.apache.org/licenses/LICENSE-2.0
1311
*
1412
* Unless required by applicable law or agreed to in writing,
1513
* software distributed under the License is distributed on an
@@ -18,20 +16,18 @@
1816
* specific language governing permissions and limitations
1917
* under the License.
2018
*/
19+
package org.apache.maven.test;
2120

2221
/**
2322
* Hello World class
2423
*/
25-
public class HelloWorld
26-
{
24+
public class HelloWorld {
2725

2826
/**
2927
* Main method
3028
* @param args Arguments
3129
*/
32-
public static void main( String[] args )
33-
{
34-
System.out.println( "Hello world" );
30+
public static void main(String[] args) {
31+
System.out.println("Hello world");
3532
}
36-
3733
}
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
package org.apache.maven.test;
2-
31
/*
42
* Licensed to the Apache Software Foundation (ASF) under one
53
* or more contributor license agreements. See the NOTICE file
@@ -9,7 +7,7 @@
97
* "License"); you may not use this file except in compliance
108
* with the License. You may obtain a copy of the License at
119
*
12-
* http://www.apache.org/licenses/LICENSE-2.0
10+
* http://www.apache.org/licenses/LICENSE-2.0
1311
*
1412
* Unless required by applicable law or agreed to in writing,
1513
* software distributed under the License is distributed on an
@@ -18,20 +16,18 @@
1816
* specific language governing permissions and limitations
1917
* under the License.
2018
*/
19+
package org.apache.maven.test;
2120

2221
/**
2322
* Hello World class
2423
*/
25-
public class HelloWorld
26-
{
24+
public class HelloWorld {
2725

2826
/**
2927
* Main method
3028
* @param args Arguments
3129
*/
32-
public static void main( String[] args )
33-
{
34-
System.out.println( "Hello world" );
30+
public static void main(String[] args) {
31+
System.out.println("Hello world");
3532
}
36-
3733
}

src/it/deploy-at-end-pass/module1/pom.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,27 @@
2222
</parent>
2323
<artifactId>module1</artifactId>
2424

25+
<build>
26+
<plugins>
27+
<plugin>
28+
<groupId>org.apache.maven.plugins</groupId>
29+
<artifactId>maven-enforcer-plugin</artifactId>
30+
<version>@mavenEnforcerPluginVersion@</version>
31+
<executions>
32+
<execution>
33+
<id>enforce</id>
34+
<goals>
35+
<goal>enforce</goal>
36+
</goals>
37+
<configuration>
38+
<rules>
39+
<AlwaysPass />
40+
</rules>
41+
</configuration>
42+
</execution>
43+
</executions>
44+
</plugin>
45+
</plugins>
46+
</build>
47+
2548
</project>

0 commit comments

Comments
 (0)