Migrate build infrastructure from Gradle to Maven#2111
Merged
Conversation
Replaces the Gradle build with Maven while preserving build behaviors, and moves CI/CD off PAT usage. - New Maven build (pom.xml) with dependencies, compiler (-parameters, Java 1.8 main / 17 tests), jar Automatic-Module-Name, javadoc/source jars, jacoco, spotbugs, sonar, and a GPG signing profile - Maven wrapper (mvnw/mvnw.cmd/.mvn) replacing the Gradle wrapper - gradle-build.yml -> maven-build.yml; codeql-analysis.yml and sonarcloud.yml updated to Maven - ADO ci-build.yml and daily-ci-build.yml use Maven with PAT-less MavenAuthenticate and settings.xml mirror + GPG signing - dependabot.yml (maven root, gradle for /android), .gitignore, release-please-config.json, devx.yml, getLatestVersion.ps1, validatePackageContents.ps1 updated - android/ kept as standalone Gradle project with inlined dependencies - Removed root Gradle files and the java-8 sub-project (Java 8 verified via Maven source/target 1.8 + JDK 8 CI job) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jakarta.annotation-api 3.x is compiled to Java 11 bytecode, incompatible with the library's Java 8 baseline, so pin to the 2.x line. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
okhttp 5.x is a major bump that will be handled manually; pin to the 4.x line in both the Maven and Android ecosystems. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the repository’s primary build and CI/CD infrastructure from Gradle to Maven (via Maven Wrapper), while also updating GitHub Actions and Azure DevOps pipelines to remove PAT-based authentication and preserve existing quality gates (SpotBugs, JaCoCo, SonarCloud).
Changes:
- Replaces the root Gradle build with a full Maven
pom.xml+ Maven Wrapper, including JaCoCo, SpotBugs, SonarCloud, and signing profile support. - Updates GitHub Actions and Azure DevOps pipelines to build/test/publish via Maven and use PAT-less feed authentication.
- Keeps the Android sub-project on Gradle while removing shared Gradle dependency management from the root.
Reviewed changes
Copilot reviewed 28 out of 32 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
spotBugsExcludeFilter.xml |
Adds a SpotBugs suppression entry used by the Maven SpotBugs configuration. |
settings.gradle |
Removes Gradle settings as part of the root Gradle decommissioning. |
scripts/validatePackageContents.ps1 |
Removes Gradle-only .module artifact expectations from package validation. |
scripts/getLatestVersion.ps1 |
Switches version discovery from gradle.properties to pom.xml. |
release-please-config.json |
Updates release-please to bump pom.xml version via XML xpath instead of Gradle properties. |
pom.xml |
Introduces the full Maven build definition (deps, plugins, reporting/signing configuration). |
mvnw.cmd |
Adds Maven Wrapper for Windows. |
mvnw |
Adds Maven Wrapper for POSIX shells. |
java-8/settings.gradle |
Removes the old Java 8 Gradle subproject settings. |
java-8/gradle.properties |
Removes the old Java 8 Gradle subproject properties. |
java-8/build.gradle |
Removes the old Java 8 Gradle subproject build file. |
java-8/.gitignore |
Removes now-obsolete ignore rules for the deleted Java 8 subproject build. |
gradlew.bat |
Removes the Gradle wrapper for Windows from the root build. |
gradlew |
Removes the Gradle wrapper for POSIX shells from the root build. |
gradle/wrapper/gradle-wrapper.properties |
Removes the Gradle wrapper configuration. |
gradle/dependencies.gradle |
Removes shared Gradle dependency management (now represented in pom.xml). |
gradle.properties |
Removes Gradle property-based versioning and feed credential placeholders. |
devx.yml |
Points dependency discovery at pom.xml instead of Gradle dependency file. |
build.gradle |
Removes the root Gradle build definition. |
android/lint.xml |
Adds lint suppressions related to intentionally deferred Android dependency major bumps. |
android/build.gradle |
Inlines dependency declarations now that shared Gradle deps file is removed. |
.mvn/wrapper/maven-wrapper.properties |
Adds Maven Wrapper distribution + checksum configuration. |
.gitignore |
Updates ignore rules for Maven build output and ensures wrapper jar can be committed. |
.github/workflows/sonarcloud.yml |
Updates SonarCloud workflow to use Maven and Maven caching. |
.github/workflows/maven-build.yml |
Adds a Maven-based GitHub Actions build workflow (JDK latest + JDK 8 compile job). |
.github/workflows/gradle-build.yml |
Removes the Gradle-based GitHub Actions workflow. |
.github/workflows/codeql-analysis.yml |
Updates CodeQL build step to Maven and switches caching to Maven. |
.github/dependabot.yml |
Switches root updates to Maven ecosystem; keeps Android on Gradle and adjusts ignore rules. |
.azure-pipelines/daily-ci-build.yml |
Updates the network-isolated daily build to Maven with feed mirroring + PAT-less auth. |
.azure-pipelines/ci-build.yml |
Updates CI build/release staging steps to Maven (install/deploy/signing) and removes .module handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
jingjingjia-ms
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Migrates the build system from Gradle to Maven while preserving all build behaviors, and moves the CI/CD pipelines off Personal Access Token (PAT) usage. Uses microsoftgraph/msgraph-sdk-java#2613 as the baseline, adapted for core-specific concerns (SpotBugs, JaCoCo, SonarCloud).
New Maven build
pom.xmlwith all dependencies (fromgradle/dependencies.gradle), compiler settings (Java 1.8 main / 17 tests,-parameters), jar manifest (Automatic-Module-Name: com.microsoft.graph.core), javadoc/source jars, JaCoCo, SpotBugs (spotBugsExcludeFilter.xml), SonarCloud, and a GPGsigningprofilemvnw/mvnw.cmd/.mvn/, Maven 3.9.9) replacing the Gradle wrapperCI/CD pipeline updates (PAT-less)
gradle-build.yml->maven-build.yml(JDK-latestverify+ JDK-8compilejobs)codeql-analysis.ymlandsonarcloud.ymlupdated to Mavenci-build.yml:mvnw install/deploy -Psigning, GPG import,settings.xml, andMavenAuthenticate@0instead ofARTIFACTS_PATdaily-ci-build.yml:Maven@4+ network-isolated feed mirror +MavenAuthenticate@0Config updates
dependabot.yml:mavenecosystem for root,gradlekept for/android.gitignore: Maven wrapper/target entriesrelease-please-config.json: XML xpath updater forpom.xmlversion (droppedgradle.properties)devx.yml,scripts/getLatestVersion.ps1-> read frompom.xmlscripts/validatePackageContents.ps1+ release assets: dropped Gradle-only.modulemetadataAndroid sub-project
android/build.gradle(sharedgradle/dependencies.gradleremoved)Removed
build.gradle,settings.gradle,gradle.properties,gradlew, wrapper)java-8/sub-project (Java 8 compat now verified via Mavensource/target 1.8+ JDK 8 CI job)Notes / deviations from baseline
compileJavato 1.8, not tests).modulechecks removed since Maven does not emit Gradle module metadataVerification
./mvnw verify-> BUILD SUCCESS: 79 tests pass, SpotBugs clean, JaCoCo report generatedAutomatic-Module-Name: com.microsoft.graph.core