Skip to content

Commit b970c46

Browse files
committed
Merge remote-tracking branch 'origin/update-from-template'
2 parents 217ac87 + d979ab9 commit b970c46

File tree

4 files changed

+147
-34
lines changed

4 files changed

+147
-34
lines changed

.github/workflows/check-build.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar
7171
if-no-files-found: error
7272

73-
code-style:
73+
checkstyle:
7474
runs-on: ubuntu-latest
7575
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
7676

@@ -91,3 +91,40 @@ jobs:
9191

9292
- name: Run Checkstyle
9393
run: ./mvnw -B checkstyle:check -P checkstyle -T2C
94+
95+
pmd:
96+
runs-on: ubuntu-latest
97+
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
98+
99+
strategy:
100+
matrix:
101+
java: [17]
102+
distribution: [temurin]
103+
104+
steps:
105+
- uses: actions/checkout@v4
106+
107+
- name: Set up JDK
108+
uses: actions/setup-java@v4
109+
with:
110+
distribution: ${{ matrix.distribution }}
111+
java-version: ${{ matrix.java }}
112+
cache: 'maven'
113+
114+
- name: Run PMD
115+
run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C
116+
117+
- name: Run CPD (Copy Paste Detector)
118+
run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C
119+
120+
- name: Upload report
121+
if: always()
122+
uses: actions/upload-artifact@v4
123+
with:
124+
name: pmd-report
125+
if-no-files-found: ignore
126+
path: |
127+
target/site/*.html
128+
target/site/css/**
129+
target/site/images/logos/maven-feather.png
130+
target/site/images/external.png

pom.xml

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
<module>template-placeholder-demo</module>
2020
</modules>
2121

22+
<properties>
23+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
24+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
25+
</properties>
26+
2227
<licenses>
2328
<license>
2429
<name>Apache License, Version 2.0</name>
@@ -29,20 +34,75 @@
2934

3035
<profiles>
3136
<profile>
32-
<!-- Disable checkstyle in root module as there is nothing to check -->
3337
<id>checkstyle</id>
3438
<build>
3539
<plugins>
3640
<plugin>
3741
<groupId>org.apache.maven.plugins</groupId>
3842
<artifactId>maven-checkstyle-plugin</artifactId>
3943
<version>3.4.0</version>
44+
<dependencies>
45+
<dependency>
46+
<groupId>com.puppycrawl.tools</groupId>
47+
<artifactId>checkstyle</artifactId>
48+
<version>10.17.0</version>
49+
</dependency>
50+
</dependencies>
51+
<configuration>
52+
<configLocation>.config/checkstyle/checkstyle.xml</configLocation>
53+
<includeTestSourceDirectory>true</includeTestSourceDirectory>
54+
</configuration>
55+
<executions>
56+
<execution>
57+
<goals>
58+
<goal>check</goal>
59+
</goals>
60+
</execution>
61+
</executions>
62+
</plugin>
63+
</plugins>
64+
</build>
65+
</profile>
66+
<profile>
67+
<id>pmd</id>
68+
<build>
69+
<plugins>
70+
<plugin>
71+
<groupId>org.apache.maven.plugins</groupId>
72+
<artifactId>maven-pmd-plugin</artifactId>
73+
<version>3.23.0</version>
4074
<configuration>
41-
<skip>true</skip>
75+
<includeTests>true</includeTests>
76+
<printFailingErrors>true</printFailingErrors>
77+
<rulesets>
78+
<ruleset>.config/pmd/ruleset.xml</ruleset>
79+
</rulesets>
4280
</configuration>
81+
<dependencies>
82+
<dependency>
83+
<groupId>net.sourceforge.pmd</groupId>
84+
<artifactId>pmd-core</artifactId>
85+
<version>7.2.0</version>
86+
</dependency>
87+
<dependency>
88+
<groupId>net.sourceforge.pmd</groupId>
89+
<artifactId>pmd-java</artifactId>
90+
<version>7.2.0</version>
91+
</dependency>
92+
</dependencies>
4393
</plugin>
4494
</plugins>
4595
</build>
96+
<reporting>
97+
<plugins>
98+
<!-- Required for reporting -->
99+
<plugin>
100+
<groupId>org.apache.maven.plugins</groupId>
101+
<artifactId>maven-jxr-plugin</artifactId>
102+
<version>3.4.0</version>
103+
</plugin>
104+
</plugins>
105+
</reporting>
46106
</profile>
47107
</profiles>
48108
</project>

template-placeholder-demo/pom.xml

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7-
<groupId>software.xdev</groupId>
7+
<parent>
8+
<groupId>software.xdev</groupId>
9+
<artifactId>template-placeholder-root</artifactId>
10+
<version>1.0.0-SNAPSHOT</version>
11+
</parent>
12+
813
<artifactId>template-placeholder-demo</artifactId>
914
<version>1.0.0-SNAPSHOT</version>
1015
<packaging>jar</packaging>
@@ -177,35 +182,5 @@
177182
</plugins>
178183
</build>
179184
</profile>
180-
<profile>
181-
<id>checkstyle</id>
182-
<build>
183-
<plugins>
184-
<plugin>
185-
<groupId>org.apache.maven.plugins</groupId>
186-
<artifactId>maven-checkstyle-plugin</artifactId>
187-
<version>3.4.0</version>
188-
<dependencies>
189-
<dependency>
190-
<groupId>com.puppycrawl.tools</groupId>
191-
<artifactId>checkstyle</artifactId>
192-
<version>10.17.0</version>
193-
</dependency>
194-
</dependencies>
195-
<configuration>
196-
<configLocation>../.config/checkstyle/checkstyle.xml</configLocation>
197-
<includeTestSourceDirectory>true</includeTestSourceDirectory>
198-
</configuration>
199-
<executions>
200-
<execution>
201-
<goals>
202-
<goal>check</goal>
203-
</goals>
204-
</execution>
205-
</executions>
206-
</plugin>
207-
</plugins>
208-
</build>
209-
</profile>
210185
</profiles>
211186
</project>

template-placeholder/pom.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,5 +333,46 @@
333333
</plugins>
334334
</build>
335335
</profile>
336+
<profile>
337+
<id>pmd</id>
338+
<build>
339+
<plugins>
340+
<plugin>
341+
<groupId>org.apache.maven.plugins</groupId>
342+
<artifactId>maven-pmd-plugin</artifactId>
343+
<version>3.23.0</version>
344+
<configuration>
345+
<includeTests>true</includeTests>
346+
<printFailingErrors>true</printFailingErrors>
347+
<rulesets>
348+
<ruleset>../.config/pmd/ruleset.xml</ruleset>
349+
</rulesets>
350+
</configuration>
351+
<dependencies>
352+
<dependency>
353+
<groupId>net.sourceforge.pmd</groupId>
354+
<artifactId>pmd-core</artifactId>
355+
<version>7.2.0</version>
356+
</dependency>
357+
<dependency>
358+
<groupId>net.sourceforge.pmd</groupId>
359+
<artifactId>pmd-java</artifactId>
360+
<version>7.2.0</version>
361+
</dependency>
362+
</dependencies>
363+
</plugin>
364+
</plugins>
365+
</build>
366+
<reporting>
367+
<plugins>
368+
<!-- Required for reporting -->
369+
<plugin>
370+
<groupId>org.apache.maven.plugins</groupId>
371+
<artifactId>maven-jxr-plugin</artifactId>
372+
<version>3.4.0</version>
373+
</plugin>
374+
</plugins>
375+
</reporting>
376+
</profile>
336377
</profiles>
337378
</project>

0 commit comments

Comments
 (0)