Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4573ad2
Migrate build infrastructure from Gradle to Maven
ramsessanchez Jun 8, 2026
4667f49
Potential fix for pull request finding
ramsessanchez Jun 29, 2026
d8e88f7
fix: import GPG signing key for Maven signing in ci-build
ramsessanchez Jun 30, 2026
d79db32
Potential fix for pull request finding
ramsessanchez Jun 30, 2026
c2a25d2
Potential fix for pull request finding
ramsessanchez Jun 30, 2026
7d02de6
Potential fix for pull request finding
ramsessanchez Jun 30, 2026
80263f9
Update daily-ci to run on 1es-ubuntu-latest-m pool to fix heap space …
ramsessanchez Jun 30, 2026
7407347
Restore os: linux for daily-ci pool to fix 1ES pre-job OS mismatch
ramsessanchez Jun 30, 2026
87eb5a2
Revert daily-ci to Azure-Pipelines-1ESPT-ExDShared pool; raise Maven …
ramsessanchez Jul 6, 2026
1e34425
Merge branch 'main' into ramsessanchez/gradle-to-maven-migration
ramsessanchez Jul 6, 2026
848ccdd
Fix invalid JSON in release-please-config.json extra-files array
ramsessanchez Jul 6, 2026
62d7db1
Migrate daily-ci to PAT-less Maven auth via MavenAuthenticate@0
ramsessanchez Jul 7, 2026
279e634
Potential fix for pull request finding
ramsessanchez Jul 7, 2026
143ff90
Apply PAT-less Maven auth + network-isolation mirror to ci-build.yml
ramsessanchez Jul 7, 2026
d4ca7a1
Potential fix for pull request finding
ramsessanchez Jul 7, 2026
391510e
Potential fix for pull request finding
ramsessanchez Jul 7, 2026
fefafb2
Potential fix for pull request finding
ramsessanchez Jul 7, 2026
e3293a2
Enable Maven wrapper SHA-256 integrity verification
ramsessanchez Jul 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 49 additions & 12 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,29 +60,66 @@ extends:
Copy-Item $(downloadLocalProperties.secureFilePath) local.properties -Verbose
displayName: Copy secring and 'local.properties'

- script: ./gradlew --no-daemon publishToMavenLocal -PmavenCentralPublishingEnabled=true -PmavenCentralSnapshotArtifactSuffix=""
- pwsh: |
# maven-gpg-plugin signs via the local gpg keyring, so the key from
# secring.gpg must be imported into gpg before signing can succeed.
gpg --batch --import secring.gpg
displayName: Import GPG signing key

- pwsh: |
$props = Get-Content local.properties -Raw
$keyId = ($props | Select-String -Pattern 'signing\.keyId=(.+)').Matches.Groups[1].Value
$keyPassword = ($props | Select-String -Pattern 'signing\.password=(.+)').Matches.Groups[1].Value
Comment thread
ramsessanchez marked this conversation as resolved.

$settingsXml = @"
<settings>
<servers>
<server>
<id>GraphDeveloperExperiencesPublic</id>
<username>microsoftgraph</username>
<password>${{ variables.ARTIFACTS_PAT }}</password>
</server>
Comment thread
ramsessanchez marked this conversation as resolved.
Outdated
</servers>
<profiles>
<profile>
<id>signing</id>
<properties>
<gpg.keyname>$keyId</gpg.keyname>
<gpg.passphrase>$keyPassword</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
"@
Comment thread
ramsessanchez marked this conversation as resolved.
$settingsDir = Join-Path $HOME ".m2"
New-Item -ItemType Directory -Path $settingsDir -Force | Out-Null
$settingsXml | Set-Content (Join-Path $settingsDir "settings.xml") -Encoding UTF8
displayName: Configure Maven settings

- script: ./mvnw install -Psigning --no-transfer-progress
displayName: Publish to local Maven for verification
condition: contains(variables['build.sourceBranch'], 'refs/tags/v')

- script: ./gradlew --no-daemon publishToMavenLocal -PmavenCentralPublishingEnabled=true
- script: ./mvnw install -Psigning --no-transfer-progress
displayName: Publish to local Maven for verification
condition: not(contains(variables['build.sourceBranch'], 'refs/tags/v'))

