diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index c3f261b6..119c9aa6 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -65,29 +65,62 @@ extends: Copy-Item $(downloadLocalProperties.secureFilePath) local.properties -Verbose displayName: Copy secring and 'local.properties' - - script: ./gradlew --no-daemon publishToMavenLocal -PmavenCentralPublishingEnabled=true -PmavenCentralSnapshotArtifactSuffix="" - displayName: Publish to local Maven for verification - condition: contains(variables['build.sourceBranch'], 'refs/tags/v') + - 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 - - script: ./gradlew --no-daemon publishToMavenLocal -PmavenCentralPublishingEnabled=true - displayName: Publish to local Maven for verification - condition: not(contains(variables['build.sourceBranch'], 'refs/tags/v')) + - 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 + + $settingsXml = @" + + + + GraphDeveloperExperiences_Public + * + https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/maven/v1 + + + + + signing + + $keyId + $keyPassword + + + + + "@ + $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 + + - task: MavenAuthenticate@0 + displayName: Authenticate to Azure Artifacts feed (PAT-less) + inputs: + artifactsFeeds: 'GraphDeveloperExperiences_Public' - - script: ./gradlew --no-daemon publishMavenPublicationToADORepository -PmavenCentralPublishingEnabled=true -PmavenCentralSnapshotArtifactSuffix="" - displayName: Publish to local Maven ADO for ESRP - condition: contains(variables['build.sourceBranch'], 'refs/tags/v') + - script: ./mvnw install -Psigning --no-transfer-progress + displayName: Publish to local Maven for verification - - script: ./gradlew --no-daemon publishMavenPublicationToADORepository -PmavenCentralPublishingEnabled=true - displayName: Publish to local Maven ADO for ESRP - condition: not(contains(variables['build.sourceBranch'], 'refs/tags/v')) + - script: ./mvnw deploy -Psigning --no-transfer-progress -DaltDeploymentRepository=ADO::default::file://$(Build.SourcesDirectory)/target/staging-deploy + displayName: Stage artifacts for ESRP - 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 } - $snapshot_suffix = if ($Env:BRANCH_NAME.StartsWith('refs/tags/v')) { '' } else { '-SNAPSHOT' } - $version = "$major.$minor.$patch$snapshot_suffix" + $pomXml = [xml](Get-Content pom.xml -Raw) + $ns = New-Object System.Xml.XmlNamespaceManager($pomXml.NameTable) + $ns.AddNamespace('m', $pomXml.DocumentElement.NamespaceURI) + $version = $pomXml.SelectSingleNode('/m:project/m:version', $ns).InnerText + # If version 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 @@ -100,7 +133,7 @@ extends: displayName: Inspect contents of local Maven cache - pwsh: | - $packageFullPath = Join-Path -Path "./" -ChildPath "build/publishing-repository/com/microsoft/graph/microsoft-graph-core" -AdditionalChildPath "$(PACKAGE_VERSION)" + $packageFullPath = Join-Path -Path "./target/staging-deploy" -ChildPath "com/microsoft/graph/microsoft-graph-core" -AdditionalChildPath "$(PACKAGE_VERSION)" echo "Package full path: $packageFullPath" echo "##vso[task.setvariable variable=PACKAGE_PATH;]$packageFullPath" displayName: Get the package full path @@ -176,16 +209,6 @@ extends: $(Pipeline.Workspace)/**/*.pom.asc.sha1 $(Pipeline.Workspace)/**/*.pom.asc.sha256 $(Pipeline.Workspace)/**/*.pom.asc.sha512 - $(Pipeline.Workspace)/**/*.module - $(Pipeline.Workspace)/**/*.module.md5 - $(Pipeline.Workspace)/**/*.module.sha1 - $(Pipeline.Workspace)/**/*.module.sha256 - $(Pipeline.Workspace)/**/*.module.sha512 - $(Pipeline.Workspace)/**/*.module.asc - $(Pipeline.Workspace)/**/*.module.asc.md5 - $(Pipeline.Workspace)/**/*.module.asc.sha1 - $(Pipeline.Workspace)/**/*.module.asc.sha256 - $(Pipeline.Workspace)/**/*.module.asc.sha512 addChangeLog: false action: edit diff --git a/.azure-pipelines/daily-ci-build.yml b/.azure-pipelines/daily-ci-build.yml index 82a70686..16c96aa4 100644 --- a/.azure-pipelines/daily-ci-build.yml +++ b/.azure-pipelines/daily-ci-build.yml @@ -43,26 +43,47 @@ extends: - checkout: self submodules: recursive - - script: | - sed -i "/com.github.spotbugs/d" build.gradle - sed -i "/org.sonarqube/d" build.gradle - sed -i "/spotbugsMain/,/^}/d" build.gradle - sed -i "/spotbugsTest/,/^}/d" build.gradle - sed -i "/sonarqube {/,/^}/d" build.gradle - 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: | + # Route all Maven resolution through the Azure Artifacts feed (Maven Central upstream) + # so the network-isolated build never reaches the public internet. Credentials for the + # mirror are injected PAT-less by the MavenAuthenticate task below; the mirror must + # match the id it generates (the feed name). + $settingsXml = @" + + + + GraphDeveloperExperiences_Public + * + https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/maven/v1 + + + + "@ + $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 mirror for network-isolated build + + - task: MavenAuthenticate@0 + displayName: Authenticate to Azure Artifacts feed (PAT-less) + inputs: + artifactsFeeds: 'GraphDeveloperExperiences_Public' - - 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' diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f8da7250..dccebe3c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,13 +1,16 @@ version: 2 updates: -- package-ecosystem: gradle - directories: - - "/" - - "/java-8" +- package-ecosystem: maven + directory: "/" schedule: interval: daily time: "09:00" # 9am UTC open-pull-requests-limit: 10 + ignore: + # jakarta.annotation-api 3.x is compiled to Java 11 bytecode, which is + # incompatible with this library's Java 8 baseline. Stay on the 2.x line. + - dependency-name: "jakarta.annotation:jakarta.annotation-api" + update-types: ["version-update:semver-major"] groups: kiota-dependencies: patterns: @@ -24,21 +27,11 @@ updates: interval: daily time: "10:00" # 10am UTC. After core dependencies are updated to prevent duplicates. open-pull-requests-limit: 10 - groups: - kiota-dependencies: - patterns: - - "*kiota*" - junit-dependencies: - patterns: - - "*junit*" - open-telemetry: - patterns: - - "*opentelemetry*" -- package-ecosystem: maven - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 + ignore: + # jakarta.annotation-api 3.x is compiled to Java 11 bytecode, which is + # incompatible with this library's Java 8 baseline. Stay on the 2.x line. + - dependency-name: "jakarta.annotation:jakarta.annotation-api" + update-types: ["version-update:semver-major"] groups: kiota-dependencies: patterns: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 58673102..73a6acae 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -49,7 +49,7 @@ jobs: with: java-version: 21 distribution: 'temurin' - cache: gradle + cache: maven # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL @@ -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 build + - name: Build with Maven + run: ./mvnw compile --no-transfer-progress -DskipTests - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v4 diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml deleted file mode 100644 index 725e9d38..00000000 --- a/.github/workflows/gradle-build.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Java CI with Gradle - -on: - pull_request: - branches: [main, support/2.x.x] - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - name: Set up JDK - uses: actions/setup-java@v5 - with: - java-version: 21 - distribution: 'temurin' - cache: gradle - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - name: Build with Gradle - run: ./gradlew build - - name: Build with Java 8 - working-directory: ./java-8 - run: .././gradlew build - - 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/** - Scripts/** diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml new file mode 100644 index 00000000..69c74adf --- /dev/null +++ b/.github/workflows/maven-build.yml @@ -0,0 +1,51 @@ +name: Maven Build + +on: + pull_request: + branches: [main, support/2.x.x] + workflow_dispatch: + +jobs: + build-java-latest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: 21 + distribution: 'temurin' + cache: maven + - 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: | + target/surefire-reports/** + - name: Upload a Build Artifact + uses: actions/upload-artifact@v7 + with: + name: drop + path: | + target/*.jar + pom.xml + mvnw + mvnw.cmd + .mvn/** + scripts/** + + build-java-8: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: 8 + distribution: 'temurin' + cache: maven + - name: Build with Java 8 + run: ./mvnw compile --no-transfer-progress diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 72120b77..e7b3537f 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -34,20 +34,14 @@ jobs: with: java-version: 21 distribution: 'temurin' - cache: gradle + cache: maven - name: Cache SonarCloud packages uses: actions/cache@v5 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - - name: Cache Gradle packages - uses: actions/cache@v5 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle - name: Build and analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - run: ./gradlew build sonarqube --info + run: ./mvnw verify sonar:sonar --no-transfer-progress -Dsonar.token=$SONAR_TOKEN diff --git a/.gitignore b/.gitignore index f9337aa9..997bd43c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,9 +20,12 @@ # 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 @@ -33,7 +36,5 @@ hs_err_pid* *.iml .idea/ -# Maven -/target/ local.properties *.gpg diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 00000000..7967f30d Binary files /dev/null and b/.mvn/wrapper/maven-wrapper.jar differ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 00000000..6f804810 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,4 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip +distributionSha256Sum=4ec3f26fb1a692473aea0235c300bd20f0f9fe741947c82c1234cefd76ac3a3c +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar +wrapperSha256Sum=3d8f20ce6103913be8b52aef6d994e0c54705fb527324ceb9b835b338739c7a8 diff --git a/android/build.gradle b/android/build.gradle index 48ccb5a8..dd21c157 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -67,4 +67,25 @@ android { } } -apply from: "../gradle/dependencies.gradle" + +dependencies { + implementation 'com.google.code.gson:gson:2.14.0' + implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1' + + implementation 'io.jsonwebtoken:jjwt-api:0.13.0' + runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.13.0' + runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.13.0' + implementation 'com.auth0:jwks-rsa:0.24.1' + + api 'com.squareup.okhttp3:okhttp:4.12.0' + api 'com.azure:azure-core:1.58.1' + + api 'com.microsoft.kiota:microsoft-kiota-abstractions:1.9.3' + api 'com.microsoft.kiota:microsoft-kiota-authentication-azure:1.9.3' + implementation 'com.microsoft.kiota:microsoft-kiota-http-okHttp:1.9.3' + implementation 'com.microsoft.kiota:microsoft-kiota-serialization-json:1.9.3' + implementation 'com.microsoft.kiota:microsoft-kiota-serialization-text:1.9.3' + implementation 'com.microsoft.kiota:microsoft-kiota-serialization-form:1.9.3' + implementation 'com.microsoft.kiota:microsoft-kiota-serialization-multipart:1.9.3' +} + diff --git a/android/lint.xml b/android/lint.xml index 0e7a8f71..65178f8e 100644 --- a/android/lint.xml +++ b/android/lint.xml @@ -3,4 +3,13 @@ + + + + + + + + + diff --git a/build.gradle b/build.gradle deleted file mode 100644 index dcf37902..00000000 --- a/build.gradle +++ /dev/null @@ -1,233 +0,0 @@ -plugins { - // Apply the java-library plugin to add support for Java Library - id 'java-library' - id 'eclipse' - id 'maven-publish' - id 'signing' - id 'jacoco' - id 'com.github.spotbugs' version '6.5.4' - id "org.sonarqube" version "7.3.0.8198" - -} - -java { - modularity.inferModulePath = true - withSourcesJar() - withJavadocJar() -} - -test { - useJUnitPlatform() - finalizedBy jacocoTestReport // report is always generated after tests run -} - -jacocoTestReport { - dependsOn test // tests are required to run before generating the report -} - -jacoco { - toolVersion = "0.8.12" -} - -spotbugsMain { - excludeFilter = file("spotBugsExcludeFilter.xml") - reports { - html { - required - outputLocation = file("$buildDir/reports/spotbugs/main/spotbugs.html") - stylesheet = 'fancy-hist.xsl' - } - } -} - -spotbugsTest { - excludeFilter = file("spotBugsExcludeFilter.xml") - reports { - html { - required - outputLocation = file("$buildDir/reports/spotbugs/test/spotbugs.html") - stylesheet = 'fancy-hist.xsl' - } - } -} - -jacocoTestReport { - reports { - xml.required - } -} - -sourceSets { - main { - java { - exclude 'pom.xml' - } - } -} - -// In this section you declare where to find the dependencies of your project -repositories { - // You can declare any Maven/Ivy/file repository here. - mavenCentral() - maven { - url 'https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/maven/v1' - name 'GraphDeveloperExperiencesPublic' - credentials(PasswordCredentials) - authentication { - basic(BasicAuthentication) - } - } -} - -apply from: "gradle/dependencies.gradle" - -def pomConfig = { - licenses { - license([:]) { - name "MIT License" - url "http://opensource.org/licenses/MIT" - distribution "repo" - } - } -} - -sonarqube { - properties { - property "sonar.projectKey", "microsoftgraph_msgraph-sdk-java-core" - property "sonar.organization", "microsoftgraph2" - property "sonar.host.url", "https://sonarcloud.io" - } -} - - -tasks.jar { - manifest { - attributes('Automatic-Module-Name': project.property('mavenGroupId') + '.core') - } -} - -publishing { - - publications { - maven(MavenPublication) { - customizePom(pom) - groupId = project.property('mavenGroupId') - artifactId = project.property('mavenArtifactId') - version = getVersionName() - from components.java - pom.withXml { - def pomFile = file("${project.buildDir}/generated-pom.xml") - writeTo(pomFile) - } - } - } - - repositories { - maven { - name = "ADO" - url = layout.buildDirectory.dir("publishing-repository") - } - maven { - url 'https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/maven/v1' - name 'GraphDeveloperExperiencesPublic' - credentials(PasswordCredentials) - authentication { - basic(BasicAuthentication) - } - } - } -} - -group = project.property('mavenGroupId') -version = "${mavenMajorVersion}.${mavenMinorVersion}.${mavenPatchVersion}${mavenCentralSnapshotArtifactSuffix}" - -signing { - sign publishing.publications.maven -} -tasks.withType(Sign)*.enabled = mavenCentralPublishingEnabled.toBoolean() - -def fixAscNames = { name -> - if(name.contains('pom')) { - "${project.property('mavenArtifactId')}-${mavenMajorVersion}.${mavenMinorVersion}.${mavenPatchVersion}.pom.asc" - } else { - name.replace('msgraph-sdk-java-core', "${project.property('mavenArtifactId')}-${mavenMajorVersion}.${mavenMinorVersion}.${mavenPatchVersion}") - } -} - -compileJava { - options.compilerArgs << "-parameters" - sourceCompatibility = '1.8' - targetCompatibility = '1.8' -} - -def getVersionCode() { - return mavenMajorVersion.toInteger() * 10000 + mavenMinorVersion.toInteger() * 100 + mavenPatchVersion.toInteger() -} - -def getVersionName() { - return "${mavenMajorVersion}.${mavenMinorVersion}.${mavenPatchVersion}${mavenCentralSnapshotArtifactSuffix}" -} - -artifacts { - archives jar -} - -def customizePom(pom) { - pom.withXml { - def root = asNode() - - root.dependencies.removeAll { dep -> - dep.scope == "test" - } - - root.children().last() + { - resolveStrategy = Closure.DELEGATE_FIRST - - description 'Microsoft Graph Core SDK' - name 'Microsoft Graph Java Core SDK' - url 'https://github.com/microsoftgraph/msgraph-sdk-java-core' - organization { - name 'Microsoft' - url 'https://github.com/microsoftgraph/msgraph-sdk-java-core' - } - issueManagement { - system 'GitHub' - url 'https://github.com/microsoftgraph/msgraph-sdk-java-core/issues' - } - licenses { - license { - name "MIT License" - url "http://opensource.org/licenses/MIT" - distribution "repo" - } - } - scm { - url 'https://github.com/microsoftgraph/msgraph-sdk-java-core' - connection 'scm:git:git://github.com/microsoftgraph/msgraph-sdk-java-core.git' - developerConnection 'scm:git:ssh://git@github.com:microsoftgraph/msgraph-sdk-java-core.git' - } - developers { - developer { - name 'Microsoft' - } - } - } - } -} - -gradle.taskGraph.whenReady { taskGraph -> - if (project.rootProject.file('local.properties').exists()) { - Properties properties = new Properties() - properties.load(project.rootProject.file('local.properties').newDataInputStream()) - tasks.withType(Sign)*.enabled = (properties.containsKey('enableSigning')) ? properties.getProperty('enableSigning').toBoolean() : false - allprojects { ext."signing.keyId" = properties.getProperty('signing.keyId') } - allprojects { ext."signing.secretKeyRingFile" = properties.getProperty('signing.secretKeyRingFile') } - allprojects { ext."signing.password" = properties.getProperty('signing.password') } - } -} - -model { - tasks.generatePomFileForMavenPublication { - destination = file("${project.buildDir}/generated-pom.xml") - } -} diff --git a/devx.yml b/devx.yml index f52c6708..f49af4cb 100644 --- a/devx.yml +++ b/devx.yml @@ -3,4 +3,4 @@ languages: extensions: services: - Microsoft Graph -dependencyFile: /gradle/dependencies.gradle +dependencyFile: /pom.xml diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index ef0b9a24..00000000 --- a/gradle.properties +++ /dev/null @@ -1,43 +0,0 @@ -# Project-wide Gradle settings. - -# IDE users: -# Settings specified in this file will override any Gradle settings -# configured through the IDE. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx10248m -# org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true - -# The size of the library demands a large amount of RAM to build. Increase as necessary if you get GC errors -## linux requires 10G, OSX requires 11G -org.gradle.jvmargs=-Xmx2g - -mavenGroupId = com.microsoft.graph -mavenArtifactId = microsoft-graph-core -# x-release-please-start-major -mavenMajorVersion = 3 -# x-release-please-end -# x-release-please-start-minor -mavenMinorVersion = 6 -# x-release-please-end -# x-release-please-start-patch -mavenPatchVersion = 6 -# x-release-please-end -mavenArtifactSuffix = - -#enable mavenCentralPublishingEnabled to publish to maven central -mavenCentralSnapshotArtifactSuffix = -SNAPSHOT -mavenCentralPublishingEnabled=false - -# Azure Artifacts CFS feed credentials -GraphDeveloperExperiencesPublicUsername=microsoftgraph -GraphDeveloperExperiencesPublicPassword=PERSONAL_ACCESS_TOKEN diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle deleted file mode 100644 index b85e5fc6..00000000 --- a/gradle/dependencies.gradle +++ /dev/null @@ -1,28 +0,0 @@ -dependencies { - // Use JUnit test framework - testImplementation 'org.junit.jupiter:junit-jupiter:6.1.0' - testRuntimeOnly 'org.junit.platform:junit-platform-launcher' - testImplementation 'org.mockito:mockito-core:5.23.0' - testImplementation 'io.opentelemetry:opentelemetry-api:1.63.0' - testImplementation 'io.opentelemetry:opentelemetry-context:1.63.0' - testImplementation 'io.github.std-uritemplate:std-uritemplate:1.0.6' - implementation 'com.google.code.gson:gson:2.14.0' - - implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1' - - implementation 'io.jsonwebtoken:jjwt-api:0.13.0' - runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.13.0' - runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.13.0' - implementation 'com.auth0:jwks-rsa:0.24.1' - - api 'com.squareup.okhttp3:okhttp:4.12.0' - api 'com.azure:azure-core:1.58.1' - - api 'com.microsoft.kiota:microsoft-kiota-abstractions:1.9.3' - api 'com.microsoft.kiota:microsoft-kiota-authentication-azure:1.9.3' - implementation 'com.microsoft.kiota:microsoft-kiota-http-okHttp:1.9.3' - implementation 'com.microsoft.kiota:microsoft-kiota-serialization-json:1.9.3' - implementation 'com.microsoft.kiota:microsoft-kiota-serialization-text:1.9.3' - implementation 'com.microsoft.kiota:microsoft-kiota-serialization-form:1.9.3' - implementation 'com.microsoft.kiota:microsoft-kiota-serialization-multipart:1.9.3' -} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 1b33c55b..00000000 Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index aaaabb3c..00000000 --- a/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew deleted file mode 100755 index 23d15a93..00000000 --- a/gradlew +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH="\\\"\\\"" - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat deleted file mode 100644 index 5eed7ee8..00000000 --- a/gradlew.bat +++ /dev/null @@ -1,94 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH= - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/java-8/.gitignore b/java-8/.gitignore deleted file mode 100644 index 7f6823bc..00000000 --- a/java-8/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.gradle -build/ diff --git a/java-8/build.gradle b/java-8/build.gradle deleted file mode 100644 index 5f63dc20..00000000 --- a/java-8/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -plugins { - // Apply the java-library plugin to add support for Java Library - id 'java-library' - id 'eclipse' -} - -repositories { - mavenCentral() -} - -sourceSets { - main { - java { - srcDirs = ['../src'] - exclude 'test/**' - } - } -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(8) - } - withSourcesJar() -} - -apply from: "../gradle/dependencies.gradle" diff --git a/java-8/gradle.properties b/java-8/gradle.properties deleted file mode 100644 index 14391a7b..00000000 --- a/java-8/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -mavenArtifactId = msgraph-sdk-java-core diff --git a/java-8/settings.gradle b/java-8/settings.gradle deleted file mode 100644 index 5571a749..00000000 --- a/java-8/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'msgraph-sdk-java-core' diff --git a/mvnw b/mvnw new file mode 100755 index 00000000..5272759e --- /dev/null +++ b/mvnw @@ -0,0 +1,332 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version @@project.version@@ +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ]; then + + if [ -f /usr/local/etc/mavenrc ]; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ]; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ]; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false +darwin=false +mingw=false +case "$(uname)" in +CYGWIN*) cygwin=true ;; +MINGW*) mingw=true ;; +Darwin*) + darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + JAVA_HOME="$(/usr/libexec/java_home)" + export JAVA_HOME + else + JAVA_HOME="/Library/Java/Home" + export JAVA_HOME + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ]; then + if [ -r /etc/gentoo-release ]; then + JAVA_HOME=$(java-config --jre-home) + fi +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin; then + [ -n "$JAVA_HOME" ] \ + && JAVA_HOME=$(cygpath --unix "$JAVA_HOME") + [ -n "$CLASSPATH" ] \ + && CLASSPATH=$(cygpath --path --unix "$CLASSPATH") +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw; then + [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] \ + && JAVA_HOME="$( + cd "$JAVA_HOME" || ( + echo "cannot cd into $JAVA_HOME." >&2 + exit 1 + ) + pwd + )" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="$(which javac)" + if [ -n "$javaExecutable" ] && ! [ "$(expr "$javaExecutable" : '\([^ ]*\)')" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=$(which readlink) + if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then + if $darwin; then + javaHome="$(dirname "$javaExecutable")" + javaExecutable="$(cd "$javaHome" && pwd -P)/javac" + else + javaExecutable="$(readlink -f "$javaExecutable")" + fi + javaHome="$(dirname "$javaExecutable")" + javaHome=$(expr "$javaHome" : '\(.*\)/bin') + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ]; then + if [ -n "$JAVA_HOME" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="$( + \unset -f command 2>/dev/null + \command -v java + )" + fi +fi + +if [ ! -x "$JAVACMD" ]; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ]; then + echo "Warning: JAVA_HOME environment variable is not set." >&2 +fi + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + if [ -z "$1" ]; then + echo "Path not specified to find_maven_basedir" >&2 + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ]; do + if [ -d "$wdir"/.mvn ]; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=$( + cd "$wdir/.." || exit 1 + pwd + ) + fi + # end of workaround + done + printf '%s' "$( + cd "$basedir" || exit 1 + pwd + )" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + # Remove \r in case we run on Windows within Git Bash + # and check out the repository with auto CRLF management + # enabled. Otherwise, we may read lines that are delimited with + # \r\n and produce $'-Xarg\r' rather than -Xarg due to word + # splitting rules. + tr -s '\r\n' ' ' <"$1" + fi +} + +log() { + if [ "$MVNW_VERBOSE" = true ]; then + printf '%s\n' "$1" + fi +} + +BASE_DIR=$(find_maven_basedir "$(dirname "$0")") +if [ -z "$BASE_DIR" ]; then + exit 1 +fi + +MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +export MAVEN_PROJECTBASEDIR +log "$MAVEN_PROJECTBASEDIR" + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" +if [ -r "$wrapperJarPath" ]; then + log "Found $wrapperJarPath" +else + log "Couldn't find $wrapperJarPath, downloading it ..." + + if [ -n "$MVNW_REPOURL" ]; then + wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/@@project.version@@/maven-wrapper-@@project.version@@.jar" + else + wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/@@project.version@@/maven-wrapper-@@project.version@@.jar" + fi + while IFS="=" read -r key value; do + # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) + safeValue=$(echo "$value" | tr -d '\r') + case "$key" in wrapperUrl) + wrapperUrl="$safeValue" + break + ;; + esac + done <"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" + log "Downloading from: $wrapperUrl" + + if $cygwin; then + wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") + fi + + if command -v wget >/dev/null; then + log "Found wget ... using wget" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + else + wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + fi + elif command -v curl >/dev/null; then + log "Found curl ... using curl" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + else + curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + fi + else + log "Falling back to using Java to download" + javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" + javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaSource=$(cygpath --path --windows "$javaSource") + javaClass=$(cygpath --path --windows "$javaClass") + fi + if [ -e "$javaSource" ]; then + if [ ! -e "$javaClass" ]; then + log " - Compiling MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/javac" "$javaSource") + fi + if [ -e "$javaClass" ]; then + log " - Running MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +# If specified, validate the SHA-256 sum of the Maven wrapper jar file +wrapperSha256Sum="" +while IFS="=" read -r key value; do + case "$key" in wrapperSha256Sum) + wrapperSha256Sum=$value + break + ;; + esac +done <"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" +if [ -n "$wrapperSha256Sum" ]; then + wrapperSha256Result=false + if command -v sha256sum >/dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c >/dev/null 2>&1; then + wrapperSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c >/dev/null 2>&1; then + wrapperSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $wrapperSha256Result = false ]; then + echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 + echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 + echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 + exit 1 + fi +fi + +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$JAVA_HOME" ] \ + && JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") + [ -n "$CLASSPATH" ] \ + && CLASSPATH=$(cygpath --path --windows "$CLASSPATH") + [ -n "$MAVEN_PROJECTBASEDIR" ] \ + && MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +# shellcheck disable=SC2086 # safe args +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 00000000..708460f9 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,206 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version @@project.version@@ +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. >&2 +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. >&2 +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. >&2 +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. >&2 +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/@@project.version@@/maven-wrapper-@@project.version@@.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/@@project.version@@/maven-wrapper-@@project.version@@.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %WRAPPER_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file +SET WRAPPER_SHA_256_SUM="" +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B +) +IF NOT %WRAPPER_SHA_256_SUM%=="" ( + powershell -Command "&{"^ + "Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash;"^ + "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ + "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ + " Write-Error 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ + " Write-Error 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ + " Write-Error 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ + " exit 1;"^ + "}"^ + "}" + if ERRORLEVEL 1 goto error +) + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml index f61e2768..5d306185 100644 --- a/pom.xml +++ b/pom.xml @@ -1,61 +1,395 @@ - - + + 4.0.0 com.microsoft.graph microsoft-graph-core - 3.6.6 + 3.6.6-SNAPSHOT - pom + jar + + Microsoft Graph Java Core SDK + Microsoft Graph Core SDK + https://github.com/microsoftgraph/msgraph-sdk-java-core + + + Microsoft + https://github.com/microsoftgraph/msgraph-sdk-java-core + + + + GitHub + https://github.com/microsoftgraph/msgraph-sdk-java-core/issues + + + + + MIT License + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/microsoftgraph/msgraph-sdk-java-core + scm:git:https://github.com/microsoftgraph/msgraph-sdk-java-core.git + scm:git:ssh://git@github.com:microsoftgraph/msgraph-sdk-java-core.git + + + + + Microsoft + + + UTF-8 1.8 1.8 + + + 2.14.0 + 2.1.1 + 0.13.0 + 0.24.1 + 4.12.0 + 1.58.1 + 1.9.3 + + + 6.1.0 + 5.23.0 + 1.63.0 + 1.0.6 + + + 3.14.0 + 3.4.2 + 3.11.2 + 3.3.1 + 3.5.2 + 3.2.7 + 0.8.12 + 4.9.8.0 + 4.9.8 + 5.7.0.6970 + + + microsoftgraph_msgraph-sdk-java-core + microsoftgraph2 + https://sonarcloud.io + + + central + https://repo.maven.apache.org/maven2 + + + GraphDeveloperExperiences_Public + https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/maven/v1 + + + + + + GraphDeveloperExperiences_Public + https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/maven/v1 + + + + + + + org.junit + junit-bom + ${junit.version} + pom + import + + + + com.google.code.gson gson - 2.14.0 + ${gson.version} + + + jakarta.annotation + jakarta.annotation-api + ${jakarta-annotation.version} + + + + io.jsonwebtoken + jjwt-api + ${jjwt.version} + + + io.jsonwebtoken + jjwt-impl + ${jjwt.version} + runtime + + + io.jsonwebtoken + jjwt-jackson + ${jjwt.version} + runtime + + + + com.auth0 + jwks-rsa + ${jwks-rsa.version} + + com.squareup.okhttp3 okhttp - 4.12.0 + ${okhttp.version} + com.azure azure-core - 1.58.1 + ${azure-core.version} + + + + com.microsoft.kiota + microsoft-kiota-abstractions + ${kiota.version} + + com.microsoft.kiota + microsoft-kiota-authentication-azure + ${kiota.version} + + + com.microsoft.kiota + microsoft-kiota-http-okHttp + ${kiota.version} + + + com.microsoft.kiota + microsoft-kiota-serialization-json + ${kiota.version} + + + com.microsoft.kiota + microsoft-kiota-serialization-text + ${kiota.version} + + + com.microsoft.kiota + microsoft-kiota-serialization-form + ${kiota.version} + + + com.microsoft.kiota + microsoft-kiota-serialization-multipart + ${kiota.version} + + + org.junit.jupiter - junit-jupiter-api - 6.0.3 + junit-jupiter test - org.junit.jupiter - junit-jupiter-params - 6.0.3 + org.junit.platform + junit-platform-launcher test org.mockito - mockito-inline - 5.2.0 + mockito-core + ${mockito.version} + test + + + io.opentelemetry + opentelemetry-api + ${opentelemetry.version} + test + + + io.opentelemetry + opentelemetry-context + ${opentelemetry.version} test - com.github.spotbugs - spotbugs-annotations - 4.9.8 + io.github.std-uritemplate + std-uritemplate + ${std-uritemplate.version} + test + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source} + ${maven.compiler.target} + + + -parameters + + + + + default-testCompile + + 17 + 17 + + + + + + + org.apache.maven.plugins + maven-jar-plugin + ${maven-jar-plugin.version} + + + + com.microsoft.graph.core + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + + attach-javadocs + + jar + + + + + -missing + true + -J-Xmx2g + + + + + org.apache.maven.plugins + maven-source-plugin + ${maven-source-plugin.version} + + + attach-sources + + jar-no-fork + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + prepare-agent + + prepare-agent + + + + report + test + + report + + + + + + + com.github.spotbugs + spotbugs-maven-plugin + ${spotbugs-maven-plugin.version} + + spotBugsExcludeFilter.xml + true + + + + com.github.spotbugs + spotbugs + ${spotbugs.version} + + + + + spotbugs-check + verify + + check + + + + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${sonar-maven-plugin.version} + + + + + + + signing + + + + org.apache.maven.plugins + maven-gpg-plugin + ${maven-gpg-plugin.version} + + + sign-artifacts + verify + + sign + + + + + + + + diff --git a/release-please-config.json b/release-please-config.json index 2323fdde..d6daea58 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -14,13 +14,12 @@ "package-name": "com.microsoft.graph.microsoft-graph-core", "changelog-path": "CHANGELOG.md", "extra-files": [ - "gradle.properties", "README.md", "src/main/java/com/microsoft/graph/core/CoreConstants.java", { "type": "xml", "path": "pom.xml", - "xpath": "//project/version" + "xpath": "/*[local-name()='project']/*[local-name()='version']" } ] } diff --git a/scripts/getLatestVersion.ps1 b/scripts/getLatestVersion.ps1 index 27056771..d7e20bd1 100644 --- a/scripts/getLatestVersion.ps1 +++ b/scripts/getLatestVersion.ps1 @@ -5,33 +5,26 @@ .Synopsis Retrieve the latest version of the library .Description - Retrieves the latest version specified in the Gradle.Properties file + Retrieves the latest version specified in the pom.xml file Uses the retrieved values to update the environment variable VERSION_STRING .Parameter propertiesPath - The path pointing to the gradle.properties file. + The path pointing to the pom.xml file. #> Param( [string]$propertiesPath ) -#Retrieve the current version from the Gradle.Properties file given the specified path +#Retrieve the current version from the pom.xml file given the specified path if($propertiesPath -eq "" -or $null -eq $propertiesPath) { - $propertiesPath = Join-Path -Path $PSScriptRoot -ChildPath "../gradle.properties" + $propertiesPath = Join-Path -Path $PSScriptRoot -ChildPath "../pom.xml" } -$file = get-item $propertiesPath -$findVersions = $file | Select-String -Pattern "mavenMajorVersion" -Context 0,2 -$content = Get-Content $propertiesPath -$lineNumber = $findVersions.LineNumber - 1 -$versionIndex = $content[$lineNumber].IndexOf("=") -$versionIndex += 2 # skipping =[space] -$majorVersion = $content[$lineNumber].Substring($versionIndex) -$lineNumber++ -$minorVersion = $content[$lineNumber].Substring($versionIndex) -$lineNumber++ -$patchVersion = $content[$lineNumber].Substring($versionIndex) -$version = "$majorVersion.$minorVersion.$patchVersion" +$pomXml = [xml](Get-Content $propertiesPath -Raw) +$ns = New-Object System.Xml.XmlNamespaceManager($pomXml.NameTable) +$ns.AddNamespace('m', $pomXml.DocumentElement.NamespaceURI) +$version = $pomXml.SelectSingleNode('/m:project/m:version', $ns).InnerText +$version = $version -replace '-SNAPSHOT$', '' #Set Task output to create tag Write-Output "::set-output name=tag::v${version}" \ No newline at end of file diff --git a/scripts/validatePackageContents.ps1 b/scripts/validatePackageContents.ps1 index 4bd2d16e..cb33a56c 100644 --- a/scripts/validatePackageContents.ps1 +++ b/scripts/validatePackageContents.ps1 @@ -26,8 +26,6 @@ $expectedFiles = @( "-javadoc.jar.asc", "-sources.jar", "-sources.jar.asc", - ".module", - ".module.asc", ".pom", ".pom.asc", ".jar", diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index c27d0783..00000000 --- a/settings.gradle +++ /dev/null @@ -1,25 +0,0 @@ -pluginManagement { - repositories { - gradlePluginPortal() - mavenCentral() - maven { - url 'https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/GraphDeveloperExperiences_Public/maven/v1' - name 'GraphDeveloperExperiencesPublic' - credentials(PasswordCredentials) - authentication { - basic(BasicAuthentication) - } - } - } -} - -/* - * This file was generated by the Gradle 'init' task. - * - * The settings file is used to specify which projects to include in your build. - * - * Detailed information about configuring a multi-project build in Gradle can be found - * in the user manual at https://docs.gradle.org/6.6/userguide/multi_project_builds.html - */ - -rootProject.name = 'msgraph-sdk-java-core' diff --git a/spotBugsExcludeFilter.xml b/spotBugsExcludeFilter.xml index 07e0e404..6951e55e 100644 --- a/spotBugsExcludeFilter.xml +++ b/spotBugsExcludeFilter.xml @@ -116,4 +116,8 @@ xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubu + + + +