Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
03dd571
Update dependency org.apache.maven.plugins:maven-project-info-reports…
xdev-renovate Jun 17, 2024
8446899
Merge pull request #71 from xdev-software/renovate/org.apache.maven.p…
AB-xdev Jun 17, 2024
4bb8941
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 18, 2024
7313ce9
Update dependency maven to v3.9.8
xdev-renovate Jun 18, 2024
5854083
Merge pull request #72 from xdev-software/renovate/maven-3.x
AB-xdev Jun 18, 2024
aa67625
Update dependency software.xdev:find-and-replace-maven-plugin to v1.0.1
xdev-renovate Jun 18, 2024
bd2437d
Merge pull request #96 from xdev-software/renovate/software.xdev-find…
AB-xdev Jun 18, 2024
3e41f58
Add default PMD ruleset
AB-xdev Jun 18, 2024
049c438
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 18, 2024
f697749
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 18, 2024
43ddc48
Attach demo to parent
AB-xdev Jun 18, 2024
3bc085a
Reconfigure root and add pmd
AB-xdev Jun 18, 2024
f5240c0
Add pmd to published module
AB-xdev Jun 18, 2024
11c6f7e
Add pmd to check-build workflow
AB-xdev Jun 18, 2024
66362d4
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 19, 2024
a22d20d
Merge pull request #74 from xdev-software/pmd
AB-xdev Jun 19, 2024
d979ab9
PMD: printFailingErrors
AB-xdev Jun 19, 2024
255da79
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 19, 2024
76323cb
Ignore PMD on main module as code is 100% auto-generated
AB-xdev Jun 19, 2024
eed3d8a
Update ruleset.xml
AB-xdev Jun 19, 2024
2b01eda
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 19, 2024
4ab6507
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 19, 2024
6a258c7
Remove duplicate in .gitignore
AB-xdev Jun 20, 2024
ef946ee
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 21, 2024
f2290e6
Ignore project internal depenedencies
AB-xdev Jun 24, 2024
af19f5c
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 24, 2024
f172061
Update dependency org.apache.maven.plugins:maven-clean-plugin to v3.4.0
xdev-renovate Jun 24, 2024
1cec0e0
Update dependency org.apache.maven.plugins:maven-project-info-reports…
xdev-renovate Jun 27, 2024
98b2e91
Merge pull request #76 from xdev-software/renovate/org.apache.maven.p…
AB-xdev Jun 27, 2024
9a73a84
Merge pull request #101 from xdev-software/renovate/org.apache.maven.…
AB-xdev Jun 27, 2024
c4288a7
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 27, 2024
e26126f
[Save Actions] Allow batch activation
AB-xdev Jun 27, 2024
e817320
Don't run tests when publishing in final phase
AB-xdev Jun 27, 2024
a497c4b
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 27, 2024
e458a5b
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 27, 2024
ce61f92
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 27, 2024
283794c
Remove unwanted EOL
AB-xdev Jun 27, 2024
3b1cdd0
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 27, 2024
3c596bd
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 27, 2024
8949700
Fix some module versions being bumped twice after a release
AB-xdev Jun 27, 2024
034ee38
Merge branch 'master' of https://github.com/xdev-software/standard-ma…
AB-xdev Jun 27, 2024
58a2182
Merge branch 'master' into update-from-template-merged
xdev-gh-bot Jun 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 152 additions & 0 deletions .config/pmd/ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Default"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">

<description>
This ruleset checks the code for discouraged programming constructs.
</description>

<!-- Only rules that don't overlap with CheckStyle! -->

<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP"/>
<rule ref="category/java/bestpractices.xml/PreserveStackTrace"/>
<rule ref="category/java/bestpractices.xml/UseCollectionIsEmpty"/>
<rule ref="category/java/bestpractices.xml/UseStandardCharsets"/>

<!-- Native code is platform dependent; Loading external native libs might pose a security threat -->
<rule ref="category/java/codestyle.xml/AvoidUsingNativeCode"/>
<rule ref="category/java/codestyle.xml/IdenticalCatchBranches"/>
<rule ref="category/java/codestyle.xml/NoPackage"/>
<rule ref="category/java/codestyle.xml/PrematureDeclaration"/>

<rule ref="category/java/design.xml">
<!-- Sometimes abstract classes have just fields -->
<exclude name="AbstractClassWithoutAnyMethod"/>

<!-- Using RuntimeExceptions is ok -->
<exclude name="AvoidCatchingGenericException"/>
<exclude name="AvoidThrowingRawExceptionTypes"/>

<!-- Limit too low -->
<exclude name="AvoidDeeplyNestedIfStmts"/>

<!-- Limit too low -->
<exclude name="CouplingBetweenObjects"/>

<!-- Limit too low -->
<exclude name="CyclomaticComplexity"/>

<!-- Makes entity classes impossible -->
<exclude name="DataClass"/>

<!-- Used commonly particular in bigger methods with upstream throws -->
<exclude name="ExceptionAsFlowControl"/>

<!-- Limit too low -->
<exclude name="ExcessiveImports"/>

