diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index dc5634ec..f0daeeba 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -9,43 +9,59 @@ name: Build & Tests on: push: - branches: [ main, development ] + branches: [main, development] pull_request: workflow_dispatch: -env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - jobs: build: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - jdk: [ 17, 21 ] # (open)JDK releases + jdk: [17, 21, 25, 26] # (open)JDK releases runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 - - name: Set up openJDK version - uses: actions/setup-java@v5 - with: - java-version: ${{ matrix.jdk }} - distribution: 'zulu' - - name: Install Dependencies - run: npm install -g ro-crate-html-js - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v5 - - name: Build and Test with Gradle - run: ./gradlew -Dprofile=release build - - name: Upload (test) reports as artifact on GitHub on manual runs - if: github.event_name == 'workflow_dispatch' - uses: actions/upload-artifact@v5 - with: - name: test-report ${{ matrix.os }} JDK ${{ matrix.jdk }} - path: build/reports - - name: Do one Coveralls test report - if: matrix.os == 'ubuntu-latest' && matrix.jdk == 21 - run: ./gradlew -Dprofile=release jacocoTestReport coveralls - - name: Compile Javadoc - if: matrix.os == 'ubuntu-latest' && matrix.jdk == 21 - run: ./gradlew javadoc + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - name: Set up openJDK version + uses: actions/setup-java@v5 + with: + java-version: ${{ matrix.jdk }} + distribution: "zulu" + - name: Install Dependencies + run: npm install -g ro-crate-html-js + - name: Setup Gradle + uses: gradle/actions/setup-gradle@5e2ebd065dc2488b7a6ad670704656cbbe1e8f60 # v6 + - name: Build and Test with Gradle + run: ./gradlew -Dprofile=release build + - name: Upload (test) reports as artifact on GitHub on manual runs + if: github.event_name == 'workflow_dispatch' + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: test-report ${{ matrix.os }} JDK ${{ matrix.jdk }} + path: build/reports + coverage: + needs: build + runs-on: ubuntu-latest + env: + jdkversion: 25 + steps: + - name: Checkout repo + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + - name: Set up OpenJDK version ... + uses: actions/setup-java@v5 + with: + distribution: "zulu" + java-version: ${{ env.jdkversion }} + - name: Install Dependencies + run: npm install -g ro-crate-html-js + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle (JDK ${{ env.jdkversion }}) + run: ./gradlew clean check jacocoTestReport + - name: Codecov + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7 + with: + files: ./build/reports/jacoco/test/jacocoTestReport.xml #optional + - name: Compile Javadoc + run: ./gradlew javadoc diff --git a/build.gradle b/build.gradle index 8157ada6..6c6db9b3 100644 --- a/build.gradle +++ b/build.gradle @@ -3,8 +3,6 @@ plugins { id 'jvm-test-suite' id 'application' id 'jacoco' - // Adds coveralls task for CI to send results to the coveralls service. - id "com.github.kt3k.coveralls" version "2.12.2" // Instructions: https://github.com/researchgate/gradle-release // Available versions: https://plugins.gradle.org/plugin/net.researchgate.release @@ -13,7 +11,7 @@ plugins { // Publishing of JAR to Nexus instances (e.g., OSSRH) // https://github.com/gradle-nexus/publish-plugin id "io.github.gradle-nexus.publish-plugin" version "2.0.0" - id "io.freefair.maven-publish-java" version "9.1.0" + id "io.freefair.maven-publish-java" version "9.5.0" } group = 'edu.kit.datamanager' @@ -40,12 +38,12 @@ repositories { } ext { - jacksonVersion = '2.20.1' + jacksonVersion = '2.22.0' } dependencies { // JUnit setup for testing - testImplementation(platform("org.junit:junit-bom:6.0.1")) + testImplementation(platform("org.junit:junit-bom:6.1.0")) testImplementation('org.junit.jupiter:junit-jupiter') testRuntimeOnly('org.junit.platform:junit-platform-launcher') // JSON object mapping / (de-)serialization @@ -54,22 +52,22 @@ dependencies { // http client implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.14' // common file system operations - implementation group: 'commons-io', name: 'commons-io', version: '2.21.0' + implementation group: 'commons-io', name: 'commons-io', version: '2.22.0' // read from and write to zip files - implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '2.11.5' + implementation group: 'net.lingala.zip4j', name: 'zip4j', version: '2.11.6' // compare json documents in tests - implementation 'com.github.fslev:json-compare:7.2' + implementation 'com.github.fslev:json-compare:8.0' // url validator implementation group: 'commons-validator', name: 'commons-validator', version: '1.10.1' // logging - implementation group: 'org.slf4j', name: 'slf4j-jdk14', version: '2.0.17' + implementation group: 'org.slf4j', name: 'slf4j-jdk14', version: '2.0.18' // JSON-LD, Zenodo mapping implementation group: 'com.apicatalog', name: 'titanium-json-ld', version: '1.7.0' // metadata validation, profiles based on JSON schema implementation group: "com.networknt", name: "json-schema-validator", version: "1.5.9" implementation 'org.glassfish:jakarta.json:2.0.1' //JTE for template processing - implementation('gg.jte:jte:3.2.1') + implementation('gg.jte:jte:3.2.4') implementation("org.freemarker:freemarker:2.3.34") } @@ -186,12 +184,12 @@ jacocoTestReport { dependsOn test reports { csv.required = true - xml.required = true // coveralls plugin depends on xml format report + xml.required = true // codecov plugin may depend on xml format report } } jacoco { - toolVersion = "0.8.14" + toolVersion = "0.8.15" } // maxParallelForks(2) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 1b33c55b..b1b8ef56 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 d4081da4..df6a6ad7 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.14.3-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 23d15a93..b9bb139f 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="\\\"\\\"" # 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" ) @@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" diff --git a/gradlew.bat b/gradlew.bat index 5eed7ee8..aa5f10b0 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= @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" %* +@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%