From c71b3f5f3ad95d2c6a9b8853f414e9ee1d3ac703 Mon Sep 17 00:00:00 2001
From: Andreas Dangel
Date: Mon, 3 Apr 2023 20:15:13 +0200
Subject: [PATCH 09/23] [doc] Update release notes (#4450, #4449)
---
docs/pages/release_notes.md | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md
index 14d4904e35..e3fb66813f 100644
--- a/docs/pages/release_notes.md
+++ b/docs/pages/release_notes.md
@@ -39,6 +39,10 @@ for all.
This section lists the most important changes from the last release candidate.
The remaining section describe the complete release notes for 7.0.0.
+Fixed issues:
+* java-errorprone
+ * [#4449](https://github.com/pmd/pmd/issues/4449): \[java] AvoidAccessibilityAlteration: Possible false positive in AvoidAccessibilityAlteration rule when using Lambda expression
+
### ๐ Major Features and Enhancements
#### New official logo
@@ -359,6 +363,7 @@ Language specific fixes:
* [#3351](https://github.com/pmd/pmd/issues/3351): \[java] ConstructorCallsOverridableMethod ignores abstract methods
* [#3400](https://github.com/pmd/pmd/issues/3400): \[java] AvoidUsingOctalValues FN with underscores
* [#4356](https://github.com/pmd/pmd/pull/4356): \[java] Fix NPE in CloseResourceRule
+ * [#4449](https://github.com/pmd/pmd/issues/4449): \[java] AvoidAccessibilityAlteration: Possible false positive in AvoidAccessibilityAlteration rule when using Lambda expression
* java-multithreading
* [#2537](https://github.com/pmd/pmd/issues/2537): \[java] DontCallThreadRun can't detect the case that call run() in `this.run()`
* [#2538](https://github.com/pmd/pmd/issues/2538): \[java] DontCallThreadRun can't detect the case that call run() in `foo.bar.run()`
@@ -389,6 +394,7 @@ Language specific fixes:
* [#3866](https://github.com/pmd/pmd/pull/3866): \[core] Add CLI Progress Bar - [@JerritEic](https://github.com/JerritEic) (@JerritEic)
* [#4412](https://github.com/pmd/pmd/pull/4412): \[doc] Added new error msg to ConstantsInInterface - [David Ljunggren](https://github.com/dague1) (@dague1)
* [#4428](https://github.com/pmd/pmd/pull/4428): \[apex] ApexBadCrypto bug fix for #4427 - inline detection of hard coded values - [Steven Stearns](https://github.com/sfdcsteve) (@sfdcsteve)
+* [#4450](https://github.com/pmd/pmd/pull/4450): \[java] Fix #4449 AvoidAccessibilityAlteration: Correctly handle Lambda expressions in PrivilegedAction scenarios - [Seren](https://github.com/mohui1999) (@mohui1999)
### ๐ Stats
* 4416 commits
From 702318a41df6b9c647093f8430d95ec9b2dcdb8c Mon Sep 17 00:00:00 2001
From: nwcm <111259588+nwcm@users.noreply.github.com>
Date: Tue, 4 Apr 2023 23:07:08 +1000
Subject: [PATCH 10/23] Update design.xml
---
pmd-apex/src/main/resources/category/apex/design.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pmd-apex/src/main/resources/category/apex/design.xml b/pmd-apex/src/main/resources/category/apex/design.xml
index 6f34471e41..f00fbe652e 100644
--- a/pmd-apex/src/main/resources/category/apex/design.xml
+++ b/pmd-apex/src/main/resources/category/apex/design.xml
@@ -48,13 +48,13 @@ Avoid having unused methods since they make understanding and maintaining code h
This rule finds not only unused private methods, but public methods as well.
[ApexLink](https://github.com/nawforce/ApexLink) is used to make this possible and this needs
-additional configuration. The environment variable `PMD_APEX_ROOTDIRECTORY` needs to be set prior to executing
+additional configuration. The environment variable `PMD_APEX_ROOT_DIRECTORY` needs to be set prior to executing
PMD. With this variable the root directory of the Salesforce metadata, where `sfdx-project.json` resides, is
specified. ApexLink can then load all the classes in the project and figure out, whether a method is used or not.
-For an accurate analysis it is important that the `PMD_APEX_ROOTDIRECTORY` contains a complete set of metadata that
+For an accurate analysis it is important that the `PMD_APEX_ROOT_DIRECTORY` contains a complete set of metadata that
may be referenced from the Apex source code, such as Custom Objects, Visualforce Pages, Flows and Labels. The
-`PMD_APEX_ROOTDIRECTORY` directory must contain a `sfdx-project.json`, but metadata may be either in the
+`PMD_APEX_ROOT_DIRECTORY` directory must contain a `sfdx-project.json`, but metadata may be either in the
[SFDX Source format](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_source_file_format.htm)
or the older MDAPI format. The `packageDirectories` entries in `sfdx-project.json` are used to determine which
directories to search for metadata, if a `.forceignore` file is present it will be respected.
From 7a89f550d97c786e61f842f87e84aa5489a1e79a Mon Sep 17 00:00:00 2001
From: Andreas Dangel
Date: Tue, 4 Apr 2023 18:30:00 +0200
Subject: [PATCH 11/23] [java] Fix rule doc for SingularField
Closes pmd/pmd.github.io#14
Co-authored-by: Zustin <87302257+Zustin@users.noreply.github.com>
---
pmd-java/src/main/resources/category/java/design.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pmd-java/src/main/resources/category/java/design.xml b/pmd-java/src/main/resources/category/java/design.xml
index ead5ceb07c..e69ded8f7e 100644
--- a/pmd-java/src/main/resources/category/java/design.xml
+++ b/pmd-java/src/main/resources/category/java/design.xml
@@ -1349,12 +1349,12 @@ Limitations: We can only check private fields for now.
public class Foo {
private int x; // this will be reported
- public void foo(int y) {
+ public int foo(int y) {
x = y + 5; // assigned before any read
return x;
}
- public void fooOk(int y) {
+ public int fooOk(int y) {
int z = y + 5; // might as well be a local like here
return z;
}
From 1c2d77fd6a4e760bc8ad29cde77c6bb71a75a0bc Mon Sep 17 00:00:00 2001
From: Andreas Dangel
Date: Thu, 6 Apr 2023 10:17:04 +0200
Subject: [PATCH 12/23] Introduce a pmd-languages-deps module
This is kind of a [BOM](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#bill-of-materials-bom-poms), but different: It defines hard dependencies and not just versions for dependencyManagement.
This new module depends on all languages modules and is used by pmd-cli and by pmd-dist. So, we have only one place to modify, when we add new language modules.
---
pmd-cli/pom.xml | 165 +-----------------
pmd-dist/pom.xml | 142 +--------------
.../src/main/resources/assemblies/pmd-bin.xml | 2 +
pmd-languages-deps/pom.xml | 158 +++++++++++++++++
pom.xml | 1 +
5 files changed, 171 insertions(+), 297 deletions(-)
create mode 100644 pmd-languages-deps/pom.xml
diff --git a/pmd-cli/pom.xml b/pmd-cli/pom.xml
index 5d65824a77..a144afdd06 100644
--- a/pmd-cli/pom.xml
+++ b/pmd-cli/pom.xml
@@ -78,168 +78,15 @@
${project.version}
-
-
+
net.sourceforge.pmd
- pmd-apex
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-cpp
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-cs
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-dart
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-fortran
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-gherkin
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-go
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-groovy
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-html
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-lua
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-java
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-javascript
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-jsp
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-kotlin
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-matlab
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-modelica
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-perl
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-objectivec
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-php
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-plsql
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-python
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-ruby
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-scala_2.13
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-swift
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-visualforce
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-vm
- ${project.version}
- runtime
-
-
- net.sourceforge.pmd
- pmd-xml
+ pmd-languages-deps${project.version}
+ pomruntime
diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml
index 554b2cb809..43bc6c06d8 100644
--- a/pmd-dist/pom.xml
+++ b/pmd-dist/pom.xml
@@ -126,7 +126,7 @@
net.sourceforge.pmd
- pmd-apex
+ pmd-core${project.version}
@@ -142,136 +142,11 @@
shcompletion
-
- net.sourceforge.pmd
- pmd-core
- ${project.version}
- net.sourceforge.pmdpmd-ant${project.version}
-
- net.sourceforge.pmd
- pmd-cpp
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-cs
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-dart
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-fortran
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-gherkin
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-go
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-groovy
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-html
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-lua
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-java
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-javascript
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-jsp
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-kotlin
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-matlab
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-modelica
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-perl
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-objectivec
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-php
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-plsql
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-python
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-ruby
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-scala_2.13
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-swift
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-tsql
- ${project.version}
- net.sourceforge.pmdpmd-ui
@@ -279,20 +154,11 @@
net.sourceforge.pmd
- pmd-visualforce
+ pmd-languages-deps${project.version}
+ pom
+ runtime
-
- net.sourceforge.pmd
- pmd-vm
- ${project.version}
-
-
- net.sourceforge.pmd
- pmd-xml
- ${project.version}
-
-
org.slf4j
diff --git a/pmd-dist/src/main/resources/assemblies/pmd-bin.xml b/pmd-dist/src/main/resources/assemblies/pmd-bin.xml
index 2215aa3265..aa5a06faab 100644
--- a/pmd-dist/src/main/resources/assemblies/pmd-bin.xml
+++ b/pmd-dist/src/main/resources/assemblies/pmd-bin.xml
@@ -71,7 +71,9 @@
runtime
+ net.sourceforge.pmd:pmd-apex-jorje:pomnet.sourceforge.pmd:pmd-cli:sh:completion:*
+ net.sourceforge.pmd:pmd-languages-deps:pomlib0755
diff --git a/pmd-languages-deps/pom.xml b/pmd-languages-deps/pom.xml
new file mode 100644
index 0000000000..580aa5f130
--- /dev/null
+++ b/pmd-languages-deps/pom.xml
@@ -0,0 +1,158 @@
+
+
+ 4.0.0
+
+ net.sourceforge.pmd
+ pmd
+ 7.0.0-SNAPSHOT
+
+
+ pmd-languages-deps
+ pom
+ PMD Languages Dependencies
+
+
+
+ net.sourceforge.pmd
+ pmd-apex
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-cpp
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-cs
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-dart
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-fortran
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-gherkin
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-go
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-groovy
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-html
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-java
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-javascript
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-jsp
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-kotlin
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-lua
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-matlab
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-modelica
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-objectivec
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-perl
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-php
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-plsql
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-python
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-ruby
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-scala_2.13
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-swift
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-tsql
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-visualforce
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-vm
+ ${project.version}
+
+
+ net.sourceforge.pmd
+ pmd-xml
+ ${project.version}
+
+
+
diff --git a/pom.xml b/pom.xml
index a2b90df0c5..b637405c38 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1185,5 +1185,6 @@
pmd-vmpmd-xmlpmd-ant
+ pmd-languages-deps
From 3d6e15b523205aa64ee0373adaa4741cad1b4823 Mon Sep 17 00:00:00 2001
From: Andreas Dangel
Date: Thu, 6 Apr 2023 11:57:37 +0200
Subject: [PATCH 13/23] Disable maven-pmd-plugin option linkXRef
We don't have the jxr plugin and also don't create reports. Disabling this option avoids the many warnings like `[WARNING] Unable to locate Source XRef to link to - DISABLED`.
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index a2b90df0c5..45490d2351 100644
--- a/pom.xml
+++ b/pom.xml
@@ -436,7 +436,7 @@
- true
+ false1001.${java.version}
From ae0bf240d76130bbae58e72a960aadf5b440e4d6 Mon Sep 17 00:00:00 2001
From: Andreas Dangel
Date: Thu, 6 Apr 2023 12:49:37 +0200
Subject: [PATCH 14/23] Provide Software Bill of Materials (SBOM)
- Add cyclonedx plugin to generate SBOM (Software Bill of Materials)
- The SBOM is attached and deployed into maven central
- The SBOM is also included in the binary distribution of PMD
See https://github.com/CycloneDX/cyclonedx-maven-plugin
---
docs/pages/release_notes.md | 3 +++
.../src/main/resources/assemblies/pmd-bin.xml | 13 ++++++++++
.../pmd/it/BinaryDistributionIT.java | 2 ++
pom.xml | 25 +++++++++++++++++++
4 files changed, 43 insertions(+)
diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md
index b875222f4d..a6a58421b7 100644
--- a/docs/pages/release_notes.md
+++ b/docs/pages/release_notes.md
@@ -40,6 +40,8 @@ This section lists the most important changes from the last release candidate.
The remaining section describe the complete release notes for 7.0.0.
Fixed Issues:
+* miscellaneous
+ * [#4462](https://github.com/pmd/pmd/issues/4462): Provide Software Bill of Materials (SBOM)
* java-codestyle
* [#4273](https://github.com/pmd/pmd/issues/4273): \[java] CommentDefaultAccessModifier ignoredAnnotations should include "org.junit.jupiter.api.extension.RegisterExtension" by default
* java-errorprone
@@ -208,6 +210,7 @@ See [Detailed Release Notes for PMD 7](pmd_release_notes_pmd7.html).
* [#2497](https://github.com/pmd/pmd/issues/2497): PMD 7 Logo page
* [#2498](https://github.com/pmd/pmd/issues/2498): Update PMD 7 Logo in documentation
* [#3797](https://github.com/pmd/pmd/issues/3797): \[all] Use JUnit5
+ * [#4462](https://github.com/pmd/pmd/issues/4462): Provide Software Bill of Materials (SBOM)
* ant
* [#4080](https://github.com/pmd/pmd/issues/4080): \[ant] Split off Ant integration into a new submodule
* core
diff --git a/pmd-dist/src/main/resources/assemblies/pmd-bin.xml b/pmd-dist/src/main/resources/assemblies/pmd-bin.xml
index 2215aa3265..738017141b 100644
--- a/pmd-dist/src/main/resources/assemblies/pmd-bin.xml
+++ b/pmd-dist/src/main/resources/assemblies/pmd-bin.xml
@@ -53,6 +53,19 @@
+
+
+ target/bom.xml
+ sbom
+ pmd-${project.version}-cyclonedx.xml
+
+
+ target/bom.json
+ sbom
+ pmd-${project.version}-cyclonedx.json
+
+
+
diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java
index c1331cbd67..569c17e5cd 100644
--- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java
+++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/BinaryDistributionIT.java
@@ -87,6 +87,8 @@ class BinaryDistributionIT extends AbstractBinaryDistributionTest {
result.add(basedir + "shell/pmd-completion.sh");
result.add(basedir + "lib/pmd-core-" + PMDVersion.VERSION + ".jar");
result.add(basedir + "lib/pmd-java-" + PMDVersion.VERSION + ".jar");
+ result.add(basedir + "sbom/pmd-" + PMDVersion.VERSION + "-cyclonedx.xml");
+ result.add(basedir + "sbom/pmd-" + PMDVersion.VERSION + "-cyclonedx.json");
return result;
}
diff --git a/pom.xml b/pom.xml
index a2b90df0c5..353eb10d90 100644
--- a/pom.xml
+++ b/pom.xml
@@ -503,6 +503,11 @@
jacoco-maven-plugin0.8.8
+
+ org.cyclonedx
+ cyclonedx-maven-plugin
+ 2.7.6
+
@@ -624,6 +629,26 @@
https://oss.sonatype.org/
+
+ org.cyclonedx
+ cyclonedx-maven-plugin
+
+
+ package
+
+ makeAggregateBom
+
+
+
+
+
+
+ org.ow2.asm
+ asm
+ 9.5
+
+
+
From a4893b964b45eae012ea0ddbfdb7dbb2cbdf7ff6 Mon Sep 17 00:00:00 2001
From: Andreas Dangel
Date: Mon, 10 Apr 2023 09:54:02 +0200
Subject: [PATCH 15/23] Upload sbom as release artifact
Uploads xml/json to sourceforge
and to Githu releases
---
.ci/build.sh | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/.ci/build.sh b/.ci/build.sh
index 5f4d321698..2479f35e82 100755
--- a/.ci/build.sh
+++ b/.ci/build.sh
@@ -179,6 +179,11 @@ function pmd_ci_deploy_build_artifacts() {
# Deploy to sourceforge files https://sourceforge.net/projects/pmd/files/pmd/
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-bin-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-src-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
+ # Deploy SBOM
+ cp pmd-dist/target/bom.xml "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml"
+ cp pmd-dist/target/bom.json "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json"
+ pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml"
+ pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json"
if pmd_ci_maven_isReleaseBuild; then
# create a draft github release
@@ -188,6 +193,9 @@ function pmd_ci_deploy_build_artifacts() {
# Deploy to github releases
pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-bin-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-src-${PMD_CI_MAVEN_PROJECT_VERSION}.zip"
+ # Deploy SBOM
+ pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml"
+ pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json"
fi
}
From bdd06be619c367152e73bb9c4c2d4713ee1300b6 Mon Sep 17 00:00:00 2001
From: Andreas Dangel
Date: Thu, 13 Apr 2023 16:24:02 +0200
Subject: [PATCH 16/23] [doc] Mention pmd-languages-deps
---
.../adding_a_new_antlr_based_language.md | 6 ++++++
.../adding_a_new_javacc_based_language.md | 7 ++++++-
.../devdocs/major_contributions/adding_new_cpd_language.md | 6 ++++++
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/docs/pages/pmd/devdocs/major_contributions/adding_a_new_antlr_based_language.md b/docs/pages/pmd/devdocs/major_contributions/adding_a_new_antlr_based_language.md
index 4ee9585405..a2faa0967e 100644
--- a/docs/pages/pmd/devdocs/major_contributions/adding_a_new_antlr_based_language.md
+++ b/docs/pages/pmd/devdocs/major_contributions/adding_a_new_antlr_based_language.md
@@ -52,6 +52,12 @@ definitely don't come for free. It is much effort and requires perseverance to i
## 1. Start with a new sub-module
* See pmd-swift for examples.
+* Make sure to add your new module to the parent pom as `` entry, so that it is built alongside the
+ other languages.
+* Also add your new module to the dependencies list in "pmd-languages-deps/pom.xml", so that the new language
+ is automatically available in the binary distribution (pmd-dist) as well as for the shell-completion
+ in the pmd-cli module.
+
## 2. Implement an AST parser for your language
* ANTLR will generate the parser for you based on the grammar file. The grammar file needs to be placed in the
diff --git a/docs/pages/pmd/devdocs/major_contributions/adding_a_new_javacc_based_language.md b/docs/pages/pmd/devdocs/major_contributions/adding_a_new_javacc_based_language.md
index 1e4e523b1c..5cf6c66757 100644
--- a/docs/pages/pmd/devdocs/major_contributions/adding_a_new_javacc_based_language.md
+++ b/docs/pages/pmd/devdocs/major_contributions/adding_a_new_javacc_based_language.md
@@ -35,7 +35,12 @@ definitely don't come for free. It is much effort and requires perseverance to i
## 1. Start with a new sub-module
-* See pmd-java or pmd-vm for examples.
+* See pmd-java or pmd-vm for examples.
+* Make sure to add your new module to the parent pom as `` entry, so that it is built alongside the
+ other languages.
+* Also add your new module to the dependencies list in "pmd-languages-deps/pom.xml", so that the new language
+ is automatically available in the binary distribution (pmd-dist) as well as for the shell-completion
+ in the pmd-cli module.
## 2. Implement an AST parser for your language
* Ideally an AST parser should be implemented as a JJT file *(see VmParser.jjt or Java.jjt for example)*
diff --git a/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md b/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md
index 4590867fa8..5d6b2b4784 100644
--- a/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md
+++ b/docs/pages/pmd/devdocs/major_contributions/adding_new_cpd_language.md
@@ -17,6 +17,12 @@ Happily for you, to add CPD support for a new language is now easier than ever!
All you need to do is follow this few steps:
1. Create a new module for your language, you can take [the Golang module](https://github.com/pmd/pmd/tree/master/pmd-go) as an example
+ * Make sure to add your new module to the parent pom as `` entry, so that it is built alongside the
+ other languages.
+ * Also add your new module to the dependencies list in "pmd-languages-deps/pom.xml", so that the new language
+ is automatically available in the binary distribution (pmd-dist) as well as for the shell-completion
+ in the pmd-cli module.
+
2. Create a Tokenizer
- For Antlr grammars you can take the grammar from [here](https://github.com/antlr/grammars-v4) and extend [AntlrTokenizer](https://github.com/pmd/pmd/blob/master/pmd-core/src/main/java/net/sourceforge/pmd/cpd/internal/AntlrTokenizer.java) taking Go as an example
From ccf431aaadc0ebd987a274e8e05c1f6232366bde Mon Sep 17 00:00:00 2001
From: Andreas Dangel
Date: Thu, 13 Apr 2023 16:56:17 +0200
Subject: [PATCH 17/23] Add @nwcm as a contributor
---
.all-contributorsrc | 9 +++++++++
docs/pages/pmd/projectdocs/credits.md | 23 ++++++++++++-----------
2 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/.all-contributorsrc b/.all-contributorsrc
index ce485028d8..be48515595 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -7145,6 +7145,15 @@
"bug",
"code"
]
+ },
+ {
+ "login": "nwcm",
+ "name": "nwcm",
+ "avatar_url": "https://avatars.githubusercontent.com/u/111259588?v=4",
+ "profile": "https://github.com/nwcm",
+ "contributions": [
+ "doc"
+ ]
}
],
"contributorsPerLine": 7,
diff --git a/docs/pages/pmd/projectdocs/credits.md b/docs/pages/pmd/projectdocs/credits.md
index 7c364b7d02..60ed54ac18 100644
--- a/docs/pages/pmd/projectdocs/credits.md
+++ b/docs/pages/pmd/projectdocs/credits.md
@@ -919,100 +919,101 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d