Skip to content

Commit

Permalink
[MDEPLOY-301] Switch to the Maven 4 API
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Jun 25, 2024
1 parent 0754039 commit 9bffcf2
Show file tree
Hide file tree
Showing 40 changed files with 1,079 additions and 2,376 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/maven-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ jobs:
name: Verify
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4
with:
maven4-enabled: true

ff-maven: "4.0.0-beta-3" # Maven version for fail-fast-build
maven-matrix: '[ "4.0.0-beta-3" ]'
jdk-matrix: '[ "17", "21" ]'
127 changes: 51 additions & 76 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.3-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>

<name>Apache Maven Deploy Plugin</name>
Expand All @@ -43,7 +43,7 @@ under the License.
</contributors>

<prerequisites>
<maven>3.6.3</maven>
<maven>${mavenVersion}</maven>
</prerequisites>

<scm>
Expand All @@ -68,14 +68,10 @@ under the License.
</distributionManagement>

<properties>
<javaVersion>8</javaVersion>
<mavenVersion>3.9.6</mavenVersion>
<!-- Keep in sync with resolver used in maven above -->
<slf4jVersion>1.7.36</slf4jVersion>
<!-- Keep in sync with resolver used in maven above -->
<resolverVersion>1.9.20</resolverVersion>
<javaVersion>17</javaVersion>
<mavenVersion>4.0.0-beta-3</mavenVersion>

<!-- plugins version used in IT tests -->
<guiceVersion>6.0.0</guiceVersion>
<mavenAntrunPluginVersion>${version.maven-antrun-plugin}</mavenAntrunPluginVersion>
<mavenCompilerPluginVersion>${version.maven-compiler-plugin}</mavenCompilerPluginVersion>
<mavenEnforcerPluginVersion>${version.maven-enforcer-plugin}</mavenEnforcerPluginVersion>
Expand All @@ -87,139 +83,118 @@ under the License.
<mavenSourcePluginVersion>${version.maven-source-plugin}</mavenSourcePluginVersion>
<mavenSurefirePluginVersion>${version.maven-surefire}</mavenSurefirePluginVersion>
<mavenWarPluginVersion>${version.maven-war-plugin}</mavenWarPluginVersion>
<mavenPluginTestingVersion>4.0.0-alpha-3-SNAPSHOT</mavenPluginTestingVersion>
<mavenResolverVersion>2.0.0-alpha-11</mavenResolverVersion>
<mockitoVersion>5.12.0</mockitoVersion>
<slf4jVersion>2.0.13</slf4jVersion>
<version.plexus-xml>4.0.3</version.plexus-xml>
<version.maven-plugin-tools>4.0.0-SNAPSHOT</version.maven-plugin-tools>
<version.maven-invoker-plugin>3.7.0</version.maven-invoker-plugin>

<project.build.outputTimestamp>2024-04-26T10:30:44Z</project.build.outputTimestamp>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.2.1-jre</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<artifactId>maven-api-core</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<artifactId>maven-api-di</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<artifactId>maven-api-meta</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<artifactId>maven-api-model</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.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-api</artifactId>
<version>${resolverVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-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>
</dependency>

<!-- Test -->
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>3.3.0</version>
<version>${mavenPluginTestingVersion}</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-resolver-provider</artifactId>
<version>${mavenVersion}</version>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-api</artifactId>
<version>${mavenResolverVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId>
<version>${resolverVersion}</version>
<groupId>org.apache.maven</groupId>
<artifactId>maven-api-impl</artifactId>
<version>${mavenVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-file</artifactId>
<version>${resolverVersion}</version>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>${guiceVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-transport-http</artifactId>
<version>${resolverVersion}</version>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockitoVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.11.0</version>
<version>${mockitoVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4jVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4jVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<proc>none</proc>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion src/it/deploy-attached-sources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ under the License.
<version>@project.version@</version>
<configuration>
<!-- Deployments will be written to ${basedir}/target -->
<altDeploymentRepository>mine::default::file://${basedir}/target</altDeploymentRepository>
<altDeploymentRepository>mine::default::file://${project.basedir}/target</altDeploymentRepository>
</configuration>
</plugin>
</plugins>
Expand Down
10 changes: 5 additions & 5 deletions src/it/deploy-attached-sources/test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
# under the License.

# Properties passed to invocations of the deploy plugin
pomFile = ${basedir}/pom.xml
pomFile = ${project.basedir}/pom.xml

file = ${basedir}/target/${project.artifactId}-${project.version}.jar
sources = ${basedir}/target/${project.artifactId}-${project.version}-sources.jar
javadoc = ${basedir}/target/${project.artifactId}-${project.version}-javadoc.jar
file = ${project.basedir}/target/${project.artifactId}-${project.version}.jar
sources = ${project.basedir}/target/${project.artifactId}-${project.version}-sources.jar
javadoc = ${project.basedir}/target/${project.artifactId}-${project.version}-javadoc.jar

url = file://${basedir}/target/repo
url = file://${project.basedir}/target/repo
2 changes: 1 addition & 1 deletion src/it/deploy-default-packaging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ under the License.
<version>@project.version@</version>
<configuration>
<!-- Deployments will be written to ${basedir}/target -->
<altDeploymentRepository>mine::default::file://${basedir}/target</altDeploymentRepository>
<altDeploymentRepository>mine::default::file://${project.basedir}/target</altDeploymentRepository>
</configuration>
</plugin>
</plugins>
Expand Down
4 changes: 2 additions & 2 deletions src/it/deploy-default-packaging/test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
groupId = org.apache.maven.test
artifactId = test
version = 1.1
file = ${basedir}/lib/test-1.1.jar
url = file://${basedir}/target/repo
file = ${project.basedir}/lib/test-1.1.jar
url = file://${project.basedir}/target/repo
4 changes: 2 additions & 2 deletions src/it/gav-validation/invoker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
invoker.goals = org.apache.maven.plugins:maven-deploy-plugin:${project.version}:deploy-file
invoker.buildResult = failure

invoker.systemPropertiesFile.1 = test-invalid.properties
invoker.systemPropertiesFile.2 = test-missing.properties
invoker.userPropertiesFile.1 = test-invalid.properties
invoker.userPropertiesFile.2 = test-missing.properties
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>
<pluginRepository>
Expand Down
Loading

0 comments on commit 9bffcf2

Please sign in to comment.