- script: ./gradlew --no-daemon publishMavenPublicationToADORepository -PmavenCentralPublishingEnabled=true -PmavenCentralSnapshotArtifactSuffix=""
displayName: Publish to local Maven ADO for ESRP
- script: ./mvnw deploy -Psigning --no-transfer-progress -DaltDeploymentRepository=ADO::default::file://$(Build.SourcesDirectory)/target/staging-deploy
displayName: Stage artifacts for ESRP
condition: contains(variables['build.sourceBranch'], 'refs/tags/v')

- script: ./gradlew --no-daemon publishMavenPublicationToADORepository -PmavenCentralPublishingEnabled=true
displayName: Publish to local Maven ADO for ESRP
- script: ./mvnw deploy -Psigning --no-transfer-progress -DaltDeploymentRepository=ADO::default::file://$(Build.SourcesDirectory)/target/staging-deploy
displayName: Stage artifacts for ESRP
condition: not(contains(variables['build.sourceBranch'], 'refs/tags/v'))

- pwsh: |
$contents = Get-Content gradle.properties -Raw
$major = $contents | Select-String -Pattern 'mavenMajorVersion\s*=\s*([0-9]+)' | ForEach-Object { $_.Matches.Groups[1].Value }
$minor = $contents | Select-String -Pattern 'mavenMinorVersion\s*=\s*([0-9]+)' | ForEach-Object { $_.Matches.Groups[1].Value }
$patch = $contents | Select-String -Pattern 'mavenPatchVersion\s*=\s*([0-9]+)' | ForEach-Object { $_.Matches.Groups[1].Value }
$pomXml = [xml](Get-Content pom.xml)
$version = $pomXml.project.version
Comment thread
Copilot marked this conversation as resolved.
Outdated
$snapshot_suffix = if ($Env:BRANCH_NAME.StartsWith('refs/tags/v')) { '' } else { '-SNAPSHOT' }
$version = "$major.$minor.$patch$snapshot_suffix"
# If version already contains -SNAPSHOT and we're on a tag, strip it
if ($Env:BRANCH_NAME.StartsWith('refs/tags/v')) {
$version = $version -replace '-SNAPSHOT$', ''
}
echo "Current version is $version"
echo "##vso[task.setvariable variable=PACKAGE_VERSION;]$version"
displayName: Get current version
Expand All @@ -95,7 +132,7 @@ extends:
displayName: Inspect contents of local Maven cache

- pwsh: |
$packageFullPath = Join-Path -Path "./" -ChildPath "build/publishing-repository/com/microsoft/graph/microsoft-graph" -AdditionalChildPath "$(PACKAGE_VERSION)"
$packageFullPath = Join-Path -Path "./target/staging-deploy" -ChildPath "com/microsoft/graph/microsoft-graph" -AdditionalChildPath "$(PACKAGE_VERSION)"
echo "Package full path: $packageFullPath"
echo "##vso[task.setvariable variable=PACKAGE_PATH;]$packageFullPath"
displayName: Get the package full path
Expand Down
46 changes: 35 additions & 11 deletions .azure-pipelines/daily-ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,45 @@ extends:
- checkout: self
submodules: recursive

- script: |
sed -i "/mavenCentral()/d" build.gradle
sed -i "/gradlePluginPortal()/d" settings.gradle
sed -i "/mavenCentral()/d" settings.gradle
displayName: Strip plugins and public repos for network-isolated build
- task: JavaToolInstaller@1
inputs:
versionSpec: '17'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'

- pwsh: |
$settingsXml = @"
<settings>
<servers>
<server>
<id>GraphDeveloperExperiencesPublic</id>
<username>microsoftgraph</username>
<password>$(ARTIFACTS_PAT)</password>
</server>
</servers>
<mirrors>
<mirror>
<id>GraphDeveloperExperiencesPublic</id>
<mirrorOf>central</mirrorOf>
<url>https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/maven/v1</url>
</mirror>
</mirrors>
</settings>
"@
$settingsDir = Join-Path $HOME ".m2"
New-Item -ItemType Directory -Path $settingsDir -Force | Out-Null
$settingsXml | Set-Content (Join-Path $settingsDir "settings.xml") -Encoding UTF8
displayName: Configure Maven settings for network-isolated build