<!-- Handled by TooManyFields/TooManyMethods -->
<exclude name="ExcessivePublicCount"/>

<!-- Prohibits accessing members using multiple depths -->
<exclude name="LawOfDemeter"/>

<!-- No effect -->
<exclude name="LoosePackageCoupling"/>

<!-- Prohibits singleton pattern -->
<exclude name="MutableStaticState"/>

<!-- Some override methods or Junit require this -->
<exclude name="SignatureDeclareThrowsException"/>

<!-- Reports FP for equals methods -->
<exclude name="SimplifyBooleanReturns"/>

<!-- Limit too low -->
<exclude name="TooManyFields"/>

<!-- Limit too low -->
<exclude name="TooManyMethods"/>

<!-- Limit too low -->
<exclude name="UseObjectForClearerAPI"/>

<!-- Handled by checkstyle -->
<exclude name="UseUtilityClass"/>
</rule>

<rule ref="category/java/design.xml/AvoidDeeplyNestedIfStmts">
<properties>
<property name="problemDepth" value="4"/>
</properties>
</rule>
<rule ref="category/java/design.xml/CouplingBetweenObjects">
<properties>
<property name="threshold" value="100"/>
</properties>
</rule>
<rule ref="category/java/design.xml/CyclomaticComplexity">
<properties>
<property name="classReportLevel" value="150"/>
<property name="methodReportLevel" value="25"/>
<property name="cycloOptions" value=""/>
</properties>
</rule>
<rule ref="category/java/design.xml/ExcessiveImports">
<properties>
<property name="minimum" value="200"/>
</properties>
</rule>
<rule ref="category/java/design.xml/TooManyFields">
<properties>
<property name="maxfields" value="50"/>
</properties>
</rule>
<rule ref="category/java/design.xml/TooManyMethods">
<properties>
<property name="maxmethods" value="100"/>
</properties>
</rule>

<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues"/>
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
<rule ref="category/java/errorprone.xml/ComparisonWithNaN"/>
<rule ref="category/java/errorprone.xml/DoNotCallGarbageCollectionExplicitly"/>
<rule ref="category/java/errorprone.xml/DontImportSun"/>
<rule ref="category/java/errorprone.xml/MisplacedNullCheck"/>
<rule ref="category/java/errorprone.xml/UnnecessaryCaseChange"/>


<rule ref="category/java/multithreading.xml">
<!-- Just bloats code -->
<exclude name="AvoidSynchronizedAtMethodLevel"/>

<!-- NOPE -->
<exclude name="DoNotUseThreads"/>

<!-- Doesn't detect nested thread safe singleton pattern -->
<exclude name="NonThreadSafeSingleton"/>

<!-- Should relevant for fields that use multithreading which is rare -->
<exclude name="UseConcurrentHashMap"/>
</rule>

<rule ref="category/java/performance.xml">
<!-- This was fixed in Java 10 -->
<exclude name="AvoidFileStream"/>

<!-- Used everywhere and has neglectable performance impact -->
<exclude name="AvoidInstantiatingObjectsInLoops"/>

<!-- Handled by checkstyle -->
<exclude name="RedundantFieldInitializer"/>

<!-- Nowadays optimized by compiler; No code bloating needed -->
<exclude name="UseStringBufferForStringAppends"/>
</rule>

<rule ref="category/java/security.xml"/>
</ruleset>
39 changes: 38 additions & 1 deletion .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/') }}

Expand All @@ -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
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}

- name: Publish to Apache Maven Central
run: ../mvnw -B deploy -Possrh
run: ../mvnw -B deploy -Possrh -DskipTests
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }}
Expand All @@ -157,7 +157,7 @@ jobs:
cache: 'maven'

- name: Build site
run: ../mvnw -B site
run: ../mvnw -B site -DskipTests
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}

- name: Deploy to Github pages
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
for i in "${modules[@]}"
do
echo "Processing $i/pom.xml"
(cd "$i" && $mvnwPath -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true)
(cd "$i" && $mvnwPath -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true -DupdateMatchingVersions=false)
done

- name: Git Commit and Push
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .idea/saveactions_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
64 changes: 62 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
<module>template-placeholder-demo</module>
</modules>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<licenses>
<license>
<name>Apache License, Version 2.0</name>
Expand All @@ -29,20 +34,75 @@

<profiles>
<profile>
<!-- Disable checkstyle in root module as there is nothing to check -->
<id>checkstyle</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.4.0</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.17.0</version>
</dependency>
</dependencies>
<configuration>
<configLocation>.config/checkstyle/checkstyle.xml</configLocation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>pmd</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.23.0</version>
<configuration>
<skip>true</skip>
<includeTests>true</includeTests>
<printFailingErrors>true</printFailingErrors>
<rulesets>
<ruleset>.config/pmd/ruleset.xml</ruleset>
</rulesets>
</configuration>
<dependencies>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>7.2.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.2.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<!-- Required for reporting -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>3.4.0</version>
</plugin>
</plugins>
</reporting>
</profile>
</profiles>
</project>
12 changes: 11 additions & 1 deletion renovate.json5
Original file line number Diff line number Diff line change
@@ -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
}
]
}
Loading