From 03dd57153ee758d4354a4fad9663e974dfb14e24 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Mon, 17 Jun 2024 02:25:02 +0000 Subject: [PATCH 01/52] Update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.6.0 --- template-placeholder/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index fb307dd..5030ab1 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -95,7 +95,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.5.0 + 3.6.0 From 7313ce9b3960ac6cbca4f6b5e16d211463164bf8 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Tue, 18 Jun 2024 02:23:41 +0000 Subject: [PATCH 02/52] Update dependency maven to v3.9.8 --- .mvn/wrapper/maven-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index f800e78..e56bc18 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -14,4 +14,4 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip From 8d8efe97779262c2234978f7fb4128c565aeb35a Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Tue, 18 Jun 2024 14:36:18 +0000 Subject: [PATCH 03/52] Update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.3.0 --- chartjs-java-model/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chartjs-java-model/pom.xml b/chartjs-java-model/pom.xml index c0f4a66..dcdcb01 100644 --- a/chartjs-java-model/pom.xml +++ b/chartjs-java-model/pom.xml @@ -274,7 +274,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.5 + 3.3.0 ${skipTests} From 3e41f58521ab545319736284844e1784e678e4a4 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 18 Jun 2024 16:46:50 +0200 Subject: [PATCH 04/52] Add default PMD ruleset Co-Authored-By: ds-xdev <85935842+ds-xdev@users.noreply.github.com> --- .config/pmd/ruleset.xml | 149 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 .config/pmd/ruleset.xml diff --git a/.config/pmd/ruleset.xml b/.config/pmd/ruleset.xml new file mode 100644 index 0000000..02f64d7 --- /dev/null +++ b/.config/pmd/ruleset.xml @@ -0,0 +1,149 @@ + + + + + This ruleset checks the code for discouraged programming constructs. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 43ddc48eac02aeaea23d332fd4c88bebf9e0c4f8 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 18 Jun 2024 16:56:51 +0200 Subject: [PATCH 05/52] Attach demo to parent --- template-placeholder-demo/pom.xml | 39 +++++-------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/template-placeholder-demo/pom.xml b/template-placeholder-demo/pom.xml index 326f855..1af633c 100644 --- a/template-placeholder-demo/pom.xml +++ b/template-placeholder-demo/pom.xml @@ -4,7 +4,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - software.xdev + + software.xdev + template-placeholder-root + 1.0.0-SNAPSHOT + + template-placeholder-demo 1.0.0-SNAPSHOT jar @@ -77,36 +82,4 @@ - - - checkstyle - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.4.0 - - - com.puppycrawl.tools - checkstyle - 10.17.0 - - - - ../.config/checkstyle/checkstyle.xml - true - - - - - check - - - - - - - - From 3bc085a454ffefea389f3d3519e13445d97b60ef Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 18 Jun 2024 16:57:26 +0200 Subject: [PATCH 06/52] Reconfigure root and add pmd --- pom.xml | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8fc5ca9..3a04c7a 100644 --- a/pom.xml +++ b/pom.xml @@ -19,6 +19,11 @@ template-placeholder-demo + + UTF-8 + UTF-8 + + Apache License, Version 2.0 @@ -29,7 +34,6 @@ - checkstyle @@ -37,12 +41,67 @@ org.apache.maven.plugins maven-checkstyle-plugin 3.4.0 + + + com.puppycrawl.tools + checkstyle + 10.17.0 + + + + .config/checkstyle/checkstyle.xml + true + + + + + check + + + + + + + + + pmd + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.23.0 - true + true + + .config/pmd/ruleset.xml + + + + net.sourceforge.pmd + pmd-core + 7.2.0 + + + net.sourceforge.pmd + pmd-java + 7.2.0 + + + + + + + org.apache.maven.plugins + maven-jxr-plugin + 3.4.0 + + + From f5240c0ba9f96827abdd6c76d072883bda47edec Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 18 Jun 2024 16:57:44 +0200 Subject: [PATCH 07/52] Add pmd to published module --- template-placeholder/pom.xml | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 5030ab1..05a241f 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -265,5 +265,45 @@ + + pmd + + + + org.apache.maven.plugins + maven-pmd-plugin + 3.23.0 + + true + + ../.config/pmd/ruleset.xml + + + + + net.sourceforge.pmd + pmd-core + 7.2.0 + + + net.sourceforge.pmd + pmd-java + 7.2.0 + + + + + + + + + + org.apache.maven.plugins + maven-jxr-plugin + 3.4.0 + + + + From 11c6f7e9bd7a831a0929da58d4143406f95eeede Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 18 Jun 2024 16:59:00 +0200 Subject: [PATCH 08/52] Add pmd to check-build workflow --- .github/workflows/check-build.yml | 39 ++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index fa9b7f5..2ac6530 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -70,7 +70,7 @@ jobs: path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar if-no-files-found: error - code-style: + checkstyle: runs-on: ubuntu-latest if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} @@ -91,3 +91,40 @@ jobs: - name: Run Checkstyle run: ./mvnw -B checkstyle:check -P checkstyle -T2C + + pmd: + runs-on: ubuntu-latest + if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }} + + strategy: + matrix: + java: [17] + distribution: [temurin] + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.java }} + cache: 'maven' + + - name: Run PMD + run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C + + - name: Run CPD (Copy Paste Detector) + run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C + + - name: Upload report + if: always() + uses: actions/upload-artifact@v4 + with: + name: pmd-report + if-no-files-found: ignore + path: | + target/site/*.html + target/site/css/** + target/site/images/logos/maven-feather.png + target/site/images/external.png From d979ab94bb0a290219aef5cfbd97625843b93a8d Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 19 Jun 2024 08:41:49 +0200 Subject: [PATCH 09/52] PMD: printFailingErrors --- pom.xml | 1 + template-placeholder/pom.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index 3a04c7a..e41a6a2 100644 --- a/pom.xml +++ b/pom.xml @@ -73,6 +73,7 @@ 3.23.0 true + true .config/pmd/ruleset.xml diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index 05a241f..b743ae7 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -275,6 +275,7 @@ 3.23.0 true + true ../.config/pmd/ruleset.xml From b2d3269a91c150834535017306271ac37be33547 Mon Sep 17 00:00:00 2001 From: AB Date: Tue, 18 Jun 2024 16:32:09 +0200 Subject: [PATCH 10/52] Apply pmd improvements --- .../chartjs/model/EnumNameToCamelCase.java | 4 +- .../xdev/chartjs/model/charts/BarChart.java | 11 ---- .../model/charts/HomogeneousChart.java | 11 ++++ .../xdev/chartjs/model/charts/LineChart.java | 10 ---- .../chartjs/model/charts/ScatterChart.java | 11 ---- .../xdev/chartjs/model/BarChartTest.java | 52 +++++++------------ 6 files changed, 33 insertions(+), 66 deletions(-) diff --git a/chartjs-java-model/src/main/java/software/xdev/chartjs/model/EnumNameToCamelCase.java b/chartjs-java-model/src/main/java/software/xdev/chartjs/model/EnumNameToCamelCase.java index 0991edf..67d60f2 100644 --- a/chartjs-java-model/src/main/java/software/xdev/chartjs/model/EnumNameToCamelCase.java +++ b/chartjs-java-model/src/main/java/software/xdev/chartjs/model/EnumNameToCamelCase.java @@ -35,8 +35,8 @@ public static String getName(final Enum e) } else { - sb.append(s.substring(0, 1).toUpperCase(Locale.ENGLISH)); - sb.append(s.substring(1).toLowerCase(Locale.ENGLISH)); + sb.append(s.substring(0, 1).toUpperCase(Locale.ENGLISH)) + .append(s.substring(1).toLowerCase(Locale.ENGLISH)); } } return sb.toString(); diff --git a/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/BarChart.java b/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/BarChart.java index 8f4beba..4d0fb34 100644 --- a/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/BarChart.java +++ b/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/BarChart.java @@ -106,15 +106,4 @@ public boolean isDrawable() } return sufficientData; } - - private boolean hasScaleWithId(final String id) - { - if(this.getOptions() != null - && this.getOptions().getScales() != null - && this.getOptions().getScales().getScalesList() != null) - { - return this.getOptions().getScales().getScalesList().get(id) != null; - } - return false; - } } diff --git a/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/HomogeneousChart.java b/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/HomogeneousChart.java index 5317c46..dba44cb 100644 --- a/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/HomogeneousChart.java +++ b/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/HomogeneousChart.java @@ -35,4 +35,15 @@ protected HomogeneousChart(final D data, final O options) { super(data, options); } + + protected boolean hasScaleWithId(final String id) + { + if(this.getOptions() != null + && this.getOptions().getScales() != null + && this.getOptions().getScales().getScalesList() != null) + { + return this.getOptions().getScales().getScalesList().get(id) != null; + } + return false; + } } diff --git a/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/LineChart.java b/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/LineChart.java index f12786a..ba7f7d1 100644 --- a/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/LineChart.java +++ b/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/LineChart.java @@ -95,14 +95,4 @@ public boolean isDrawable() } return sufficientData; } - - private boolean hasScaleWithId(final String id) - { - if(this.getOptions() != null && this.getOptions().getScales() != null - && this.getOptions().getScales().getScalesList() != null) - { - return this.getOptions().getScales().getScalesList().get(id) != null; - } - return false; - } } diff --git a/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/ScatterChart.java b/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/ScatterChart.java index 141b956..561f527 100644 --- a/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/ScatterChart.java +++ b/chartjs-java-model/src/main/java/software/xdev/chartjs/model/charts/ScatterChart.java @@ -96,15 +96,4 @@ public boolean isDrawable() } return sufficientData; } - - private boolean hasScaleWithId(final String id) - { - if(this.getOptions() != null - && this.getOptions().getScales() != null - && this.getOptions().getScales().getScalesList() != null) - { - return this.getOptions().getScales().getScalesList().get(id) != null; - } - return false; - } } diff --git a/chartjs-java-model/src/test/java/software/xdev/chartjs/model/BarChartTest.java b/chartjs-java-model/src/test/java/software/xdev/chartjs/model/BarChartTest.java index 8907d00..ff9a9d8 100644 --- a/chartjs-java-model/src/test/java/software/xdev/chartjs/model/BarChartTest.java +++ b/chartjs-java-model/src/test/java/software/xdev/chartjs/model/BarChartTest.java @@ -89,21 +89,6 @@ void testScale(final BiConsumer addDataFunc) @Test void testStacked() { - final BarDataset dataset1 = new BarDataset() - .setLabel("First stack") - .setData(65, 59, 80) - .addBackgroundColors(Color.RED, Color.RED, Color.RED); - - final BarDataset dataset2 = new BarDataset() - .setLabel("Second stack") - .setData(28, 45, 10) - .addBackgroundColors(Color.GREEN, Color.GREEN, Color.GREEN); - - final BarData data = new BarData() - .addLabels("First", "Second", "Third") - .addDataset(dataset1) - .addDataset(dataset2); - final BarOptions options = new BarOptions() .setAnimation(false); options @@ -112,7 +97,7 @@ void testStacked() .addScale(Scales.ScaleAxis.Y, new CartesianScaleOptions().setStacked(true)); this.createScreenshotAndCompare( - new BarChart(data, options), + new BarChart(createDefaultTwoDatasetBarData(), options), this.getWebContainer(), "Stacked" ); @@ -147,21 +132,6 @@ void testTicked() @Test void testStackedHorizontal() { - final BarDataset dataset1 = new BarDataset() - .setLabel("First stack") - .setData(65, 59, 80) - .addBackgroundColors(Color.RED, Color.RED, Color.RED); - - final BarDataset dataset2 = new BarDataset() - .setLabel("Second stack") - .setData(28, 45, 10) - .addBackgroundColors(Color.GREEN, Color.GREEN, Color.GREEN); - - final BarData data = new BarData() - .addLabels("First", "Second", "Third") - .addDataset(dataset1) - .addDataset(dataset2); - final BarOptions options = new BarOptions() .setAnimation(false) .setIndexAxis(BarOptions.IndexAxis.Y); @@ -171,7 +141,7 @@ void testStackedHorizontal() .addScale(Scales.ScaleAxis.Y, new CartesianScaleOptions().setStacked(true)); this.createScreenshotAndCompare( - new BarChart(data, options), + new BarChart(createDefaultTwoDatasetBarData(), options), this.getWebContainer(), "StackedHorizontal" ); @@ -219,4 +189,22 @@ void testStackedWithGroups() "StackedWithGroups" ); } + + static BarData createDefaultTwoDatasetBarData() + { + final BarDataset dataset1 = new BarDataset() + .setLabel("First stack") + .setData(65, 59, 80) + .addBackgroundColors(Color.RED, Color.RED, Color.RED); + + final BarDataset dataset2 = new BarDataset() + .setLabel("Second stack") + .setData(28, 45, 10) + .addBackgroundColors(Color.GREEN, Color.GREEN, Color.GREEN); + + return new BarData() + .addLabels("First", "Second", "Third") + .addDataset(dataset1) + .addDataset(dataset2); + } } From eed3d8aa02516e03553f39e83875b3776ce87240 Mon Sep 17 00:00:00 2001 From: AB Date: Wed, 19 Jun 2024 13:02:11 +0200 Subject: [PATCH 11/52] Update ruleset.xml --- .config/pmd/ruleset.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/pmd/ruleset.xml b/.config/pmd/ruleset.xml index 02f64d7..5f88156 100644 --- a/.config/pmd/ruleset.xml +++ b/.config/pmd/ruleset.xml @@ -135,6 +135,9 @@ + + + From 6a258c70a5b6a423ca90196e79f0b37a2a2302b3 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Thu, 20 Jun 2024 09:02:41 +0200 Subject: [PATCH 12/52] Remove duplicate in .gitignore --- .gitignore | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitignore b/.gitignore index d0e81bf..116a656 100644 --- a/.gitignore +++ b/.gitignore @@ -39,11 +39,6 @@ buildNumber.properties # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* - -# bin / compiled stuff -target/ - - # JRebel **/resources/rebel.xml **/resources/rebel-remote.xml From 71414f473d50abbbfc16137c4d609b1335be4f2d Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Fri, 21 Jun 2024 02:20:43 +0000 Subject: [PATCH 13/52] Update dependency org.seleniumhq.selenium:selenium-chrome-driver to v4.22.0 --- chartjs-java-model/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chartjs-java-model/pom.xml b/chartjs-java-model/pom.xml index ce0d8da..1f6dd9a 100644 --- a/chartjs-java-model/pom.xml +++ b/chartjs-java-model/pom.xml @@ -170,7 +170,7 @@ org.seleniumhq.selenium selenium-chrome-driver - 4.21.0 + 4.22.0 test From f2290e689466bac63811f4ca96b6069ec1f9c8ee Mon Sep 17 00:00:00 2001 From: AB Date: Mon, 24 Jun 2024 08:34:54 +0200 Subject: [PATCH 14/52] Ignore project internal depenedencies --- renovate.json5 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index 11a77b2..11024f4 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -1,4 +1,14 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "rebaseWhen": "behind-base-branch" + "rebaseWhen": "behind-base-branch", + "packageRules": [ + { + "description": "Ignore project internal dependencies", + "packagePattern": "^software.xdev:template-placeholder", + "datasources": [ + "maven" + ], + "enabled": false + } + ] } From e3213ea66088bc90f0e8dad1b25622b5726e8d16 Mon Sep 17 00:00:00 2001 From: XDEV Bot <111048771+xdev-gh-bot@users.noreply.github.com> Date: Mon, 24 Jun 2024 06:35:22 +0000 Subject: [PATCH 15/52] Fill in template --- renovate.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json5 b/renovate.json5 index 11024f4..24691d4 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -4,7 +4,7 @@ "packageRules": [ { "description": "Ignore project internal dependencies", - "packagePattern": "^software.xdev:template-placeholder", + "packagePattern": "^software.xdev:chartjs-java-model", "datasources": [ "maven" ], From 1cec0e0809e89e1bb27048655dcbcea3774da293 Mon Sep 17 00:00:00 2001 From: XDEV Renovate Bot Date: Thu, 27 Jun 2024 02:23:10 +0000 Subject: [PATCH 16/52] Update dependency org.apache.maven.plugins:maven-project-info-reports-plugin to v3.6.1 --- template-placeholder/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index b743ae7..a81bb5e 100644 --- a/template-placeholder/pom.xml +++ b/template-placeholder/pom.xml @@ -95,7 +95,7 @@ org.apache.maven.plugins maven-project-info-reports-plugin - 3.6.0 + 3.6.1 From e26126ffc437aa36f6483cbb7bee96bb576cbf52 Mon Sep 17 00:00:00 2001 From: Alex B <45384811+AB-xdev@users.noreply.github.com> Date: Thu, 27 Jun 2024 10:27:39 +0200 Subject: [PATCH 17/52] [Save Actions] Allow batch activation --- .idea/saveactions_settings.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.idea/saveactions_settings.xml b/.idea/saveactions_settings.xml index 71a42c4..cd28798 100644 --- a/.idea/saveactions_settings.xml +++ b/.idea/saveactions_settings.xml @@ -4,6 +4,7 @@