diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 13863d0..a8fba16 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,20 +3,30 @@ updates: - package-ecosystem: "maven" directory: "/" schedule: - interval: "weekly" - day: "monday" - time: "06:00" - timezone: "UTC" + interval: "monthly" groups: - maven-dependencies: + maven-build-plugins: + patterns: + - "org.apache.maven.plugins:*" + - "org.jacoco:jacoco-maven-plugin" + - "org.owasp:dependency-check-maven" + - "org.sonatype.plugins:nexus-staging-maven-plugin" + java-production-dependencies: patterns: - "*" + exclude-patterns: + - "org.apache.maven.plugins:*" + - "org.jacoco:jacoco-maven-plugin" + - "org.owasp:dependency-check-maven" + - "org.sonatype.plugins:nexus-staging-maven-plugin" + - "org.junit.jupiter:*" ignore: # keep using Jetty 10.x (javax.*) instead of Jetty 11 (jakarta.*) - dependency-name: "org.eclipse.jetty:jetty-server" - versions: ["11.x"] + update-types: ["version-update:semver-major"] - dependency-name: "org.eclipse.jetty:jetty-servlet" - versions: ["11.x"] + update-types: ["version-update:semver-major"] + - package-ecosystem: "github-actions" directory: "/" # even for `.github/workflows` diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aac9066..0bfa731 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,27 +5,26 @@ jobs: build: name: Build and Test runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: 'temurin' cache: 'maven' - name: Ensure to use tagged version if: startsWith(github.ref, 'refs/tags/') - run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/} + run: mvn -B versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/} - name: Build and Test id: buildAndTest - run: mvn -B clean install jacoco:report -Pcoverage,dependency-check + run: mvn -B clean install jacoco:report -Pcoverage - name: Upload code coverage report id: codacyCoverageReporter run: bash <(curl -Ls https://coverage.codacy.com/get.sh) env: CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} continue-on-error: true - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: artifacts path: target/*.jar diff --git a/.github/workflows/dependency-check.yml b/.github/workflows/dependency-check.yml new file mode 100644 index 0000000..1cf2c73 --- /dev/null +++ b/.github/workflows/dependency-check.yml @@ -0,0 +1,63 @@ +name: OWASP Maven Dependency Check +on: + schedule: + - cron: '0 13 * * 0' + push: + branches: + - 'release/**' + workflow_dispatch: + + +jobs: + check-dependencies: + name: Check dependencies + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + show-progress: false + - name: Setup Java + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: 'temurin' + cache: 'maven' + - name: Cache NVD DB + uses: actions/cache@v4 + with: + path: ~/.m2/repository/org/owasp/dependency-check-data/ + key: dependency-check-${{ github.run_id }} + restore-keys: | + dependency-check + env: + SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 + - name: Run org.owasp:dependency-check plugin + id: dependency-check + continue-on-error: true + run: mvn -B validate -Pdependency-check + env: + NVD_API_KEY: ${{ secrets.NVD_API_KEY }} + - name: Upload report on failure + if: steps.dependency-check.outcome == 'failure' + uses: actions/upload-artifact@v4 + with: + name: dependency-check-report + path: target/dependency-check-report.html + if-no-files-found: error + - name: Slack Notification on regular check + if: github.event_name == 'schedule' && steps.dependency-check.outcome == 'failure' + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_USERNAME: 'Cryptobot' + SLACK_ICON: false + SLACK_ICON_EMOJI: ':bot:' + SLACK_CHANNEL: 'cryptomator-desktop' + SLACK_TITLE: "Vulnerabilities in ${{ github.event.repository.name }} detected." + SLACK_MESSAGE: "Download the for more details." + SLACK_FOOTER: false + MSG_MINIMAL: true + - name: Failing workflow on release branch + if: github.event_name == 'push' && steps.dependency-check.outcome == 'failure' + shell: bash + run: exit 1 diff --git a/.github/workflows/publish-central.yml b/.github/workflows/publish-central.yml index b3636ca..4325ed4 100644 --- a/.github/workflows/publish-central.yml +++ b/.github/workflows/publish-central.yml @@ -13,9 +13,9 @@ jobs: - uses: actions/checkout@v4 with: ref: "refs/tags/${{ github.event.inputs.tag }}" - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: 'temurin' cache: 'maven' server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index 8b74fdd..be60dec 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -8,9 +8,9 @@ jobs: if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: 'temurin' cache: 'maven' gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import diff --git a/.gitignore b/.gitignore index e2ab29d..8891ee1 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ test-output/ .idea/compiler.xml .idea/jarRepositories.xml *.iml + +# Maven +pom.xml.versionsBackup \ No newline at end of file diff --git a/pom.xml b/pom.xml index e768f6d..8e70a5b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.cryptomator webdav-nio-adapter - 2.0.5 + 2.0.6 WebDAV-NIO Adapter Embedded Jetty serving a WebDAV servlet to access resources at a given NIO path. https://github.com/cryptomator/webdav-nio-adapter @@ -20,16 +20,16 @@ 1.3.0 - 1.2.4 - 10.0.17 - 2.0.9 + 1.2.5 + 10.0.20 + 2.0.11 - 5.10.0 + 5.10.1 - 8.4.0 - 0.8.10 + 9.0.9 + 0.8.11 1.6.13 3.1.1 @@ -82,7 +82,7 @@ org.jetbrains annotations - 24.0.1 + 24.1.0 provided @@ -113,7 +113,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.12.1 ${project.build.jdk} true @@ -122,7 +122,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.1.2 + 3.2.5 org.apache.maven.plugins @@ -143,7 +143,7 @@ maven-javadoc-plugin - 3.6.0 + 3.6.3 attach-javadocs @@ -166,19 +166,19 @@ dependency-check-maven ${dependency-check.version} - 24 + 24 0 true true - - suppression.xml - + suppression.xml + ${env.NVD_API_KEY} check + validate