diff --git a/.gitattributes b/.gitattributes index 0f735982..d0ebba88 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,10 +2,13 @@ dependencies.md linguist-genera doc/changes/changelog.md linguist-generated=true pk_generated_parent.pom linguist-generated=true .github/workflows/broken_links_checker.yml linguist-generated=true -.github/workflows/ci-build-next-java.yml linguist-generated=true -.github/workflows/ci-build.yml linguist-generated=true -.github/workflows/dependencies_check.yml linguist-generated=true -.github/workflows/release_droid_prepare_original_checksum.yml linguist-generated=true -.github/workflows/release_droid_print_quick_checksum.yml linguist-generated=true -.github/workflows/release_droid_release_on_maven_central.yml linguist-generated=true +.github/workflows/ci-build-next-java.yml linguist-generated=true +.github/workflows/ci-build.yml linguist-generated=true +.github/workflows/dependencies_check.yml linguist-generated=true +.github/workflows/release_droid_prepare_original_checksum.yml linguist-generated=true +.github/workflows/release_droid_print_quick_checksum.yml linguist-generated=true +.github/workflows/release_droid_release_on_maven_central.yml linguist-generated=true .github/workflows/release_droid_upload_github_release_assets.yml linguist-generated=true + +.settings/org.eclipse.jdt.core.prefs linguist-generated=true +.settings/org.eclipse.jdt.ui.prefs linguist-generated=true diff --git a/.github/workflows/broken_links_checker.yml b/.github/workflows/broken_links_checker.yml index c4ff3be8..82ec1cd5 100644 --- a/.github/workflows/broken_links_checker.yml +++ b/.github/workflows/broken_links_checker.yml @@ -15,16 +15,18 @@ jobs: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Configure broken links checker run: | mkdir -p ./target echo '{"aliveStatusCodes": [429, 200], "ignorePatterns": [' \ '{"pattern": "^https?://(www|dev).mysql.com/"},' \ '{"pattern": "^https?://(www.)?opensource.org"}' \ + '{"pattern": "^https?://(www.)?eclipse.org"}' \ + '{"pattern": "^https?://projects.eclipse.org"}' \ ']}' > ./target/broken_links_checker.json - uses: gaurav-nelson/github-action-markdown-link-check@v1 with: - use-quiet-mode: 'yes' - use-verbose-mode: 'yes' + use-quiet-mode: "yes" + use-verbose-mode: "yes" config-file: ./target/broken_links_checker.json diff --git a/.github/workflows/ci-build-next-java.yml b/.github/workflows/ci-build-next-java.yml index e0c15cfb..7cbab08e 100644 --- a/.github/workflows/ci-build-next-java.yml +++ b/.github/workflows/ci-build-next-java.yml @@ -14,15 +14,15 @@ jobs: cancel-in-progress: true steps: - name: Checkout the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up JDK 17 uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: "temurin" java-version: 17 - cache: 'maven' + cache: "maven" - name: Run tests and build with Maven run: | mvn --batch-mode --update-snapshots clean package -DtrimStackTrace=false \ diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index e5208701..d19ee2a8 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -1,5 +1,6 @@ +# Generated by Project Keeper +# https://github.com/exasol/project-keeper/blob/main/project-keeper/src/main/resources/templates/.github/workflows/ci-build.yml name: CI Build - on: push: branches: @@ -13,16 +14,23 @@ jobs: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true steps: + - name: Free Disk Space + if: ${{ false }} + run: | + sudo rm -rf /usr/local/lib/android + sudo rm -rf /usr/share/dotnet - name: Checkout the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up JDK 11 + - name: Set up JDK 11 & 17 uses: actions/setup-java@v3 with: - distribution: 'temurin' - java-version: 11 - cache: 'maven' + distribution: "temurin" + java-version: | + 17 + 11 + cache: "maven" - name: Cache SonarCloud packages uses: actions/cache@v3 with: @@ -33,7 +41,7 @@ jobs: run: echo 'testcontainers.reuse.enable=true' > "$HOME/.testcontainers.properties" - name: Run tests and build with Maven run: | - mvn --batch-mode clean verify \ + JAVA_HOME=$JAVA_HOME_11_X64 mvn --batch-mode clean verify \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -DtrimStackTrace=false - name: Publish Test Report @@ -44,12 +52,12 @@ jobs: - name: Sonar analysis if: ${{ env.SONAR_TOKEN != null }} run: | - mvn --batch-mode org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + JAVA_HOME=$JAVA_HOME_17_X64 mvn --batch-mode org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ -DtrimStackTrace=false \ -Dsonar.organization=exasol \ -Dsonar.host.url=https://sonarcloud.io \ - -Dsonar.login=$SONAR_TOKEN + -Dsonar.token=$SONAR_TOKEN env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/dependencies_check.yml b/.github/workflows/dependencies_check.yml index b2ab2316..4b6eadf6 100644 --- a/.github/workflows/dependencies_check.yml +++ b/.github/workflows/dependencies_check.yml @@ -1,20 +1,35 @@ -name: Dependencies Check +name: Report Security Issues for Repository on: + workflow_dispatch: schedule: - cron: "0 2 * * *" jobs: - build: + report_security_issues: runs-on: ubuntu-latest + permissions: + issues: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 11 uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: "temurin" java-version: 11 - cache: 'maven' - - name: Checking dependencies for vulnerabilities - run: mvn --batch-mode org.sonatype.ossindex.maven:ossindex-maven-plugin:audit -f pom.xml \ No newline at end of file + cache: "maven" + + - name: Generate ossindex report + run: | + mvn org.sonatype.ossindex.maven:ossindex-maven-plugin:audit \ + org.sonatype.ossindex.maven:ossindex-maven-plugin:audit-aggregate \ + -Dossindex.reportFile=$(pwd)/ossindex-report.json \ + -Dossindex.fail=false + + - name: Report Security Issues + uses: exasol/python-toolbox/.github/actions/security-issues@main + with: + format: "maven" + command: "cat ossindex-report.json" + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release_droid_prepare_original_checksum.yml b/.github/workflows/release_droid_prepare_original_checksum.yml index 4a980f83..ba96c121 100644 --- a/.github/workflows/release_droid_prepare_original_checksum.yml +++ b/.github/workflows/release_droid_prepare_original_checksum.yml @@ -7,16 +7,21 @@ jobs: build: runs-on: ubuntu-latest steps: + - name: Free Disk Space + if: ${{ false }} + run: | + sudo rm -rf /usr/local/lib/android + sudo rm -rf /usr/share/dotnet - name: Checkout the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up JDK 11 uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: "temurin" java-version: 11 - cache: 'maven' + cache: "maven" - name: Enable testcontainer reuse run: echo 'testcontainers.reuse.enable=true' > "$HOME/.testcontainers.properties" - name: Run tests and build with Maven @@ -28,4 +33,4 @@ jobs: with: name: original_checksum retention-days: 5 - path: original_checksum \ No newline at end of file + path: original_checksum diff --git a/.github/workflows/release_droid_print_quick_checksum.yml b/.github/workflows/release_droid_print_quick_checksum.yml index 8add957f..aed44449 100644 --- a/.github/workflows/release_droid_print_quick_checksum.yml +++ b/.github/workflows/release_droid_print_quick_checksum.yml @@ -8,17 +8,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up JDK 11 uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: "temurin" java-version: 11 - cache: 'maven' + cache: "maven" - name: Build with Maven skipping tests run: mvn --batch-mode clean verify -DskipTests - name: Print checksum run: echo 'checksum_start==';find target -maxdepth 1 -name *.jar -exec sha256sum "{}" + | xargs;echo '==checksum_end' - diff --git a/.github/workflows/release_droid_release_on_maven_central.yml b/.github/workflows/release_droid_release_on_maven_central.yml index b4676072..dfdbd6a8 100644 --- a/.github/workflows/release_droid_release_on_maven_central.yml +++ b/.github/workflows/release_droid_release_on_maven_central.yml @@ -8,15 +8,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Maven Central Repository uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: "temurin" java-version: 11 - cache: 'maven' + cache: "maven" server-id: ossrh server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD @@ -27,4 +27,4 @@ jobs: env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \ No newline at end of file + MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} diff --git a/.github/workflows/release_droid_upload_github_release_assets.yml b/.github/workflows/release_droid_upload_github_release_assets.yml index 7350fafd..7ae8bbb7 100644 --- a/.github/workflows/release_droid_upload_github_release_assets.yml +++ b/.github/workflows/release_droid_upload_github_release_assets.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: upload_url: - description: 'Assets upload URL' + description: "Assets upload URL" required: true jobs: @@ -12,15 +12,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up JDK 11 uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: "temurin" java-version: 11 - cache: 'maven' + cache: "maven" - name: Build with Maven skipping tests run: mvn --batch-mode clean verify -DskipTests - name: Generate sha256sum files diff --git a/.gitignore b/.gitignore index cfd95ffc..071c4e65 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,9 @@ bin target .cache dependency-reduced-pom.xml +/.settings/org.eclipse.core.resources.prefs +/.settings/org.eclipse.jdt.apt.core.prefs +/.settings/org.eclipse.m2e.core.prefs # Intellij .idea diff --git a/.project-keeper.yml b/.project-keeper.yml index 28ceec82..778bd41e 100644 --- a/.project-keeper.yml +++ b/.project-keeper.yml @@ -3,7 +3,3 @@ sources: path: pom.xml modules: - maven_central -excludes: - - "E-PK-CORE-18: Outdated content: '.github/workflows/release_droid_upload_github_release_assets.yml'" -linkReplacements: - - "LICENSE-exasol-script-api.txt|https://opensource.org/licenses/MIT" diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index cdfe4f1b..00000000 --- a/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,5 +0,0 @@ -eclipse.preferences.version=1 -encoding//src/main/java=UTF-8 -encoding//src/test/java=UTF-8 -encoding//src/test/resources=UTF-8 -encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 8b5a9aaa..bb40c3fa 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -111,7 +111,7 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning 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.processAnnotations=enabled +org.eclipse.jdt.core.compiler.processAnnotations=disabled org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=11 org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f1..00000000 --- a/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/dependencies.md b/dependencies.md index b1aa1f75..90061c82 100644 --- a/dependencies.md +++ b/dependencies.md @@ -11,14 +11,14 @@ ## Test Dependencies -| Dependency | License | -| ----------------------------------------- | ---------------------------------------------- | -| [Hamcrest][7] | [BSD License 3][8] | -| [JSONassert][9] | [The Apache Software License, Version 2.0][10] | -| [JUnit Jupiter (Aggregator)][11] | [Eclipse Public License v2.0][12] | -| [mockito-junit-jupiter][13] | [The MIT License][14] | -| [JUnit5 System Extensions][15] | [Eclipse Public License v2.0][16] | -| [EqualsVerifier | release normal jar][17] | [Apache License, Version 2.0][18] | +| Dependency | License | +| ------------------------------------------ | ---------------------------------------------- | +| [Hamcrest][7] | [BSD License 3][8] | +| [JSONassert][9] | [The Apache Software License, Version 2.0][10] | +| [JUnit Jupiter (Aggregator)][11] | [Eclipse Public License v2.0][12] | +| [mockito-junit-jupiter][13] | [MIT][14] | +| [JUnit5 System Extensions][15] | [Eclipse Public License v2.0][16] | +| [EqualsVerifier \| release normal jar][17] | [Apache License, Version 2.0][18] | ## Runtime Dependencies @@ -28,30 +28,25 @@ ## Plugin Dependencies -| Dependency | License | -| ------------------------------------------------------- | ---------------------------------------------- | -| [SonarQube Scanner for Maven][19] | [GNU LGPL 3][20] | -| [Apache Maven Compiler Plugin][21] | [Apache-2.0][18] | -| [Apache Maven Enforcer Plugin][22] | [Apache-2.0][18] | -| [Maven Flatten Plugin][23] | [Apache Software Licenese][18] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][24] | [ASL2][10] | -| [Maven Surefire Plugin][25] | [Apache-2.0][18] | -| [Versions Maven Plugin][26] | [Apache License, Version 2.0][18] | -| [duplicate-finder-maven-plugin Maven Mojo][27] | [Apache License 2.0][28] | -| [Apache Maven Deploy Plugin][29] | [Apache-2.0][18] | -| [Apache Maven GPG Plugin][30] | [Apache License, Version 2.0][18] | -| [Apache Maven Source Plugin][31] | [Apache License, Version 2.0][18] | -| [Apache Maven Javadoc Plugin][32] | [Apache-2.0][18] | -| [Nexus Staging Maven Plugin][33] | [Eclipse Public License][34] | -| [JaCoCo :: Maven Plugin][35] | [Eclipse Public License 2.0][36] | -| [error-code-crawler-maven-plugin][37] | [MIT License][38] | -| [Reproducible Build Maven Plugin][39] | [Apache 2.0][10] | -| [Project keeper maven plugin][40] | [The MIT License][41] | -| [Maven Clean Plugin][42] | [The Apache Software License, Version 2.0][10] | -| [Maven Resources Plugin][43] | [The Apache Software License, Version 2.0][10] | -| [Maven JAR Plugin][44] | [The Apache Software License, Version 2.0][10] | -| [Maven Install Plugin][45] | [The Apache Software License, Version 2.0][10] | -| [Maven Site Plugin 3][46] | [The Apache Software License, Version 2.0][10] | +| Dependency | License | +| ------------------------------------------------------- | --------------------------------- | +| [SonarQube Scanner for Maven][19] | [GNU LGPL 3][20] | +| [Apache Maven Compiler Plugin][21] | [Apache-2.0][18] | +| [Apache Maven Enforcer Plugin][22] | [Apache-2.0][18] | +| [Maven Flatten Plugin][23] | [Apache Software Licenese][18] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][24] | [ASL2][10] | +| [Maven Surefire Plugin][25] | [Apache-2.0][18] | +| [Versions Maven Plugin][26] | [Apache License, Version 2.0][18] | +| [duplicate-finder-maven-plugin Maven Mojo][27] | [Apache License 2.0][28] | +| [Apache Maven Deploy Plugin][29] | [Apache-2.0][18] | +| [Apache Maven GPG Plugin][30] | [Apache-2.0][18] | +| [Apache Maven Source Plugin][31] | [Apache License, Version 2.0][18] | +| [Apache Maven Javadoc Plugin][32] | [Apache-2.0][18] | +| [Nexus Staging Maven Plugin][33] | [Eclipse Public License][34] | +| [JaCoCo :: Maven Plugin][35] | [Eclipse Public License 2.0][36] | +| [error-code-crawler-maven-plugin][37] | [MIT License][38] | +| [Reproducible Build Maven Plugin][39] | [Apache 2.0][10] | +| [Project keeper maven plugin][40] | [The MIT License][41] | [0]: https://github.com/eclipse-ee4j/jsonp [1]: https://projects.eclipse.org/license/epl-2.0 @@ -67,7 +62,7 @@ [11]: https://junit.org/junit5/ [12]: https://www.eclipse.org/legal/epl-v20.html [13]: https://github.com/mockito/mockito -[14]: https://github.com/mockito/mockito/blob/main/LICENSE +[14]: https://opensource.org/licenses/MIT [15]: https://github.com/itsallcode/junit5-system-extensions [16]: http://www.eclipse.org/legal/epl-v20.html [17]: https://www.jqno.nl/equalsverifier @@ -80,7 +75,7 @@ [24]: https://sonatype.github.io/ossindex-maven/maven-plugin/ [25]: https://maven.apache.org/surefire/maven-surefire-plugin/ [26]: https://www.mojohaus.org/versions/versions-maven-plugin/ -[27]: https://github.com/basepom/duplicate-finder-maven-plugin +[27]: https://basepom.github.io/duplicate-finder-maven-plugin [28]: http://www.apache.org/licenses/LICENSE-2.0.html [29]: https://maven.apache.org/plugins/maven-deploy-plugin/ [30]: https://maven.apache.org/plugins/maven-gpg-plugin/ @@ -95,8 +90,3 @@ [39]: http://zlika.github.io/reproducible-build-maven-plugin [40]: https://github.com/exasol/project-keeper/ [41]: https://github.com/exasol/project-keeper/blob/main/LICENSE -[42]: http://maven.apache.org/plugins/maven-clean-plugin/ -[43]: http://maven.apache.org/plugins/maven-resources-plugin/ -[44]: http://maven.apache.org/plugins/maven-jar-plugin/ -[45]: http://maven.apache.org/plugins/maven-install-plugin/ -[46]: http://maven.apache.org/plugins/maven-site-plugin/ diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 4f78c4ab..a58a5864 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [17.0.1](changes_17.0.1.md) * [17.0.0](changes_17.0.0.md) * [16.2.0](changes_16.2.0.md) * [16.1.5](changes_16.1.5.md) diff --git a/doc/changes/changes_17.0.1.md b/doc/changes/changes_17.0.1.md new file mode 100644 index 00000000..a1089606 --- /dev/null +++ b/doc/changes/changes_17.0.1.md @@ -0,0 +1,40 @@ +# Common Module of Exasol Virtual Schemas Adapters 17.0.1, released 2023-11-17 + +Code name: Improve logging + +## Summary + +This release logs responses for adapter calls at level `FINER` to simplify debugging and makes `LoggingConfiguration` serializable to allow configuring other components that require serializing. + +The release also marks exception handling properties as deprecated in preparation of #269. + +## Features + +* #276: Improved logging + +## Dependency Updates + +### Compile Dependency Updates + +* Updated `com.exasol:udf-api-java:1.0.2` to `1.0.3` +* Updated `jakarta.json:jakarta.json-api:2.1.2` to `2.1.3` + +### Test Dependency Updates + +* Updated `nl.jqno.equalsverifier:equalsverifier:3.14.3` to `3.15.3` +* Updated `org.junit.jupiter:junit-jupiter:5.9.3` to `5.10.1` +* Updated `org.mockito:mockito-junit-jupiter:5.4.0` to `5.7.0` + +### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:1.2.3` to `1.3.1` +* Updated `com.exasol:project-keeper-maven-plugin:2.9.7` to `2.9.16` +* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.3.0` to `3.4.1` +* Updated `org.apache.maven.plugins:maven-gpg-plugin:3.0.1` to `3.1.0` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.5.0` to `3.6.2` +* Updated `org.apache.maven.plugins:maven-surefire-plugin:3.0.0` to `3.2.2` +* Updated `org.basepom.maven:duplicate-finder-maven-plugin:1.5.1` to `2.0.1` +* Updated `org.codehaus.mojo:flatten-maven-plugin:1.4.1` to `1.5.0` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.15.0` to `2.16.1` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.9` to `0.8.11` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184` to `3.10.0.2594` diff --git a/pk_generated_parent.pom b/pk_generated_parent.pom index acaa3813..7994ee67 100644 --- a/pk_generated_parent.pom +++ b/pk_generated_parent.pom @@ -3,7 +3,7 @@ 4.0.0 com.exasol virtual-schema-common-java-generated-parent - 17.0.0 + 17.0.1 pom UTF-8 @@ -48,7 +48,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.9.1.2184 + 3.10.0.2594 org.apache.maven.plugins @@ -57,12 +57,18 @@ ${java.version} ${java.version} + true + + + -Xlint:all,-processing + + org.apache.maven.plugins maven-enforcer-plugin - 3.3.0 + 3.4.1 enforce-maven @@ -72,7 +78,7 @@ - [3.8.7,3.9.0) + 3.6.3 @@ -82,7 +88,7 @@ org.codehaus.mojo flatten-maven-plugin - 1.4.1 + 1.5.0 true oss @@ -121,7 +127,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0 + 3.2.2 @@ -132,7 +138,7 @@ org.codehaus.mojo versions-maven-plugin - 2.15.0 + 2.16.1 display-updates @@ -150,7 +156,7 @@ org.basepom.maven duplicate-finder-maven-plugin - 1.5.1 + 2.0.1 default @@ -168,7 +174,6 @@ true true false - true true false @@ -184,7 +189,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.1.0 sign-artifacts @@ -204,6 +209,9 @@ org.apache.maven.plugins maven-source-plugin + 3.2.1 @@ -217,7 +225,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.6.2 attach-javadocs @@ -232,6 +240,7 @@ true true true + true @@ -258,7 +267,7 @@ org.jacoco jacoco-maven-plugin - 0.8.9 + 0.8.11 prepare-agent @@ -299,7 +308,7 @@ com.exasol error-code-crawler-maven-plugin - 1.2.3 + 1.3.1 verify diff --git a/pom.xml b/pom.xml index cc9d4bd5..83528fb5 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 virtual-schema-common-java - 17.0.0 + 17.0.1 Common module of Exasol Virtual Schemas Adapters This is one of the modules of Virtual Schemas Adapters. The libraries provided by this project are the foundation of the adapter development, i.e. adapters must be implemented on top of them. @@ -11,7 +11,7 @@ jakarta.json jakarta.json-api - 2.1.2 + 2.1.3 org.glassfish @@ -23,7 +23,7 @@ com.exasol udf-api-java - 1.0.2 + 1.0.3 org.hamcrest @@ -40,13 +40,13 @@ org.junit.jupiter junit-jupiter - 5.9.3 + 5.10.1 test org.mockito mockito-junit-jupiter - 5.4.0 + 5.7.0 test @@ -58,7 +58,7 @@ nl.jqno.equalsverifier equalsverifier - 3.14.3 + 3.15.3 test @@ -72,7 +72,7 @@ com.exasol project-keeper-maven-plugin - 2.9.7 + 2.9.16 @@ -86,7 +86,7 @@ virtual-schema-common-java-generated-parent com.exasol - 17.0.0 + 17.0.1 pk_generated_parent.pom diff --git a/src/main/java/com/exasol/adapter/AdapterCallExecutor.java b/src/main/java/com/exasol/adapter/AdapterCallExecutor.java index 8d9cec56..4bdd4f86 100644 --- a/src/main/java/com/exasol/adapter/AdapterCallExecutor.java +++ b/src/main/java/com/exasol/adapter/AdapterCallExecutor.java @@ -117,4 +117,4 @@ public String executePushDownRequest(final PushDownRequest request, final ExaMet final PushDownResponse response = this.adapter.pushdown(metadata, request); return ResponseJsonConverter.getInstance().convertPushDownResponse(response); } -} \ No newline at end of file +} diff --git a/src/main/java/com/exasol/adapter/AdapterProperties.java b/src/main/java/com/exasol/adapter/AdapterProperties.java index 945a9b65..2f1ba182 100644 --- a/src/main/java/com/exasol/adapter/AdapterProperties.java +++ b/src/main/java/com/exasol/adapter/AdapterProperties.java @@ -41,7 +41,10 @@ public class AdapterProperties extends AbstractAdapterProperties { public static final String EXCLUDED_CAPABILITIES_PROPERTY = "EXCLUDED_CAPABILITIES"; /** * The constant EXCEPTION_HANDLING_PROPERTY. + * + * @deprecated this will be removed in the next release */ + @Deprecated(forRemoval = true) public static final String EXCEPTION_HANDLING_PROPERTY = "EXCEPTION_HANDLING"; /** * The constant IGNORE_ERRORS_PROPERTY. @@ -115,7 +118,9 @@ public String getExcludedCapabilities() { * Get the exception handling * * @return exception handling + * @deprecated this will be removed in the next release */ + @Deprecated(forRemoval = true) public String getExceptionHandling() { return get(EXCEPTION_HANDLING_PROPERTY); } @@ -228,7 +233,9 @@ public boolean hasExcludedCapabilities() { * Check if the exception handling property is set * * @return true if exception handling property is set + * @deprecated this will be removed in the next release */ + @Deprecated(forRemoval = true) public boolean hasExceptionHandling() { return containsKey(EXCEPTION_HANDLING_PROPERTY); } @@ -250,4 +257,4 @@ public boolean hasIgnoreErrors() { public static AdapterProperties emptyProperties() { return new AdapterProperties(Collections.emptyMap()); } -} \ No newline at end of file +} diff --git a/src/main/java/com/exasol/adapter/RequestDispatcher.java b/src/main/java/com/exasol/adapter/RequestDispatcher.java index 1b24f610..0eb9ff1c 100644 --- a/src/main/java/com/exasol/adapter/RequestDispatcher.java +++ b/src/main/java/com/exasol/adapter/RequestDispatcher.java @@ -19,6 +19,10 @@ public final class RequestDispatcher { private static final Logger LOGGER = Logger.getLogger(RequestDispatcher.class.getName()); + private RequestDispatcher() { + // Not instantiable + } + /** * Main entry point for all Virtual Schema Adapter requests issued by the Exasol database. * @@ -52,7 +56,9 @@ private static String processAdapterCall(final ExaMetadata metadata, final Strin logVersionInformation(); logRawRequest(rawRequest); final AdapterCallExecutor adapterCallExecutor = getAdapterCallExecutor(); - return adapterCallExecutor.executeAdapterCall(adapterRequest, metadata); + final String response = adapterCallExecutor.executeAdapterCall(adapterRequest, metadata); + logRawResponse(response); + return response; } private static void logVersionInformation() { @@ -64,8 +70,12 @@ private static void logRawRequest(final String rawRequest) { LOGGER.finer(() -> "Raw JSON request:\n" + rawRequest); } + private static void logRawResponse(final String response) { + LOGGER.finer(() -> "Raw JSON response: '" + response + "'"); + } + private static AdapterRequest parseRequest(final String rawRequest) { - return new RequestParser().parse(rawRequest); + return RequestParser.create().parse(rawRequest); } private static void configureAdapterLoggingAccordingToRequestSettings(final AdapterRequest request) { @@ -94,4 +104,4 @@ private static AdapterFactory getAdapterFactory() { return adapterFactory.orElseThrow(() -> new NoSuchElementException( ExaError.messageBuilder("E-VSCOMJAVA-29").message("No AdapterFactory was found.").toString())); } -} \ No newline at end of file +} diff --git a/src/main/java/com/exasol/adapter/request/LoggingConfiguration.java b/src/main/java/com/exasol/adapter/request/LoggingConfiguration.java index 86451d34..bf33a30d 100644 --- a/src/main/java/com/exasol/adapter/request/LoggingConfiguration.java +++ b/src/main/java/com/exasol/adapter/request/LoggingConfiguration.java @@ -3,18 +3,24 @@ import static com.exasol.adapter.AdapterProperties.DEBUG_ADDRESS_PROPERTY; import static com.exasol.adapter.AdapterProperties.LOG_LEVEL_PROPERTY; +import java.io.Serializable; import java.util.Map; import java.util.logging.Level; /** * This class represents the logging configuration set in the request properties */ -public final class LoggingConfiguration { +public final class LoggingConfiguration implements Serializable { + private static final long serialVersionUID = 1930189191497837644L; private static final int DEFAULT_REMOTE_LOGGING_PORT = 3000; private static final Level DEFAULT_LOG_LEVEL = Level.INFO; + /** {@code true} if the adapter should send its log messages to a remote log receiver */ private final boolean logRemotely; + /** Name host name where the log receiver listens */ private final String host; + /** Remote logging port */ private final int port; + /** Log level */ private final Level level; private LoggingConfiguration(final Level level, final boolean logRemotely, final String host, final int port) { @@ -27,7 +33,7 @@ private LoggingConfiguration(final Level level, final boolean logRemotely, final /** * Check if the adapter should send its log messages to a remote receiver * - * @return true if the adapter should send its log messages to a remote log receiver + * @return {@code true} if the adapter should send its log messages to a remote log receiver */ public boolean isRemoteLoggingConfigured() { return this.logRemotely; @@ -117,4 +123,4 @@ private static Level parseLogLevel(final Map properties) { public static LoggingConfiguration createLocalLoggingConfiguration(final Map properties) { return new LoggingConfiguration(parseLogLevel(properties), false, null, 0); } -} \ No newline at end of file +} diff --git a/src/main/java/com/exasol/adapter/request/parser/RequestParser.java b/src/main/java/com/exasol/adapter/request/parser/RequestParser.java index 14c77eb4..149fb849 100644 --- a/src/main/java/com/exasol/adapter/request/parser/RequestParser.java +++ b/src/main/java/com/exasol/adapter/request/parser/RequestParser.java @@ -19,6 +19,19 @@ public class RequestParser extends AbstractRequestParser { private static final Logger LOGGER = Logger.getLogger(RequestParser.class.getName()); + private RequestParser() { + // Use static create() method + } + + /** + * Create a {@link RequestParser} + * + * @return request parser instance + */ + public static RequestParser create() { + return new RequestParser(); + } + /** * Parse a JSON string containing a Virtual Schema Adapter request into the abstract representation of that request * @@ -108,13 +121,4 @@ private SchemaMetadataInfo readSchemaMetadataInfo(final JsonObject root) { return new SchemaMetadataInfo("UNKNOWN", "", new HashMap<>()); } } - - /** - * Create a {@link RequestParser} - * - * @return request parser instance - */ - public static RequestParser create() { - return new RequestParser(); - } } diff --git a/src/main/java/com/exasol/logging/RemoteLogManager.java b/src/main/java/com/exasol/logging/RemoteLogManager.java index 5e30a9ba..c9314d70 100644 --- a/src/main/java/com/exasol/logging/RemoteLogManager.java +++ b/src/main/java/com/exasol/logging/RemoteLogManager.java @@ -58,7 +58,8 @@ public void setupRemoteLogger(final String host, final int port, final Level log this.socketHandler = new SocketHandler(host, port); } setupRootLogger(this.socketHandler, logLevel); - LOGGER.info(() -> "Attached to output service with log level " + logLevel + "."); + LOGGER.info( + () -> "Attached to output service at " + host + ":" + port + " with log level " + logLevel + "."); } catch (final IOException exception) { setupRootLoggerForLocalLogging(logLevel); LOGGER.warning(() -> "Unable to attach to remote log listener on " + host + ":" + port @@ -74,4 +75,4 @@ public void close() { this.socketHandler.close(); } } -} \ No newline at end of file +} diff --git a/src/main/java/com/exasol/logging/VersionCollector.java b/src/main/java/com/exasol/logging/VersionCollector.java index 34d2efd0..fae60390 100644 --- a/src/main/java/com/exasol/logging/VersionCollector.java +++ b/src/main/java/com/exasol/logging/VersionCollector.java @@ -7,7 +7,7 @@ import com.exasol.errorreporting.ExaError; /** - * This class fetches the version of the jar from the metadate in the jar file. + * This class fetches the version of the jar from the metadata in the jar file. */ public class VersionCollector { private static final String DEFAULT_PATH = "META-INF/maven/com.exasol/virtual-schema-common-java/pom.properties"; diff --git a/src/test/java/com/exasol/adapter/SerializationTestUtil.java b/src/test/java/com/exasol/adapter/SerializationTestUtil.java new file mode 100644 index 00000000..fdbc4a47 --- /dev/null +++ b/src/test/java/com/exasol/adapter/SerializationTestUtil.java @@ -0,0 +1,34 @@ +package com.exasol.adapter; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.nullValue; + +import java.io.*; + +public class SerializationTestUtil { + + public static T serializeDeserialize(final T object, final Class clazz) + throws IOException, ClassNotFoundException { + final byte[] serialized = serialize(object); + final T deserialized = deserialize(serialized, clazz); + assertThat(deserialized, not(nullValue())); + return deserialized; + } + + private static byte[] serialize(final T object) throws IOException { + final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + final ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream); + objectOutputStream.writeObject(object); + objectOutputStream.close(); + return outputStream.toByteArray(); + } + + private static T deserialize(final byte[] serializedObject, final Class clazz) + throws IOException, ClassNotFoundException { + final ByteArrayInputStream inputStream = new ByteArrayInputStream(serializedObject); + final ObjectInputStream objectInputStream = new ObjectInputStream(inputStream); + final Object result = objectInputStream.readObject(); + return clazz.cast(result); + } +} diff --git a/src/test/java/com/exasol/adapter/metadata/DataTypeTest.java b/src/test/java/com/exasol/adapter/metadata/DataTypeTest.java index 548aab26..421a66ce 100644 --- a/src/test/java/com/exasol/adapter/metadata/DataTypeTest.java +++ b/src/test/java/com/exasol/adapter/metadata/DataTypeTest.java @@ -127,7 +127,7 @@ void testIsSupportedDate() { } @Test - void testIsSupportedForUnsupporteTypeFalse() { + void testIsSupportedForUnsupportedTypeFalse() { assertThat(DataType.createUnsupported().isSupported(), equalTo(false)); } -} \ No newline at end of file +} diff --git a/src/test/java/com/exasol/adapter/request/LoggingConfigurationTest.java b/src/test/java/com/exasol/adapter/request/LoggingConfigurationTest.java index 00721f36..b4165f3e 100644 --- a/src/test/java/com/exasol/adapter/request/LoggingConfigurationTest.java +++ b/src/test/java/com/exasol/adapter/request/LoggingConfigurationTest.java @@ -2,15 +2,19 @@ import static com.exasol.adapter.AdapterProperties.DEBUG_ADDRESS_PROPERTY; import static com.exasol.adapter.AdapterProperties.LOG_LEVEL_PROPERTY; -import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.equalTo; import static org.junit.jupiter.api.Assertions.assertAll; +import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.logging.Level; import org.junit.jupiter.api.Test; +import org.opentest4j.MultipleFailuresError; + +import com.exasol.adapter.SerializationTestUtil; class LoggingConfigurationTest { final Map properties = new HashMap<>(); @@ -64,4 +68,26 @@ void testFallBackToLocalLoggingInCaseOfIllegalLoggingPort() { final LoggingConfiguration configuration = createLoggingConfiguration(this.properties); assertThat(configuration.isRemoteLoggingConfigured(), equalTo(false)); } -} \ No newline at end of file + + @Test + void testSerializableDefaultConfig() throws ClassNotFoundException, IOException { + assertSerializable(createLoggingConfiguration(this.properties)); + } + + @Test + void testSerializableRemoveConfig() throws ClassNotFoundException, IOException { + this.properties.put(LOG_LEVEL_PROPERTY, "FINEST"); + this.properties.put(DEBUG_ADDRESS_PROPERTY, "www.example.org:4000"); + assertSerializable(createLoggingConfiguration(this.properties)); + } + + private void assertSerializable(final LoggingConfiguration config) + throws IOException, ClassNotFoundException, MultipleFailuresError { + final LoggingConfiguration deserialized = SerializationTestUtil.serializeDeserialize(config, + LoggingConfiguration.class); + assertAll(() -> assertThat(deserialized.getLogLevel(), equalTo(config.getLogLevel())), + () -> assertThat(deserialized.isRemoteLoggingConfigured(), equalTo(config.isRemoteLoggingConfigured())), + () -> assertThat(deserialized.getRemoteLoggingHost(), equalTo(config.getRemoteLoggingHost())), + () -> assertThat(deserialized.getRemoteLoggingPort(), equalTo(config.getRemoteLoggingPort()))); + } +} diff --git a/src/test/java/com/exasol/logging/RemoteLogManagerTest.java b/src/test/java/com/exasol/logging/RemoteLogManagerTest.java index 7e5899a8..a95d2d83 100644 --- a/src/test/java/com/exasol/logging/RemoteLogManagerTest.java +++ b/src/test/java/com/exasol/logging/RemoteLogManagerTest.java @@ -80,8 +80,8 @@ void testRemoteSocketLogging() throws UnknownHostException, IOException { received = readLogMessageFromSocket(client); } } - assertThat(received, - matchesPattern(TIMESTAMP_PATTERN + " INFO +\\[.*?\\] Attached to output service with log level ALL.")); + assertThat(received, matchesPattern(TIMESTAMP_PATTERN + + " INFO +\\[.*?\\] Attached to output service at localhost:\\d+ with log level ALL.")); } private Thread attachToLogServiceInParallelThread(final String loopBackAddress, final int port) { @@ -124,4 +124,4 @@ void testFallBackFromRemoteLoggingToConsoleLogging(final Capturable stream) { this.logManager.setupRemoteLogger("this.hostname.should.not.exist.exasol.com", 3000, Level.ALL); assertThat(stream.getCapturedData(), matchesPattern(".*Falling back to console log." + System.lineSeparator())); } -} \ No newline at end of file +}