- task: Gradle@4
- task: Maven@4
displayName: Build and Test SDK
inputs:
gradleWrapperFile: 'gradlew'
workingDirectory: '$(Build.SourcesDirectory)'
tasks: 'assemble test'
options: '--no-daemon -PGraphDeveloperExperiencesPublicPassword=$(ARTIFACTS_PAT)'
mavenPomFile: 'pom.xml'
goals: 'verify'
options: '--no-transfer-progress'
publishJUnitResults: true
testResultsFiles: '**/TEST-*.xml'
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.17'
jdkArchitectureOption: 'x64'
mavenOptions: '-Xmx3072m'
21 changes: 10 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
version: 2
updates:
- package-ecosystem: gradle
directories:
- "/"
- "/java-8"
- "/android"
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
time: "09:00" # 9am UTC
Expand All @@ -16,12 +13,14 @@ updates:
microsoft-graph:
patterns:
- "*microsoft-graph*"
junit-dependencies:
patterns:
- "*junit*"
open-telemetry:
patterns:
- "*opentelemetry*"
- package-ecosystem: gradle
directories:
- "/android"
Comment thread
Copilot marked this conversation as resolved.
Outdated
schedule:
interval: daily
time: "09:00" # 9am UTC
open-pull-requests-limit: 10
groups:
android-build-tools:
patterns:
- "*android*"
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
with:
java-version: 21
distribution: 'temurin'
cache: gradle
cache: maven

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand All @@ -75,10 +75,8 @@ jobs:
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew --no-build-cache build
- name: Build with Maven
run: ./mvnw compile --no-transfer-progress -DskipTests

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Gradle Build and Compare Package
name: Maven Build

on:
push:
Expand All @@ -17,36 +17,29 @@ jobs:
with:
java-version: 21
distribution: 'temurin'
cache: gradle
cache: maven
- name: Move generated sources to correct package
run: .\scripts\copyFilesOnBuild.ps1 -inputPath '.\src\main\java\com\microsoft\graph\generated'
shell: pwsh
- name: Grant Execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Build with Maven
run: ./mvnw verify --no-transfer-progress
- name: Upload Unit Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: UnitTests
path: |
build/reports/tests/test/**
build/test-results/**
target/surefire-reports/**
- name: Upload a Build Artifact
uses: actions/upload-artifact@v7
with:
name: drop
path: |
**/libs/*
build/generated-pom.xml
build/generated-pom.xml.asc
build.gradle
gradlew
gradlew.bat
settings.gradle
gradle.properties
**/gradle/**
target/*.jar
pom.xml
mvnw
mvnw.cmd
.mvn/**
scripts/**

build-java-8:
Expand All @@ -58,15 +51,12 @@ jobs:
with:
java-version: 8
distribution: 'temurin'
cache: gradle
cache: maven
- name: Move generated sources to correct package
run: .\scripts\copyFilesOnBuild.ps1 -inputPath '.\src\main\java\com\microsoft\graph\generated'
shell: pwsh
- name: Grant Execute permission for gradlew
run: chmod +x gradlew
- name: Build with Java 8
working-directory: ./java-8
run: .././gradlew build
run: ./mvnw compile --no-transfer-progress

build:
needs: [build-java-latest, build-java-8]
Expand All @@ -81,19 +71,3 @@ jobs:
exit 1
fi

dependency-submission:
runs-on: ubuntu-latest
if: github.event_name == 'push'
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: 21
distribution: 'temurin'
cache: gradle
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@v6

11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/.gradle/
/build/
/bin/

# Maven
/target/

# Maven wrapper
!.mvn/wrapper/maven-wrapper.jar

#Eclipse
.project
.classpath
.settings

# Maven
/target/
local.properties
.idea
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar
Comment thread
ramsessanchez marked this conversation as resolved.
15 changes: 14 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,17 @@ android {
}
}

apply from: "../gradle/dependencies.gradle"

dependencies {
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1'

api 'com.microsoft.graph:microsoft-graph-core:3.6.6'

implementation 'com.microsoft.kiota:microsoft-kiota-authentication-azure:1.9.2'
implementation 'com.microsoft.kiota:microsoft-kiota-http-okHttp:1.9.2'
implementation 'com.microsoft.kiota:microsoft-kiota-serialization-json:1.9.2'
implementation 'com.microsoft.kiota:microsoft-kiota-serialization-text:1.9.2'
implementation 'com.microsoft.kiota:microsoft-kiota-serialization-form:1.9.2'
implementation 'com.microsoft.kiota:microsoft-kiota-serialization-multipart:1.9.2'
}
Loading
Loading