Skip to content

Commit

Permalink
[MCOMPILER-593] Switch to Maven 4 API
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Jun 24, 2024
1 parent a4a3ef0 commit ddc1e10
Show file tree
Hide file tree
Showing 34 changed files with 1,689 additions and 1,495 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/maven-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ jobs:
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v4
with:
# maven-args: "-Dinvoker.parallelThreads=2" cannot do this as this generate some concurrent download issues
ff-maven: "4.0.0-beta-3" # Maven version for fail-fast-build
jdk-distribution-matrix: '[ "temurin", "zulu", "microsoft", "adopt-openj9" ]'
jdk-matrix: '[ "8", "11", "17", "21" ]'
matrix-exclude: '[
{ "jdk": "8", "distribution": "microsoft" },
{ "jdk": "8", "distribution": "temurin", "os": "macos-latest" },
{ "jdk": "8", "distribution": "adopt-openj9", "os": "macos-latest" }
]'
maven-matrix: '[ "3.6.3", "3.8.8", "3.9.6" ]' # Maven versions matrix for verify builds
jdk-matrix: '[ "17", "21" ]'
maven-matrix: '[ "4.0.0-beta-3" ]' # Maven versions matrix for verify builds
167 changes: 94 additions & 73 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-compiler-plugin</artifactId>
<version>3.13.1-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>

<name>Apache Maven Compiler Plugin</name>
Expand Down Expand Up @@ -67,145 +67,173 @@ under the License.
</distributionManagement>

<properties>
<mavenVersion>3.6.3</mavenVersion>
<plexusCompilerVersion>2.15.0</plexusCompilerVersion>
<javaVersion>17</javaVersion>
<mavenVersion>4.0.0-beta-3</mavenVersion>

<asmVersion>9.7</asmVersion>
<groovyVersion>2.4.21</groovyVersion>
<groovyEclipseCompilerVersion>3.7.0</groovyEclipseCompilerVersion>
<groovy-eclipse-batch>2.5.14-02</groovy-eclipse-batch>
<plexus-java.version>1.2.0</plexus-java.version>
<javaVersion>8</javaVersion>
<guiceVersion>6.0.0</guiceVersion>
<junit4Version>4.13.2</junit4Version>
<junitVersion>5.10.1</junitVersion>
<mockitoVersion>5.12.0</mockitoVersion>
<mavenPluginTestingHarnessVersion>4.0.0-alpha-3-SNAPSHOT</mavenPluginTestingHarnessVersion>
<plexusCompilerVersion>2.15.0</plexusCompilerVersion>
<plexusJavaVersion>1.1.1</plexusJavaVersion>
<sisuPlexusVersion>0.9.0.M2</sisuPlexusVersion>
<slf4jVersion>2.0.13</slf4jVersion>
<surefire.version>3.2.1</surefire.version>
<version.maven-invoker-plugin>3.7.0</version.maven-invoker-plugin>
<version.maven-plugin-tools-3.x>3.13.1</version.maven-plugin-tools-3.x>
<version.maven-plugin-tools>4.0.0-SNAPSHOT</version.maven-plugin-tools>
<version.plexus-xml>4.0.1</version.plexus-xml>

<invoker.junitPackageName>org.apache.maven.plugins.compiler.its</invoker.junitPackageName>
<maven.it.failure.ignore>false</maven.it.failure.ignore>

<project.build.outputTimestamp>2024-03-15T07:28:09Z</project.build.outputTimestamp>
<invoker.junitPackageName>org.apache.maven.plugins.compiler.its</invoker.junitPackageName>
</properties>

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

<dependencies>
<!-- Maven -->
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<groupId>org.apache.maven</groupId>
<artifactId>maven-api-core</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<!-- Maven -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<artifactId>maven-api-di</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<artifactId>maven-api-meta</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<artifactId>maven-api-model</artifactId>
<version>${mavenVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.4.2</version>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-incremental</artifactId>
<version>1.1</version>
<exclusions>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
</exclusion>
</exclusions>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
<version>${sisuPlexusVersion}</version>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-java</artifactId>
<version>${plexus-java.version}</version>
<version>${plexusJavaVersion}</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>${asmVersion}</version>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
<version>${plexusCompilerVersion}</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-manager</artifactId>
<version>${plexusCompilerVersion}</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac</artifactId>
<version>${plexusCompilerVersion}</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-api</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${mavenVersion}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>4.0.0-alpha-2</version>
<groupId>org.apache.maven</groupId>
<artifactId>maven-api-impl</artifactId>
<version>${mavenVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<!-- used by maven-plugin-testing-harness -->
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>${guiceVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>${mavenPluginTestingHarnessVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.8.0</version>
<version>${mockitoVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.10.2</version>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit4Version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4jVersion}</version>
<scope>test</scope>
</dependency>
</dependencies>

<repositories>
<repository>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>plexus.snapshots</id>
<url>https://oss.sonatype.org/content/repositories/plexus-snapshots</url>
</repository>
</repositories>

<build>
<pluginManagement>
<plugins>
Expand All @@ -227,13 +255,6 @@ under the License.
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

<profiles>
Expand Down
2 changes: 1 addition & 1 deletion src/it/MCOMPILER-192/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ assert logFile.exists()
def content = logFile.getText('UTF-8')

def causedByExpected = content.contains ( 'Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure' )
def twoFilesBeingCompiled = content.contains ( '[INFO] Compiling 2 source files with javac ' )
def twoFilesBeingCompiled = content.contains ( '[INFO] Compiling 2 source files ' )
def checkResult = content.contains ( '[INFO] BUILD FAILURE' )
def compilationFailure1 = content.contains( '[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:')

Expand Down
3 changes: 2 additions & 1 deletion src/it/MCOMPILER-525/invoker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
# NOTE: The first time, we run up to "integration-test" phase which includes the AntRun execution which saves the
# timestamp of the first JAR for comparison with the timestamp of the JAR from the final "package" invocation.
# Note:
invoker.goals = clean integration-test package -Dmaven.compiler.showCompilationChanges=true
invoker.goals.1 = clean integration-test
invoker.goals.2 = package -Dmaven.compiler.showCompilationChanges=true
8 changes: 4 additions & 4 deletions src/it/mcompiler-106/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ under the License.
<version>@project.version@</version>
<configuration>
<fork>true</fork>
<compilerArguments>
<Xlint />
<Averbose>true</Averbose>
</compilerArguments>
<compilerArgs>
<arg>-Xlint</arg>
<arg>-Averbose=true</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
Expand Down
6 changes: 6 additions & 0 deletions src/it/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,21 @@ under the License.
<url>@localRepositoryUrl@</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
</repository>
<repository>
<releases>
<enabled>false</enabled>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
<id>plexus-snapshots</id>
<name>Plexus Snapshot Repository</name>
Expand All @@ -55,9 +59,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
4 changes: 2 additions & 2 deletions src/it/setup_annotation-verify-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>@version.maven-plugin-tools@</version>
<version>@version.maven-plugin-tools-3.x@</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -96,7 +96,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>@version.maven-plugin-tools@</version>
<version>@version.maven-plugin-tools-3.x@</version>
<configuration>
<goalPrefix>annotation-verify</goalPrefix>
</configuration>
Expand Down
Loading

0 comments on commit ddc1e10

Please sign in to comment.