Skip to content

Commit

Permalink
[MSHARED-1200] Switch to the Maven 4 API
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Jun 22, 2024
1 parent 9d528d0 commit 23f3fbe
Show file tree
Hide file tree
Showing 37 changed files with 1,459 additions and 1,329 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/maven-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ jobs:
build:
name: Verify
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4
with:
ff-maven: "4.0.0-beta-3" # Maven version for fail-fast-build
maven-matrix: '[ "4.0.0-beta-3" ]'
jdk-matrix: '[ "17", "21" ]'
ff-goal: verify
verify-goal: verify
75 changes: 23 additions & 52 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</parent>

<artifactId>maven-filtering</artifactId>
<version>3.3.3-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>

<name>Apache Maven Filtering</name>
<description>A component to assist in filtering of resource files with properties from a Maven project.</description>
Expand Down Expand Up @@ -61,17 +61,18 @@
</distributionManagement>

<properties>
<mavenVersion>3.6.3</mavenVersion>
<slf4jVersion>1.7.36</slf4jVersion>
<javaVersion>17</javaVersion>
<mavenVersion>4.0.0-beta-3</mavenVersion>
<slf4jVersion>2.0.13</slf4jVersion>
<plexusBuildApiVersion>0.0.7</plexusBuildApiVersion>
<project.build.outputTimestamp>2024-03-02T08:58:28Z</project.build.outputTimestamp>
<project.build.outputTimestamp>2023-03-21T10:54:20Z</project.build.outputTimestamp>
</properties>

<dependencies>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<groupId>org.apache.maven</groupId>
<artifactId>maven-api-core</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -83,58 +84,38 @@
<artifactId>plexus-build-api</artifactId>
<version>${plexusBuildApiVersion}</version>
</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>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
<version>${mavenVersion}</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>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-interpolation</artifactId>
<version>1.27</version>
<version>1.26</version>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.15.1</version>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>4.0.0-alpha-3-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.14.0</version>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${mavenVersion}</version>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.11.0</version>
<artifactId>mockito-junit-jupiter</artifactId>
<version>4.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-testing</artifactId>
<version>1.3.0</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -143,11 +124,6 @@
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand All @@ -159,11 +135,6 @@
<artifactId>org.eclipse.sisu.plexus</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.inject</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@
import java.util.List;
import java.util.Properties;

import org.apache.maven.execution.MavenSession;
import org.apache.maven.project.MavenProject;
import org.apache.maven.api.Project;
import org.apache.maven.api.Session;

/**
* @since 1.0-beta-3
*/
public class AbstractMavenFilteringRequest {

private MavenProject mavenProject;
private Project mavenProject;

private List<String> filters;

private boolean escapeWindowsPaths = true;

private MavenSession mavenSession;
private Session mavenSession;

/**
* List of Strings considered as expressions which contains values in the project/pom: pom project Default value
Expand Down Expand Up @@ -93,8 +93,7 @@ protected AbstractMavenFilteringRequest() {
* @param filters The list of filters.
* @param mavenSession The MavenSession.
*/
protected AbstractMavenFilteringRequest(
MavenProject mavenProject, List<String> filters, MavenSession mavenSession) {
protected AbstractMavenFilteringRequest(Project mavenProject, List<String> filters, Session mavenSession) {
initDefaults();
this.mavenProject = mavenProject;
this.filters = filters;
Expand All @@ -112,7 +111,7 @@ private void initDefaults() {
/**
* @return The MavenProject
*/
public MavenProject getMavenProject() {
public Project getMavenProject() {
return mavenProject;
}

Expand All @@ -121,7 +120,7 @@ public MavenProject getMavenProject() {
*
* @param mavenProject The MavenProject to be set.
*/
public void setMavenProject(MavenProject mavenProject) {
public void setMavenProject(Project mavenProject) {
this.mavenProject = mavenProject;
}

Expand Down Expand Up @@ -198,14 +197,14 @@ public void setEscapedBackslashesInFilePath(boolean escape) {
/**
* @return Current value of mavenSession
*/
public MavenSession getMavenSession() {
public Session getMavenSession() {
return mavenSession;
}

/**
* @param mavenSession Set new value for the MavenSession of the instance.
*/
public void setMavenSession(MavenSession mavenSession) {
public void setMavenSession(Session mavenSession) {
this.mavenSession = mavenSession;
}

Expand Down
Loading

0 comments on commit 23f3fbe

Please sign in to comment.