Skip to content

Commit 9a79090

Browse files
committed
[MDEPLOY-301] Switch to maven 4 and the new api
1 parent 2de56bd commit 9a79090

File tree

35 files changed

+936
-1962
lines changed

35 files changed

+936
-1962
lines changed

.github/workflows/maven-verify.yml

+3
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@v3
28+
with:
29+
ff-maven: "4.0.0-alpha-4" # Maven version for fail-fast-build
30+
maven-matrix: '[ "4.0.0-alpha-4" ]'

pom.xml

+58-78
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.1-SNAPSHOT</version>
31+
<version>4.0.0-SNAPSHOT</version>
3232
<packaging>maven-plugin</packaging>
3333

3434
<name>Apache Maven Deploy Plugin</name>
@@ -69,11 +69,13 @@ under the License.
6969

7070
<properties>
7171
<javaVersion>8</javaVersion>
72-
<mavenVersion>3.2.5</mavenVersion>
72+
<mavenVersion>4.0.0-alpha-4</mavenVersion>
7373
<!-- Keep in sync with resolver used in maven above -->
7474
<slf4jVersion>1.7.5</slf4jVersion>
7575
<!-- Keep in sync with resolver used in maven above -->
76-
<resolverVersion>1.0.0.v20140518</resolverVersion>
76+
<resolverVersion>1.9.4</resolverVersion>
77+
<!-- Keep in sync with resolver used in maven above -->
78+
<project.build.outputTimestamp>2022-07-16T16:14:30Z</project.build.outputTimestamp>
7779

7880
<!-- plugins version used in IT tests -->
7981
<mavenAntrunPluginVersion>3.1.0</mavenAntrunPluginVersion>
@@ -82,7 +84,7 @@ under the License.
8284
<mavenInstallPluginVersion>3.1.0</mavenInstallPluginVersion>
8385
<mavenJarPluginVersion>3.3.0</mavenJarPluginVersion>
8486
<mavenJavadocPluginVersion>3.4.1</mavenJavadocPluginVersion>
85-
<mavenPluginToolsVersion>${maven.plugin.tools.version}</mavenPluginToolsVersion>
87+
<mavenPluginToolsVersion>3.8.1</mavenPluginToolsVersion>
8688
<mavenResourcesPluginVersion>3.3.0</mavenResourcesPluginVersion>
8789
<mavenSourcePluginVersion>3.2.1</mavenSourcePluginVersion>
8890
<mavenSurefirePluginVersion>${surefire.version}</mavenSurefirePluginVersion>
@@ -94,110 +96,66 @@ under the License.
9496
<dependencies>
9597
<dependency>
9698
<groupId>org.apache.maven</groupId>
97-
<artifactId>maven-plugin-api</artifactId>
98-
<version>${mavenVersion}</version>
99-
<scope>provided</scope>
100-
</dependency>
101-
<dependency>
102-
<groupId>org.apache.maven</groupId>
103-
<artifactId>maven-core</artifactId>
104-
<version>${mavenVersion}</version>
105-
<scope>provided</scope>
106-
</dependency>
107-
<dependency>
108-
<groupId>org.apache.maven</groupId>
109-
<artifactId>maven-model</artifactId>
99+
<artifactId>maven-api-core</artifactId>
110100
<version>${mavenVersion}</version>
111101
<scope>provided</scope>
112102
</dependency>
113103
<dependency>
114104
<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>
128105
<artifactId>plexus-utils</artifactId>
129-
</dependency>
130-
<dependency>
131-
<groupId>org.eclipse.aether</groupId>
132-
<artifactId>aether-api</artifactId>
133-
<version>${resolverVersion}</version>
134-
<scope>provided</scope>
135-
</dependency>
136-
<dependency>
137-
<groupId>org.eclipse.aether</groupId>
138-
<artifactId>aether-util</artifactId>
139-
<version>${resolverVersion}</version>
140-
<!-- To work in Maven versions older than 3.9.0 -->
141-
<scope>compile</scope>
142-
</dependency>
143-
144-
<!-- dependencies to annotations -->
145-
<dependency>
146-
<groupId>org.apache.maven.plugin-tools</groupId>
147-
<artifactId>maven-plugin-annotations</artifactId>
148-
<scope>provided</scope>
106+
<version>${mavenVersion}</version>
149107
</dependency>
150108

