From 7818d168c2bf2b7aaec75537e77f3c2bec840f91 Mon Sep 17 00:00:00 2001 From: csowada Date: Wed, 29 Jan 2025 20:24:10 +0100 Subject: [PATCH] Update dependecies, license headers and pipelines --- .github/workflows/codeql-analysis.yml | 92 +++++++++++++++++++ .github/workflows/maven-publish.yml | 15 ++- .github/workflows/maven.yml | 89 ++++++++---------- pom.xml | 16 ++-- .../EBusConfigurationReaderExt.java | 2 +- .../EBusConfigurationVersion.java | 2 +- .../de/csdev/ebus/StaticTestTelegrams.java | 2 +- src/test/java/de/csdev/ebus/TestUtils.java | 2 +- .../ebus/cfg/EBusCommonTelegramTest.java | 2 +- .../cfg/EBusCommonVaillantDateTimeTest.java | 2 +- .../ebus/cfg/EBusVaillantTelegramTest.java | 2 +- .../cfg/EBusVaillantVRC430TelegramTest.java | 2 +- .../de/csdev/ebus/cfg/EBusWolfBM2Test.java | 2 +- .../de/csdev/ebus/cfg/EBusWolfCWLTest.java | 2 +- .../ebus/cfg/EBusWolfMMTelegramTest.java | 2 +- .../ebus/cfg/EBusWolfSM1TelegramTest.java | 2 +- .../java/de/csdev/ebus/cfg/KW_CRC_Test.java | 2 +- .../ebus/wip/EBusCommonTelegramTest2.java | 2 +- .../csdev/ebus/wip/EBusdControllerTest.java | 2 +- 19 files changed, 166 insertions(+), 76 deletions(-) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..abc9f64 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,92 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL Advanced" + +on: + push: + branches: [ "master", "develop" ] + pull_request: + branches: [ "master", "develop" ] + schedule: + - cron: '26 10 * * 5' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: java-kotlin + build-mode: none # This mode only analyzes Java. Set this to 'autobuild' or 'manual' to analyze Kotlin too. + # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # If the analyze step fails for one of the languages you are analyzing with + # "We were unable to automatically build your code", modify the matrix above + # to set the build mode to "manual" for that language. Then modify this step + # to build your code. + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 7ef3771..a6243bc 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -15,12 +15,15 @@ jobs: build: runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - uses: actions/checkout@v2 - name: Use Cache for Maven packages - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} @@ -33,9 +36,11 @@ jobs: GPG_FILE: ${{secrets.GPG_FILE}} - name: Set up Java for Apache Maven Central - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 11 + distribution: temurin + cache: maven server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml server-username: OSSRH_USERNAME # env variable for username in deploy server-password: OSSRH_PASSWORD # env variable for token in deploy @@ -53,10 +58,12 @@ jobs: GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - name: Set up Java for publishing to GitHub Packages - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 11 - + distribution: temurin + cache: maven + - name: Publish to GitHub Packages # -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/csowada/ebus run: mvn deploy --batch-mode --update-snapshots -P !sign,!build-extras,!deploy-ossrh,deploy-github -Dmaven.test.skip=true diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index e295577..9d040cb 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -5,60 +5,51 @@ name: Java CI with Maven on: push: - branches: [ master, develop ] + branches: [master, develop] pull_request: types: [opened, synchronize, reopened] jobs: - build: - runs-on: ubuntu-latest + permissions: + contents: read + packages: write steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - - name: Cache Maven packages - uses: actions/cache@v2 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - - name: Cache SonarCloud packages - uses: actions/cache@v2 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - - name: Set up Java - uses: actions/setup-java@v1 - with: - java-version: 11 - server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml - server-username: OSSRH_USERNAME # env variable for username in deploy - server-password: OSSRH_PASSWORD # env variable for token in deploy - - - name: Build and analyze - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - BUILD_NUMBER: ${{ github.run_id }}-${{ github.run_number }} - - - name: Upload Maven build artifact - uses: actions/upload-artifact@v2 - with: - name: artifact - path: target/*.jar - - # Upload if develop branch - - name: Upload snapshot to OSSRH if development release - if: ${{ github.ref == 'refs/heads/develop' && github.event_name == 'push' }} - run: mvn deploy --batch-mode --update-snapshots -P !sign,!build-extras,deploy-ossrh -Dmaven.test.skip=true -DskipChecks -DskipTest - env: - OSSRH_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }} - OSSRH_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }} \ No newline at end of file + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + + - name: Set up Java + uses: actions/setup-java@v4 + with: + java-version: 11 + distribution: temurin + cache: maven + server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml + server-username: OSSRH_USERNAME # env variable for username in deploy + server-password: OSSRH_PASSWORD # env variable for token in deploy + + - name: Build with Maven + run: mvn -B package --file pom.xml + + - name: Upload Maven build artifact + uses: actions/upload-artifact@v4 + with: + name: artifact + path: target/*.jar + + # Upload if develop branch + - name: Upload snapshot to OSSRH if development release + if: ${{ github.ref == 'refs/heads/develop' && github.event_name == 'push' }} + run: mvn deploy --batch-mode --update-snapshots -P !sign,!build-extras,deploy-ossrh -Dmaven.test.skip=true -DskipChecks -DskipTest + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }} diff --git a/pom.xml b/pom.xml index 1e31c2d..2443d4d 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ eBUS library configuration de.cs-dev.ebus ebus-configuration - 1.1.8 + 1.1.9-SNAPSHOT https://github.com/csowada/ebus-configuration bundle @@ -17,13 +17,13 @@ 1.8 1.8 8 - 2023 + 2025 ${project.version} csowada_ebus-configuration csowada https://sonarcloud.io - 1.1.10 + 1.1.11 @@ -245,7 +245,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.8 + 1.6.14 true ossrh @@ -308,14 +308,14 @@ com.google.code.gson gson - 2.8.9 + 2.11.0 test org.apache.commons commons-lang3 - 3.12.0 + 3.17.0 test @@ -336,14 +336,14 @@ ch.qos.logback logback-classic - 1.2.10 + 1.5.16 test org.slf4j slf4j-api - 1.7.32 + 1.7.36 provided diff --git a/src/main/java/de/csdev/ebus/configuration/EBusConfigurationReaderExt.java b/src/main/java/de/csdev/ebus/configuration/EBusConfigurationReaderExt.java index 217d220..1e0331c 100644 --- a/src/main/java/de/csdev/ebus/configuration/EBusConfigurationReaderExt.java +++ b/src/main/java/de/csdev/ebus/configuration/EBusConfigurationReaderExt.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2023 by the respective copyright holders. + * Copyright (c) 2016-2025 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/main/java/de/csdev/ebus/configuration/EBusConfigurationVersion.java b/src/main/java/de/csdev/ebus/configuration/EBusConfigurationVersion.java index cf9ffa7..cec19b9 100644 --- a/src/main/java/de/csdev/ebus/configuration/EBusConfigurationVersion.java +++ b/src/main/java/de/csdev/ebus/configuration/EBusConfigurationVersion.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2023 by the respective copyright holders. + * Copyright (c) 2016-2025 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/StaticTestTelegrams.java b/src/test/java/de/csdev/ebus/StaticTestTelegrams.java index c98116f..9836f3a 100644 --- a/src/test/java/de/csdev/ebus/StaticTestTelegrams.java +++ b/src/test/java/de/csdev/ebus/StaticTestTelegrams.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2023 by the respective copyright holders. + * Copyright (c) 2016-2025 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/TestUtils.java b/src/test/java/de/csdev/ebus/TestUtils.java index f9e7873..6469b5a 100644 --- a/src/test/java/de/csdev/ebus/TestUtils.java +++ b/src/test/java/de/csdev/ebus/TestUtils.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2023 by the respective copyright holders. + * Copyright (c) 2016-2025 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/EBusCommonTelegramTest.java b/src/test/java/de/csdev/ebus/cfg/EBusCommonTelegramTest.java index b2f322a..8d78d9a 100644 --- a/src/test/java/de/csdev/ebus/cfg/EBusCommonTelegramTest.java +++ b/src/test/java/de/csdev/ebus/cfg/EBusCommonTelegramTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2023 by the respective copyright holders. + * Copyright (c) 2016-2025 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/EBusCommonVaillantDateTimeTest.java b/src/test/java/de/csdev/ebus/cfg/EBusCommonVaillantDateTimeTest.java index 3fa4314..14670b2 100644 --- a/src/test/java/de/csdev/ebus/cfg/EBusCommonVaillantDateTimeTest.java +++ b/src/test/java/de/csdev/ebus/cfg/EBusCommonVaillantDateTimeTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2023 by the respective copyright holders. + * Copyright (c) 2016-2025 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/EBusVaillantTelegramTest.java b/src/test/java/de/csdev/ebus/cfg/EBusVaillantTelegramTest.java index 39ad61e..e27f9f2 100644 --- a/src/test/java/de/csdev/ebus/cfg/EBusVaillantTelegramTest.java +++ b/src/test/java/de/csdev/ebus/cfg/EBusVaillantTelegramTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2023 by the respective copyright holders. + * Copyright (c) 2016-2025 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/EBusVaillantVRC430TelegramTest.java b/src/test/java/de/csdev/ebus/cfg/EBusVaillantVRC430TelegramTest.java index 2353ca5..3f8fc38 100644 --- a/src/test/java/de/csdev/ebus/cfg/EBusVaillantVRC430TelegramTest.java +++ b/src/test/java/de/csdev/ebus/cfg/EBusVaillantVRC430TelegramTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2023 by the respective copyright holders. + * Copyright (c) 2016-2025 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/EBusWolfBM2Test.java b/src/test/java/de/csdev/ebus/cfg/EBusWolfBM2Test.java index 7e25260..2cbe40d 100644 --- a/src/test/java/de/csdev/ebus/cfg/EBusWolfBM2Test.java +++ b/src/test/java/de/csdev/ebus/cfg/EBusWolfBM2Test.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2023 by the respective copyright holders. + * Copyright (c) 2016-2025 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/EBusWolfCWLTest.java b/src/test/java/de/csdev/ebus/cfg/EBusWolfCWLTest.java index 35e649b..941548e 100644 --- a/src/test/java/de/csdev/ebus/cfg/EBusWolfCWLTest.java +++ b/src/test/java/de/csdev/ebus/cfg/EBusWolfCWLTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2023 by the respective copyright holders. + * Copyright (c) 2016-2025 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/EBusWolfMMTelegramTest.java b/src/test/java/de/csdev/ebus/cfg/EBusWolfMMTelegramTest.java index 4bc8afc..1ab8af8 100644 --- a/src/test/java/de/csdev/ebus/cfg/EBusWolfMMTelegramTest.java +++ b/src/test/java/de/csdev/ebus/cfg/EBusWolfMMTelegramTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2023 by the respective copyright holders. + * Copyright (c) 2016-2025 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/EBusWolfSM1TelegramTest.java b/src/test/java/de/csdev/ebus/cfg/EBusWolfSM1TelegramTest.java index caa5d12..becbd48 100644 --- a/src/test/java/de/csdev/ebus/cfg/EBusWolfSM1TelegramTest.java +++ b/src/test/java/de/csdev/ebus/cfg/EBusWolfSM1TelegramTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2023 by the respective copyright holders. + * Copyright (c) 2016-2025 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/cfg/KW_CRC_Test.java b/src/test/java/de/csdev/ebus/cfg/KW_CRC_Test.java index 0c61467..9b8b178 100644 --- a/src/test/java/de/csdev/ebus/cfg/KW_CRC_Test.java +++ b/src/test/java/de/csdev/ebus/cfg/KW_CRC_Test.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2023 by the respective copyright holders. + * Copyright (c) 2016-2025 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/wip/EBusCommonTelegramTest2.java b/src/test/java/de/csdev/ebus/wip/EBusCommonTelegramTest2.java index 0509a41..59dbabd 100644 --- a/src/test/java/de/csdev/ebus/wip/EBusCommonTelegramTest2.java +++ b/src/test/java/de/csdev/ebus/wip/EBusCommonTelegramTest2.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2023 by the respective copyright holders. + * Copyright (c) 2016-2025 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 diff --git a/src/test/java/de/csdev/ebus/wip/EBusdControllerTest.java b/src/test/java/de/csdev/ebus/wip/EBusdControllerTest.java index 5accdd4..065f8dd 100644 --- a/src/test/java/de/csdev/ebus/wip/EBusdControllerTest.java +++ b/src/test/java/de/csdev/ebus/wip/EBusdControllerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2023 by the respective copyright holders. + * Copyright (c) 2016-2025 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0