diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 37776f7..8779cdb 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -12,7 +12,9 @@ jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
-
+ permissions:
+ contents: read
+ security-events: write
strategy:
fail-fast: false
matrix:
@@ -20,25 +22,26 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@v5
+ uses: actions/checkout@v6
with:
fetch-depth: 2
+ persist-credentials: false
- uses: actions/setup-java@v5
with:
distribution: 'adopt'
- java-version: 11
+ java-version: 17
- name: Setup Gradle
- uses: gradle/actions/setup-gradle@v4
+ uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
- name: Initialize CodeQL
- uses: github/codeql-action/init@v3
+ uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
- name: Autobuild
- uses: github/codeql-action/autobuild@v3
+ uses: github/codeql-action/autobuild@v4
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v3
+ uses: github/codeql-action/analyze@v4
diff --git a/.github/workflows/dependency-submission.yml b/.github/workflows/dependency-submission.yml
index 9832b84..b90196f 100644
--- a/.github/workflows/dependency-submission.yml
+++ b/.github/workflows/dependency-submission.yml
@@ -5,19 +5,20 @@ on:
push:
branches: [ main ]
-permissions:
- contents: write # Required for dependency submission
-
jobs:
dependency-submission:
+ permissions:
+ contents: write # Required for dependency submission
runs-on: ubuntu-latest
steps:
- name: Checkout sources
- uses: actions/checkout@v5
+ uses: actions/checkout@v6
+ with:
+ persist-credentials: false
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17
- name: Generate and submit dependency graph
- uses: gradle/actions/dependency-submission@v4
+ uses: gradle/actions/dependency-submission@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml
index 4dc8b05..5a629b2 100644
--- a/.github/workflows/gh-pages.yml
+++ b/.github/workflows/gh-pages.yml
@@ -4,6 +4,8 @@ on:
push:
branches: ["main"]
workflow_dispatch:
+ pull_request:
+ branches: [main]
concurrency:
group: "pages"
@@ -16,16 +18,18 @@ jobs:
contents: read
steps:
- name: Checkout
- uses: actions/checkout@v5
+ uses: actions/checkout@v6
+ with:
+ persist-credentials: false
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17
- name: Setup Gradle
- uses: gradle/actions/setup-gradle@v4
+ uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
- name: Setup Pages
- uses: actions/configure-pages@v5
+ uses: actions/configure-pages@v6
- name: Build Javadoc
run: ./gradlew javadoc --info
- name: Build Reports
@@ -33,7 +37,7 @@ jobs:
- name: Collect artifacts
run: cp -r build/reports/ build/docs/
- name: Upload artifact
- uses: actions/upload-pages-artifact@v4
+ uses: actions/upload-pages-artifact@v5
with:
path: ./build/docs/
@@ -50,4 +54,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
- uses: actions/deploy-pages@v4
+ uses: actions/deploy-pages@v5
diff --git a/.github/workflows/github_release.sh b/.github/workflows/github_release.sh
new file mode 100755
index 0000000..a6e14c6
--- /dev/null
+++ b/.github/workflows/github_release.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+set -o errexit
+set -o nounset
+set -o pipefail
+
+base_dir="$( cd "$(dirname "$0")/../.." >/dev/null 2>&1 ; pwd -P )"
+readonly base_dir
+readonly build_dir="$base_dir/build"
+readonly release_artifacts_dir="$build_dir/release-artifacts"
+
+cd "$base_dir"
+echo "Reading project version from Gradle project at ${base_dir}..."
+project_version=$(./gradlew properties --console=plain --quiet | grep "^version:" | awk '{print $2}')
+readonly project_version
+echo "Read project version '$project_version' from Gradle project"
+
+mkdir -p "$release_artifacts_dir"
+cp -v "$build_dir/libs/fritzbox-java-api-$project_version.jar" "$release_artifacts_dir/fritzbox-java-api-$project_version.jar"
+
+release_artifacts=$(find "$release_artifacts_dir" -type f)
+readonly release_artifacts
+
+readonly title="Release $project_version"
+readonly tag="$project_version"
+echo "Creating release:"
+echo "Git tag : $tag"
+echo "Title : $title"
+echo "Artifacts: $release_artifacts"
+
+# shellcheck disable=SC2086
+release_url=$(gh release create --latest --title "$title" --target main "$tag" $release_artifacts)
+readonly release_url
+echo "Release URL: $release_url"
diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
index 1bae9e3..58ea3b3 100644
--- a/.github/workflows/gradle.yml
+++ b/.github/workflows/gradle.yml
@@ -7,17 +7,20 @@ on:
branches: [main]
jobs:
- build:
-
+ build-and-test:
+ permissions:
+ contents: read
runs-on: ubuntu-latest
strategy:
matrix:
- java: [11, 17, 21, 23]
+ java: [17, 21, 25]
env:
- DEFAULT_JAVA: 11
+ DEFAULT_JAVA: 17
steps:
- - uses: actions/checkout@v5
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v5
@@ -26,10 +29,10 @@ jobs:
java-version: ${{ matrix.java }}
- name: Setup Gradle
- uses: gradle/actions/setup-gradle@v4
+ uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
- name: Cache SonarQube packages
- uses: actions/cache@v4
+ uses: actions/cache@v5
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-java-${{ matrix.java }}-sonar
@@ -40,7 +43,38 @@ jobs:
- name: Sonar analysis
if: ${{ env.DEFAULT_JAVA == matrix.java && env.SONAR_TOKEN != null }}
- run: ./gradlew sonarqube -Dsonar.token=$SONAR_TOKEN --info --warning-mode=summary
+ run: ./gradlew sonarqube -Dsonar.token=$SONAR_TOKEN --info --warning-mode=summary -PjavaVersion=${{ matrix.java }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+
+ ossindex:
+ permissions:
+ contents: read
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+ - name: Setup Java 17
+ uses: actions/setup-java@v5
+ with:
+ distribution: 'temurin'
+ java-version: 17
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
+ - name: Run OSS Index
+ run: ./gradlew ossIndex --info --warning-mode all
+ env:
+ ORG_GRADLE_PROJECT_ossIndexUsername: ${{ secrets.OSSINDEX_USERNAME }}
+ ORG_GRADLE_PROJECT_ossIndexToken: ${{ secrets.OSSINDEX_TOKEN }}
+
+ build:
+ permissions:
+ contents: read
+ runs-on: ubuntu-slim
+ needs:
+ - build-and-test
+ - ossindex
+ steps:
+ - run: echo "Build successful"
\ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..1abf8c4
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,60 @@
+name: Release
+
+on:
+ workflow_dispatch:
+ inputs:
+ skip-deploy-maven-central:
+ description: "Skip deployment to Maven Central"
+ required: true
+ type: boolean
+ default: false
+
+jobs:
+ release:
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ shell: "bash"
+ concurrency:
+ group: ${{ github.workflow }}
+ cancel-in-progress: false
+ permissions:
+ contents: write # Required for creating GitHub release
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v6
+ with:
+ persist-credentials: false
+
+ - name: Fail if not running on main branch
+ if: ${{ github.ref != 'refs/heads/main' }}
+ run: |
+ echo "Not running on main branch, github.ref is $GITHUB_REF. Please start this workflow only on main."
+ exit 1
+ env:
+ GITHUB_REF: ${{ github.ref }}
+
+ - uses: actions/setup-java@v5
+ with:
+ distribution: "temurin"
+ java-version: 17
+
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92 # v6.2.0
+
+ - name: Build
+ run: ./gradlew clean build --info --warning-mode all
+
+ - name: Publish to Maven Central
+ if: ${{ !inputs.skip-deploy-maven-central }}
+ run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --info --warning-mode all
+ env:
+ ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.MAVEN_CENTRAL_PORTAL_USERNAME }}
+ ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.MAVEN_CENTRAL_PORTAL_TOKEN }}
+ ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
+ ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
+
+ - name: Create GitHub Release
+ run: ./.github/workflows/github_release.sh
+ env:
+ GH_TOKEN: ${{ github.token }}
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
index e399cb1..776b31e 100644
--- a/.settings/org.eclipse.jdt.core.prefs
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -11,9 +11,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=11
+org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -113,7 +113,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=11
+org.eclipse.jdt.core.compiler.source=17
org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8fb9e45..fe872ce 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,9 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-## [1.8.0] - unreleased
+## [2.0.1] - unreleased
+
+## [2.0.0] - 2026-06-14
+
+**Breaking Change**: Starting with this release this project requires Java 17.
- [#65](https://github.com/kaklakariada/fritzbox-java-api/pull/65) Upgrade dependencies
+- [#67](https://github.com/kaklakariada/fritzbox-java-api/pull/67) Upgrade dependencies, migrate Maven Central deployment
## [1.7.0] - 2023-10-07
diff --git a/README.md b/README.md
index 4e586a8..08eb5b5 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
[](https://sonarcloud.io/dashboard?id=com.github.kaklakariada%3Afritzbox-java-api)
[](https://search.maven.org/artifact/com.github.kaklakariada/fritzbox-java-api)
-Java API for managing FritzBox HomeAutomation using [AVM Home Automation HTTP Interface](https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/AHA-HTTP-Interface.pdf) inspired by grundid's [fritzbox-java-api](https://github.com/grundid/fritzbox-java-api). This also runs on Android devices (see [Andect](https://github.com/kaklakariada/Andect)).
+Java API for managing FritzBox HomeAutomation using [AVM Home Automation HTTP Interface](https://fritz.support/resources/AHA-HTTP-Interface.pdf) inspired by [grundid](https://github.com/grundid)'s [fritzbox-java-api](https://github.com/grundid/fritzbox-java-api).
## Important: Migration to Maven Central
@@ -16,9 +16,12 @@ repositories {
}
```
-## Changelog
+## Information for Users
-See [CHANGELOG.md](CHANGELOG.md).
+* [CHANGELOG.md](CHANGELOG.md)
+* [JavaDoc](https://kaklakariada.github.io/fritzbox-java-api/javadoc/)
+* [Test Results](https://kaklakariada.github.io/fritzbox-java-api/reports/tests/test/)
+* [Test Coverage Report](https://kaklakariada.github.io/fritzbox-java-api/reports/jacoco/test/html/)
## Usage
@@ -36,7 +39,7 @@ See [CHANGELOG.md](CHANGELOG.md).
```groovy
dependencies {
- compile 'com.github.kaklakariada:fritzbox-java-api:1.6.1'
+ compile 'com.github.kaklakariada:fritzbox-java-api:2.0.0'
}
```
@@ -46,7 +49,7 @@ See [CHANGELOG.md](CHANGELOG.md).
com.github.kaklakariada
fritzbox-java-api
- 1.6.1
+ 2.0.0
```
@@ -77,6 +80,13 @@ See [CHANGELOG.md](CHANGELOG.md).
### Check dependencies for vulnerabilities
+Add the following to your `~/.gradle/gradle.properties`:
+
+```properties
+ossIndexUsername =
+ossIndexToken =
+```
+
```sh
./gradlew ossIndexAudit
```
@@ -88,32 +98,20 @@ Install to local maven repository:
./gradlew clean publishToMavenLocal
```
-### Publish to Maven Central
+### Creating a Release
-1. Add the following to your `~/.gradle/gradle.properties`:
-
- ```properties
- ossrhUsername=
- ossrhPassword=
-
- signing.keyId=
- signing.password=
- signing.secretKeyRingFile=
- ```
+#### Preparations
-2. Increment version number in `build.gradle` and `README.md`, update [CHANGELOG.md](CHANGELOG.md), commit and push.
+1. Checkout the `main` branch, create a new branch.
+2. Update version number in `build.gradle` and `README.md`.
+3. Add changes in new version to `CHANGELOG.md`.
+4. Commit and push changes.
+5. Create a new pull request, have it reviewed and merged to `main`.
-3. Optional: run the following command to do a dry-run:
-
- ```sh
- ./gradlew clean check build publishToSonatype closeSonatypeStagingRepository --info
- ```
-
-4. Run the following command to publish to Maven Central:
-
- ```sh
- ./gradlew clean check build publishToSonatype closeAndReleaseSonatypeStagingRepository --info
- ```
+#### Perform the Release
-5. Create a new [release](https://github.com/kaklakariada/fritzbox-java-api/releases) on GitHub.
-6. After some time the release will be available at [Maven Central](https://repo1.maven.org/maven2/com/github/kaklakariada/fritzbox-java-api/).
+1. Start the release workflow
+ * Run command `gh workflow run release.yml --repo kaklakariada/fritzbox-java-api --ref main`
+ * or go to [GitHub Actions](https://github.com/kaklakariada/fritzbox-java-api/actions/workflows/release.yml) and start the `release.yml` workflow on branch `main`.
+2. Update title and description of the newly created [GitHub release](https://github.com/kaklakariada/fritzbox-java-api/releases).
+3. After some time the release will be available at [Maven Central](https://repo1.maven.org/maven2/com/github/kaklakariada/fritzbox-java-api/).
diff --git a/build.gradle b/build.gradle
index 6394b3f..3e0b01e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,21 +1,21 @@
plugins {
id "java-library"
- id "signing"
+ id 'signing'
id "maven-publish"
id "jacoco"
id "com.github.hierynomus.license" version "0.16.1"
- id "org.sonarqube" version "6.0.1.5171"
+ id "org.sonarqube" version "7.3.1.8318"
+ id "com.github.ben-manes.versions" version "0.54.0"
+ id "org.sonatype.gradle.plugins.scan" version "3.1.5"
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
- id "com.github.ben-manes.versions" version "0.51.0"
- id "org.sonatype.gradle.plugins.scan" version "2.8.3"
}
group = 'com.github.kaklakariada'
-version = '1.7.0'
+version = '1.7.1'
java {
toolchain {
- def javaVersion = project.hasProperty('javaVersion') ? project.getProperty('javaVersion') : 11
+ def javaVersion = project.hasProperty('javaVersion') ? project.getProperty('javaVersion') : 17
languageVersion = JavaLanguageVersion.of(javaVersion)
}
withJavadocJar()
@@ -35,20 +35,20 @@ tasks.withType(JavaCompile) {
testing {
suites {
test {
- useJUnitJupiter()
+ useJUnitJupiter("6.1.0")
}
}
}
dependencies {
- implementation 'com.squareup.okhttp3:okhttp:4.12.0'
+ implementation 'com.squareup.okhttp3:okhttp:5.4.0'
implementation 'com.subshell.simpleframework:simple-xml:2.9.0'
- implementation 'org.slf4j:slf4j-api:2.0.16'
+ implementation 'org.slf4j:slf4j-api:2.0.18'
- testRuntimeOnly 'ch.qos.logback:logback-classic:1.5.15'
+ testRuntimeOnly 'ch.qos.logback:logback-classic:1.5.34'
- testImplementation 'org.mockito:mockito-core:5.14.2'
- testImplementation 'org.assertj:assertj-core:3.27.0'
+ testImplementation 'org.mockito:mockito-core:5.23.0'
+ testImplementation 'org.assertj:assertj-core:3.27.7'
}
license {
@@ -115,30 +115,7 @@ publishing {
repositories {
maven {
- def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
- def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
- url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
- allowInsecureProtocol = false
- credentials(PasswordCredentials) {
- username = getOptionalProperty("ossrhUsername")
- password = getOptionalProperty("ossrhPassword")
- }
- }
- }
-}
-
-
-signing {
- sign publishing.publications.mavenJava
-}
-
-nexusPublishing {
- packageGroup = project.group
- repositories {
- sonatype {
- stagingProfileId = "4f1b95618be44"
- username = getOptionalProperty("ossrhUsername")
- password = getOptionalProperty("ossrhPassword")
+ url = layout.buildDirectory.dir('staging-deploy')
}
}
}
@@ -156,11 +133,27 @@ tasks.named("dependencyUpdates").configure {
}
}
+signing {
+ def signingKey = findProperty("signingKey")
+ def signingPassword = findProperty("signingPassword")
+ useInMemoryPgpKeys(signingKey, signingPassword)
+ sign publishing.publications.mavenJava
+}
+
+nexusPublishing {
+ packageGroup = project.group
+ repositories {
+ sonatype {
+ nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
+ }
+ }
+}
+
ossIndexAudit {
+ username = findProperty('ossIndexUsername')
+ password = findProperty('ossIndexToken')
allConfigurations = false
useCache = true
excludeVulnerabilityIds = []
printBanner = false
}
-
-rootProject.tasks["build"].dependsOn(tasks["ossIndexAudit"])
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index a4b76b9..b1b8ef5 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index cea7a79..df6a6ad 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
networkTimeout=10000
+retries=0
+retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index f3b75f3..b9bb139 100755
--- a/gradlew
+++ b/gradlew
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 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.
@@ -57,7 +57,7 @@
# 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
+# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/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/.
@@ -114,7 +114,6 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@ fi
# 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" )
@@ -205,15 +203,14 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# * 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" \
- org.gradle.wrapper.GradleWrapperMain \
+ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
diff --git a/gradlew.bat b/gradlew.bat
index 9b42019..aa5f10b 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -23,8 +23,8 @@
@rem
@rem ##########################################################################
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
+@rem Set local scope for the variables, and ensure extensions are enabled
+setlocal EnableExtensions
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@@ -51,7 +51,7 @@ 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
+"%COMSPEC%" /c exit 1
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
@@ -65,30 +65,18 @@ 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
+"%COMSPEC%" /c exit 1
:execute
@rem Setup the command line
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
+@rem which allows us to clear the local environment before executing the java command
+endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
-: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
+:exitWithErrorLevel
+@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
+"%COMSPEC%" /c exit %ERRORLEVEL%