Skip to content

build: migrate build infrastructure from Gradle to Maven#1346

Merged
ramsessanchez merged 4 commits into
mainfrom
ramsessanchez/migrate-gradle-to-maven
Jul 8, 2026
Merged

build: migrate build infrastructure from Gradle to Maven#1346
ramsessanchez merged 4 commits into
mainfrom
ramsessanchez/migrate-gradle-to-maven

Conversation

@ramsessanchez

@ramsessanchez ramsessanchez commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates the build system from Gradle to Maven, mirroring the v1 SDK migration (msgraph-sdk-java#2613), and moves CI/CD away from PAT-based Azure Artifacts auth to PAT-less MavenAuthenticate.

Changes

New Maven build

  • pom.xml with all dependencies, compiler settings (Java 1.8, -parameters), jar manifest (Automatic-Module-Name), javadoc, source, and GPG signing profile
  • Maven wrapper (mvnw/mvnw.cmd/.mvn) replacing the Gradle wrapper

CI/CD (PAT-less)

  • gradle-build.ymlmaven-build.yml (mvnw verify, Java 8 job runs mvnw compile)
  • codeql-analysis.yml updated to mvnw compile + maven cache
  • ADO ci-build.yml: GPG import, ~/.m2/settings.xml, MavenAuthenticate@0, mvnw install/deploy -Psigning, pom-based version, target/staging-deploy staging
  • ADO daily-ci-build.yml: Maven@4 + mirror settings.xml + MavenAuthenticate@0, replacing the sed repo-stripping and $(ARTIFACTS_PAT) PAT flag

Config

  • dependabot.yml: root → maven, /android kept as gradle (weekly + github-actions group preserved)
  • release-please-config.json: XML xpath updater for pom.xml version
  • .gitignore: Maven entries + wrapper-jar exception
  • android/build.gradle: dependencies inlined (shared gradle/dependencies.gradle removed)

Removed

  • All root Gradle files (build.gradle, settings.gradle, gradle.properties, gradlew, wrapper)
  • java-8/ subproject (Java 8 compat now verified via Maven source/target 1.8 + JDK 8 CI job)

Verification

  • ./mvnw compile27,817 source files compiled successfully, BUILD SUCCESS
Microsoft Reviewers: Open in CodeFlow

Migrates the build system from Gradle to Maven, mirroring the v1 SDK
migration (microsoftgraph/msgraph-sdk-java#2613), and moves CI/CD away
from PAT-based Azure Artifacts auth to PAT-less MavenAuthenticate.

- Add pom.xml, Maven wrapper (mvnw/mvnw.cmd/.mvn)
- Replace gradle-build.yml with maven-build.yml; update codeql to mvnw
- Update ADO ci-build.yml and daily-ci-build.yml to Maven + MavenAuthenticate@0
- dependabot: root -> maven, /android kept as gradle
- release-please: xml xpath updater for pom.xml version
- android: inline dependencies; remove shared gradle/dependencies.gradle
- Remove all root Gradle files and the java-8 subproject

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ramsessanchez ramsessanchez requested a review from a team as a code owner July 7, 2026 20:46
- Set the executable bit on mvnw so Linux CI (GitHub Actions) can run it
  (was failing with exit 126 / Permission denied)
- Increase maven-javadoc-plugin fork heap to -J-Xmx4g; the beta SDK has
  27,817 source files and OOMed javadoc at 2g (Please increase memory)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the repository’s build and CI infrastructure from Gradle to Maven (with Maven Wrapper), updating GitHub Actions and Azure Pipelines accordingly and removing legacy Gradle/Java-8 subproject scaffolding.

Changes:

  • Introduces a root pom.xml Maven build (compiler settings, dependencies, jar/javadoc/source artifacts, signing profile) plus Maven Wrapper files.
  • Updates CI pipelines (GitHub Actions + Azure Pipelines) to run ./mvnw and authenticate to Azure Artifacts via MavenAuthenticate@0 (PAT-less).
  • Removes root Gradle build files and the legacy java-8/ Gradle subproject; inlines Android dependency declarations.

Reviewed changes

Copilot reviewed 22 out of 26 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
settings.gradle Removed root Gradle settings (Gradle build no longer used).
release-please-config.json Switches release-please version updating from gradle.properties to pom.xml via XPath.
pom.xml Adds Maven build definition (deps, compiler config, artifacts, signing profile).
mvnw.cmd Adds Maven Wrapper Windows launcher script.
mvnw Adds Maven Wrapper POSIX launcher script.
java-8/settings.gradle Removes Java-8 subproject Gradle settings.
java-8/gradle.properties Removes Java-8 subproject Gradle properties.
java-8/daemon-jvm.properties Removes Java-8 Gradle daemon/toolchain config.
java-8/build.gradle Removes Java-8 subproject Gradle build script.
java-8/.gitignore Removes Java-8 subproject Gradle ignore rules (subproject removed).
gradlew.bat Removes Gradle Wrapper (Windows).
gradlew Removes Gradle Wrapper (POSIX).
gradle/wrapper/gradle-wrapper.properties Removes Gradle wrapper properties.
gradle/dependencies.gradle Removes shared Gradle dependency catalog.
gradle.properties Removes Gradle project properties (versioning and publishing config migrated).
build.gradle Removes root Gradle build script (publishing/signing logic migrated).
android/build.gradle Inlines dependencies previously pulled from gradle/dependencies.gradle.
.mvn/wrapper/maven-wrapper.properties Adds Maven Wrapper distribution and checksum configuration.
.gitignore Updates ignores for Maven outputs and wrapper jar handling.
.github/workflows/maven-build.yml Replaces Gradle CI build with Maven (./mvnw verify + Java 8 compile job).
.github/workflows/codeql-analysis.yml Updates CodeQL build step to Maven compile and Maven caching.
.github/dependabot.yml Switches root updates to Maven; keeps Android as Gradle; preserves GitHub Actions updates.
.azure-pipelines/daily-ci-build.yml Migrates daily Azure Pipeline build from Gradle to Maven + PAT-less feed auth and mirror settings.
.azure-pipelines/ci-build.yml Migrates CI/release pipeline steps to Maven (install/deploy staging) + GPG import and PAT-less feed auth.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .azure-pipelines/ci-build.yml Outdated
Comment thread pom.xml Outdated
ramsessanchez and others added 2 commits July 7, 2026 17:06
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>
@ramsessanchez ramsessanchez merged commit d352b57 into main Jul 8, 2026
14 checks passed
@ramsessanchez ramsessanchez deleted the ramsessanchez/migrate-gradle-to-maven branch July 8, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants