Skip to content

Commit

Permalink
[MDEPLOY-301] Switch to maven 4 and the new api
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Feb 27, 2023
1 parent 2de56bd commit 9a79090
Show file tree
Hide file tree
Showing 35 changed files with 936 additions and 1,962 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/maven-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ jobs:
build:
name: Verify
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v3
with:
ff-maven: "4.0.0-alpha-4" # Maven version for fail-fast-build
maven-matrix: '[ "4.0.0-alpha-4" ]'
136 changes: 58 additions & 78 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ under the License.
</parent>

<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>

<name>Apache Maven Deploy Plugin</name>
Expand Down Expand Up @@ -69,11 +69,13 @@ under the License.

<properties>
<javaVersion>8</javaVersion>
<mavenVersion>3.2.5</mavenVersion>
<mavenVersion>4.0.0-alpha-4</mavenVersion>
<!-- Keep in sync with resolver used in maven above -->
<slf4jVersion>1.7.5</slf4jVersion>
<!-- Keep in sync with resolver used in maven above -->
<resolverVersion>1.0.0.v20140518</resolverVersion>
<resolverVersion>1.9.4</resolverVersion>
<!-- Keep in sync with resolver used in maven above -->
<project.build.outputTimestamp>2022-07-16T16:14:30Z</project.build.outputTimestamp>

<!-- plugins version used in IT tests -->
<mavenAntrunPluginVersion>3.1.0</mavenAntrunPluginVersion>
Expand All @@ -82,7 +84,7 @@ under the License.
<mavenInstallPluginVersion>3.1.0</mavenInstallPluginVersion>
<mavenJarPluginVersion>3.3.0</mavenJarPluginVersion>
<mavenJavadocPluginVersion>3.4.1</mavenJavadocPluginVersion>
<mavenPluginToolsVersion>${maven.plugin.tools.version}</mavenPluginToolsVersion>
<mavenPluginToolsVersion>3.8.1</mavenPluginToolsVersion>
<mavenResourcesPluginVersion>3.3.0</mavenResourcesPluginVersion>
<mavenSourcePluginVersion>3.2.1</mavenSourcePluginVersion>
<mavenSurefirePluginVersion>${surefire.version}</mavenSurefirePluginVersion>
Expand All @@ -94,110 +96,66 @@ under the License.
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<artifactId>maven-api-core</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4jVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-api</artifactId>
<version>${resolverVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-util</artifactId>
<version>${resolverVersion}</version>
<!-- To work in Maven versions older than 3.9.0 -->
<scope>compile</scope>
</dependency>

<!-- dependencies to annotations -->
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<scope>provided</scope>
<version>${mavenVersion}</version>
</dependency>

<!-- Test -->
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>3.3.0</version>
<version>4.0.0-alpha-1</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- used by maven-plugin-testing-harness, don't give it compile scope! -->
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<artifactId>maven-core</artifactId>
<version>${mavenVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-aether-provider</artifactId>
<artifactId>maven-resolver-provider</artifactId>
<version>${mavenVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-connector-basic</artifactId>
<version>${resolverVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-transport-file</artifactId>
<version>${resolverVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.aether</groupId>
<artifactId>aether-transport-http</artifactId>
<version>${resolverVersion}</version>
<scope>test</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.maven.resolver</groupId>-->
<!-- <artifactId>maven-resolver-connector-basic</artifactId>-->
<!-- <version>${resolverVersion}</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.maven.resolver</groupId>-->
<!-- <artifactId>maven-resolver-transport-file</artifactId>-->
<!-- <version>${resolverVersion}</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.maven.resolver</groupId>-->
<!-- <artifactId>maven-resolver-transport-http</artifactId>-->
<!-- <version>${resolverVersion}</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.mockito</groupId>-->
<!-- <artifactId>mockito-core</artifactId>-->
<!-- <version>2.28.2</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>2.28.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
Expand All @@ -207,6 +165,27 @@ under the License.

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>${mavenPluginToolsVersion}</version>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<configuration>
<java>
<includes>
<include>src/**/*.java</include>
</includes>
</java>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>run-its</id>
Expand All @@ -216,6 +195,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<debug>true</debug>
<showErrors>true</showErrors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import groovy.xml.*;

assert new File( basedir, "target/repo/org/apache/maven/plugins/deploy/its/mdeploy178/1.0/mdeploy178-1.0.jar" ).exists()
File deployedPom = new File( basedir, "target/repo/org/apache/maven/plugins/deploy/its/mdeploy178/1.0/mdeploy178-1.0.pom" )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package org.apache.maven.test;

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -9,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
Expand All @@ -18,20 +16,18 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.test;

/**
* Hello World class
*/
public class HelloWorld
{
public class HelloWorld {

/**
* Main method
* @param args Arguments
*/
public static void main( String[] args )
{
System.out.println( "Hello world" );
public static void main(String[] args) {
System.out.println("Hello world");
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package org.apache.maven.test;

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -9,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
Expand All @@ -18,20 +16,18 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.test;

/**
* Hello World class
*/
public class HelloWorld
{
public class HelloWorld {

/**
* Main method
* @param args Arguments
*/
public static void main( String[] args )
{
System.out.println( "Hello world" );
public static void main(String[] args) {
System.out.println("Hello world");
}

}
23 changes: 23 additions & 0 deletions src/it/deploy-at-end-pass/module1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,27 @@
</parent>
<artifactId>module1</artifactId>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>@mavenEnforcerPluginVersion@</version>
<executions>
<execution>
<id>enforce</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<AlwaysPass />
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package org.apache.maven.test;

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
Expand All @@ -9,7 +7,7 @@
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
Expand All @@ -18,21 +16,18 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.maven.test;

/**
* Hello World class
*/
public class HelloWorld
{
public class HelloWorld {

/**
* Main method
* @param args
*/
public static void main( String[] args )
{
System.out.println( "Hello world" );

public static void main(String[] args) {
System.out.println("Hello world");
}

}
4 changes: 4 additions & 0 deletions src/it/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ under the License.
<url>@localRepositoryUrl@</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
</repository>
</repositories>
Expand All @@ -44,9 +46,11 @@ under the License.
<url>@localRepositoryUrl@</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
Expand Down

0 comments on commit 9a79090

Please sign in to comment.