diff --git a/.config/pmd/ruleset.xml b/.config/pmd/ruleset.xml new file mode 100644 index 0000000..5f88156 --- /dev/null +++ b/.config/pmd/ruleset.xml @@ -0,0 +1,152 @@ + + + + + This ruleset checks the code for discouraged programming constructs. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 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 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 diff --git a/pom.xml b/pom.xml index 8fc5ca9..e41a6a2 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,68 @@ 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 + 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 + + + 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 - - - - - - - - diff --git a/template-placeholder/pom.xml b/template-placeholder/pom.xml index fb307dd..b743ae7 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 @@ -265,5 +265,46 @@ + + 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 + + + +