151109
<!-- Test -->
152110
<dependency>
153111
<groupId>org.apache.maven.plugin-testing</groupId>
154112
<artifactId>maven-plugin-testing-harness</artifactId>
155-
<version>3.3.0</version>
113+
<version>4.0.0-alpha-1</version>
156114
<scope>test</scope>
157115
</dependency>
158116
<dependency>
159117
<!-- used by maven-plugin-testing-harness, don't give it compile scope! -->
160118
<groupId>org.apache.maven</groupId>
161-
<artifactId>maven-compat</artifactId>
119+
<artifactId>maven-core</artifactId>
162120
<version>${mavenVersion}</version>
163121
<scope>test</scope>
164122
</dependency>
165123
<dependency>
166124
<groupId>org.apache.maven</groupId>
167-
<artifactId>maven-aether-provider</artifactId>
125+
<artifactId>maven-resolver-provider</artifactId>
168126
<version>${mavenVersion}</version>
169127
<scope>test</scope>
170128
</dependency>
171-
<dependency>
172-
<groupId>org.eclipse.aether</groupId>
173-
<artifactId>aether-connector-basic</artifactId>
174-
<version>${resolverVersion}</version>
175-
<scope>test</scope>
176-
</dependency>
177-
<dependency>
178-
<groupId>org.eclipse.aether</groupId>
179-
<artifactId>aether-transport-file</artifactId>
180-
<version>${resolverVersion}</version>
181-
<scope>test</scope>
182-
</dependency>
183-
<dependency>
184-
<groupId>org.eclipse.aether</groupId>
185-
<artifactId>aether-transport-http</artifactId>
186-
<version>${resolverVersion}</version>
187-
<scope>test</scope>
188-
</dependency>
129+
<!-- <dependency>-->
130+
<!-- <groupId>org.apache.maven.resolver</groupId>-->
131+
<!-- <artifactId>maven-resolver-connector-basic</artifactId>-->
132+
<!-- <version>${resolverVersion}</version>-->
133+
<!-- <scope>test</scope>-->
134+
<!-- </dependency>-->
135+
<!-- <dependency>-->
136+
<!-- <groupId>org.apache.maven.resolver</groupId>-->
137+
<!-- <artifactId>maven-resolver-transport-file</artifactId>-->
138+
<!-- <version>${resolverVersion}</version>-->
139+
<!-- <scope>test</scope>-->
140+
<!-- </dependency>-->
141+
<!-- <dependency>-->
142+
<!-- <groupId>org.apache.maven.resolver</groupId>-->
143+
<!-- <artifactId>maven-resolver-transport-http</artifactId>-->
144+
<!-- <version>${resolverVersion}</version>-->
145+
<!-- <scope>test</scope>-->
146+
<!-- </dependency>-->
147+
<!-- <dependency>-->
148+
<!-- <groupId>org.mockito</groupId>-->
149+
<!-- <artifactId>mockito-core</artifactId>-->
150+
<!-- <version>2.28.2</version>-->
151+
<!-- <scope>test</scope>-->
152+
<!-- </dependency>-->
189153
<dependency>
190154
<groupId>org.mockito</groupId>
191-
<artifactId>mockito-core</artifactId>
155+
<artifactId>mockito-junit-jupiter</artifactId>
192156
<version>2.28.2</version>
193157
<scope>test</scope>
194158
</dependency>
195-
<dependency>
196-
<groupId>junit</groupId>
197-
<artifactId>junit</artifactId>
198-
<version>4.13.2</version>
199-
<scope>test</scope>
200-
</dependency>
201159
<dependency>
202160
<groupId>org.slf4j</groupId>
203161
<artifactId>slf4j-nop</artifactId>
@@ -207,6 +165,27 @@ under the License.
207165

208166
</dependencies>
209167

168+
<build>
169+
<plugins>
170+
<plugin>
171+
<groupId>org.apache.maven.plugins</groupId>
172+
<artifactId>maven-plugin-plugin</artifactId>
173+
<version>${mavenPluginToolsVersion}</version>
174+
</plugin>
175+
<plugin>
176+
<groupId>com.diffplug.spotless</groupId>
177+
<artifactId>spotless-maven-plugin</artifactId>
178+
<configuration>
179+
<java>
180+
<includes>
181+
<include>src/**/*.java</include>
182+
</includes>
183+
</java>
184+
</configuration>
185+
</plugin>
186+
</plugins>
187+
</build>
188+
210189
<profiles>
211190
<profile>
212191
<id>run-its</id>
@@ -216,6 +195,7 @@ under the License.
216195
<plugin>
217196
<groupId>org.apache.maven.plugins</groupId>
218197
<artifactId>maven-invoker-plugin</artifactId>
198+
<version>3.5.0</version>
219199
<configuration>
220200
<debug>true</debug>
221201
<showErrors>true</showErrors>

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

+1
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" )
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
}
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

+23
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>
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,21 +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
3129
*/
32-
public static void main( String[] args )
33-
{
34-
System.out.println( "Hello world" );
35-
30+
public static void main(String[] args) {
31+
System.out.println("Hello world");
3632
}
37-
3833
}

src/it/settings.xml

+4
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ 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
</repositories>
@@ -44,9 +46,11 @@ under the License.
4446
<url>@localRepositoryUrl@</url>
4547
<releases>
4648
<enabled>true</enabled>
49+
<checksumPolicy>ignore</checksumPolicy>
4750
</releases>
4851
<snapshots>
4952
<enabled>true</enabled>
53+
<checksumPolicy>ignore</checksumPolicy>
5054
</snapshots>
5155
</pluginRepository>
5256
</pluginRepositories>

0 commit comments

Comments
 (0)