Skip to content

Commit e16cbc0

Browse files
committed
Merge remote-tracking branch 'origin/update-from-template-github_com_xdev-software_standard-maven-template_master' into develop
2 parents b17f83d + 5fca134 commit e16cbc0

4 files changed

Lines changed: 159 additions & 117 deletions

File tree

.github/workflows/check-build.yml

Lines changed: 58 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,20 @@ jobs:
3030
steps:
3131
- uses: actions/checkout@v7
3232

33-
- name: Set up JDK
34-
uses: actions/setup-java@v6
35-
with:
36-
distribution: ${{ matrix.distribution }}
37-
java-version: ${{ matrix.java }}
38-
39-
- name: Cache Maven
40-
uses: actions/cache@v6
41-
with:
42-
path: ~/.m2/repository
43-
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
44-
restore-keys: |
45-
${{ runner.os }}-mvn-build-
33+
- parallel:
34+
- name: Set up JDK
35+
uses: actions/setup-java@v6
36+
with:
37+
distribution: ${{ matrix.distribution }}
38+
java-version: ${{ matrix.java }}
39+
40+
- name: Cache Maven
41+
uses: actions/cache@v6
42+
with:
43+
path: ~/.m2/repository
44+
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
45+
restore-keys: |
46+
${{ runner.os }}-mvn-build-
4647
4748
- name: Build with Maven
4849
run: ./mvnw -B clean package
@@ -76,27 +77,28 @@ jobs:
7677
steps:
7778
- uses: actions/checkout@v7
7879

79-
- name: Set up JDK
80-
uses: actions/setup-java@v6
81-
with:
82-
distribution: ${{ matrix.distribution }}
83-
java-version: ${{ matrix.java }}
84-
85-
- name: Cache Maven
86-
uses: actions/cache@v6
87-
with:
88-
path: ~/.m2/repository
89-
key: ${{ runner.os }}-mvn-checkstyle-${{ hashFiles('**/pom.xml') }}
90-
restore-keys: |
91-
${{ runner.os }}-mvn-checkstyle-
92-
93-
- name: CheckStyle Cache
94-
uses: actions/cache@v6
95-
with:
96-
path: '**/target/checkstyle-cachefile'
97-
key: ${{ runner.os }}-checkstyle-${{ hashFiles('**/pom.xml') }}
98-
restore-keys: |
99-
${{ runner.os }}-checkstyle-
80+
- parallel:
81+
- name: Set up JDK
82+
uses: actions/setup-java@v6
83+
with:
84+
distribution: ${{ matrix.distribution }}
85+
java-version: ${{ matrix.java }}
86+
87+
- name: Cache Maven
88+
uses: actions/cache@v6
89+
with:
90+
path: ~/.m2/repository
91+
key: ${{ runner.os }}-mvn-checkstyle-${{ hashFiles('**/pom.xml') }}
92+
restore-keys: |
93+
${{ runner.os }}-mvn-checkstyle-
94+
95+
- name: CheckStyle Cache
96+
uses: actions/cache@v6
97+
with:
98+
path: '**/target/checkstyle-cachefile'
99+
key: ${{ runner.os }}-checkstyle-${{ hashFiles('**/pom.xml') }}
100+
restore-keys: |
101+
${{ runner.os }}-checkstyle-
100102
101103
- name: Run Checkstyle
102104
run: ./mvnw -B checkstyle:check -P checkstyle -T2C
@@ -112,27 +114,28 @@ jobs:
112114
steps:
113115
- uses: actions/checkout@v7
114116

115-
- name: Set up JDK
116-
uses: actions/setup-java@v6
117-
with:
118-
distribution: ${{ matrix.distribution }}
119-
java-version: ${{ matrix.java }}
120-
121-
- name: Cache Maven
122-
uses: actions/cache@v6
123-
with:
124-
path: ~/.m2/repository
125-
key: ${{ runner.os }}-mvn-pmd-${{ hashFiles('**/pom.xml') }}
126-
restore-keys: |
127-
${{ runner.os }}-mvn-pmd-
128-
129-
- name: PMD Cache
130-
uses: actions/cache@v6
131-
with:
132-
path: '**/target/pmd/pmd.cache'
133-
key: ${{ runner.os }}-pmd-${{ hashFiles('**/pom.xml') }}
134-
restore-keys: |
135-
${{ runner.os }}-pmd-
117+
- parallel:
118+
- name: Set up JDK
119+
uses: actions/setup-java@v6
120+
with:
121+
distribution: ${{ matrix.distribution }}
122+
java-version: ${{ matrix.java }}
123+
124+
- name: Cache Maven
125+
uses: actions/cache@v6
126+
with:
127+
path: ~/.m2/repository
128+
key: ${{ runner.os }}-mvn-pmd-${{ hashFiles('**/pom.xml') }}
129+
restore-keys: |
130+
${{ runner.os }}-mvn-pmd-
131+
132+
- name: PMD Cache
133+
uses: actions/cache@v6
134+
with:
135+
path: '**/target/pmd/pmd.cache'
136+
key: ${{ runner.os }}-pmd-${{ hashFiles('**/pom.xml') }}
137+
restore-keys: |
138+
${{ runner.os }}-pmd-
136139
137140
- name: Run PMD
138141
run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C

.github/workflows/release.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,21 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v7
2222

23-
- name: Set up JDK
24-
uses: actions/setup-java@v6
25-
with:
26-
java-version: '17'
27-
distribution: 'temurin'
28-
29-
# Try to reuse existing cache from check-build
30-
- name: Try restore Maven Cache
31-
uses: actions/cache/restore@v6
32-
with:
33-
path: ~/.m2/repository
34-
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
35-
restore-keys: |
36-
${{ runner.os }}-mvn-build-
23+
- parallel:
24+
- name: Set up JDK
25+
uses: actions/setup-java@v6
26+
with:
27+
java-version: '17'
28+
distribution: 'temurin'
29+
30+
# Try to reuse existing cache from check-build
31+
- name: Try restore Maven Cache
32+
uses: actions/cache/restore@v6
33+
with:
34+
path: ~/.m2/repository
35+
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
36+
restore-keys: |
37+
${{ runner.os }}-mvn-build-
3738
3839
- name: Build with Maven
3940
run: ./mvnw -B clean package -T2C

CONTRIBUTING.md

Lines changed: 30 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,56 @@
1-
## Contributing
1+
# Contributing
22

3-
We would absolutely love to get the community involved, and we welcome any form of contributions comments and questions on different communication channels, issues and pull request and anything that you build and share using our components.
3+
We would absolutely love to get the community involved and we welcome any form of contributions - comments and questions, issues, pull request and anything that you build and share using our project.
44

5-
### Communication channels
5+
## Communication channels
66
* Communication is primarily done using issues.
77
* If you need support as soon as possible and you can't wait for any pull request, feel free to use [our support](https://xdev.software/en/services-products/support).
88
* As a last resort measure or on otherwise important matter you may also [contact us directly](https://xdev.software/en/about-us/contact).
99

10-
### Ways to help
11-
* **Report bugs**<br/>Create an issue or send a pull request
10+
## Ways to help
11+
* **Report bugs**<br/>Create an issue and send a pull request
1212
* **Send pull requests**<br/>If you want to contribute code, check out the development instructions below.
1313
* However when contributing larger new features, please first discuss the change you wish to make via issue with the owners of this repository before making it.<br/>Otherwise your work might be rejected and your effort was pointless.
14+
* Please also note that your pull request might not be noticed immediately when it's not attached to an issue.
1415

1516
We also encourage you to read the [contribution instructions by GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project).
1617

1718
## Developing
1819

19-
### Software Requirements
20-
You should have the following things installed:
21-
* Git
22-
* Java 25 - should be as unmodified as possible (Recommended: [Eclipse Adoptium](https://adoptium.net/temurin/releases/))
23-
* Maven (Note that the [Maven Wrapper](https://maven.apache.org/tools/wrapper/) is shipped with the repo)
20+
Project specific development instructions can be found in [DEVELOPING.md](./DEVELOPING.md)
2421

25-
### Recommended setup
26-
* Install `IntelliJ`
27-
* Recommended setup actions
28-
* Disable not needed plugins
29-
* Disable [telemetry](https://www.jetbrains.com/help/idea/settings-usage-statistics.html)
30-
* Configure the available memory
31-
* Import the project
32-
* You will get prompted to install the required plugins
33-
* Ensure that everything is encoded in `UTF-8`
34-
* Ensure that the JDK/Java-Version is correct
3522

23+
## On AI use / LLM generated content
3624

37-
## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/pmd-java-rules/release.yml?branch=master)](https://github.com/xdev-software/pmd-java-rules/actions/workflows/release.yml)
25+
_Our reason for the strict policy is due to [unqualified people using the technology](https://en.wikipedia.org/wiki/AI_slop)._
3826

39-
Before releasing:
40-
* Consider doing a [test-deployment](https://github.com/xdev-software/pmd-java-rules/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
41-
* Check the [changelog](CHANGELOG.md)
27+
<sup>This policy was inspired by the AI policies of `curl`, `MESA`, `matplotlib` and `Ghostty`.</sup>
4228

43-
If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes
29+
### Issues and security reports
4430

45-
When the release is finished do the following:
46-
* Merge the auto-generated PR (with the incremented version number) back into the ``develop``
31+
If you asked an AI tool to find problems in the project, you must make sure to reveal this fact in your issue.
4732

48-
### Release failures
33+
You must also double-check the findings carefully before reporting them to us to validate that the issue is indeed existing and working exactly as the AI says. AI-based tools frequently generate inaccurate or fabricated results.
4934

50-
There are 2 modes of release failure:
51-
1. The remote server was e.g. down and non of the artifacts got published
52-
2. There was a build failure during release and only parts of the artifacts got released
35+
Further: It is rarely a good idea to copy and paste an AI generated report to the project. Those are typically too wordy and rarely to the point - in addition to the common fabricated details.<br/>
36+
If you actually find a problem with an AI and you have verified it yourself to be true: Write the issue/report yourself and explain the problem as you have learned it. This makes sure the AI-generated inaccuracies and invented issues are filtered out early before they waste more people's time.
5337

54-
In case 1 we can re-release the existing version,<br/>in case 2 we have to release a new version when we can't get the artifacts deleted (as is the case with Maven Central)
38+
As we take security reports seriously, we investigate each report with priority. This work is both time and energy consuming and pulls us away from doing other meaningful work. Fake and otherwise made up security problems effectively prevent us from doing real project work and make us waste time and resources.
5539

56-
#### How-to: Re-Releasing an existing version
40+
We will ban and report users who submit made up fake reports.
5741

58-
1. Delete the release on GitHub
59-
2. Delete the release Git tag from the repo (locally and remote!)
60-
3. Delete the ``master``-Branch and re-create it from the ``develop`` branch (or reset it to the state before the release-workflow commits have been done)
61-
* This requires __temporarily__ removing the branch protection
62-
* Once this was done a new release is triggered immediately!
42+
### Pull requests
6343

64-
#### How-to: Releasing a new version
44+
When contributing content to the project, you give us permission to use it as-is and you must make sure you are allowed to distribute it to us. By submitting a change to us, you agree that the changes can and should be adopted and get redistributed under the project's license. Authors should be explicitly aware that the burden is on them to ensure no unlicensed code is submitted to the project.
6545

66-
1. Merge the ``master`` branch back into ``develop`` (or another temporary branch)
67-
2. Make sure all master branch versions are prepared for a new release<br/>e.g. if the broken release was ``1.0.0`` the version should now be at ``1.0.1-SNAPSHOT`` - the ``SNAPSHOT`` is important for the workflow!
68-
3. Mark the broken release as broken e.g. inside the Changelog, GitHub Release page, etc.<br/>
69-
You can use something like this:
70-
```
71-
> [!WARNING]
72-
> This release is broken as my cat accidentally clicked the abort button during the process
73-
```
74-
4. Merge the changes back into the ``master`` branch to trigger a new release
46+
This is independent if AI is used or not.
47+
48+
When contributing a pull request you should of course always make sure that the proposal is good quality and a best effort that follows our guidelines. A basic rule of thumb is that if someone can spot that the contribution was made with the help of AI, you have more work to do.
49+
50+
We can accept code written with the help of AI into the project, but the code must still follow coding standards, be written clearly and adhere to all the normal requirements we have.
51+
52+
### Further notices
53+
54+
* External AI tooling (e.g. bots, agents) directly interacting with the project - without a human - are not allowed and will be banned and reported.
55+
* For commit messages the same guidelines as described above for issues apply - fully generated messages are not allowed.
56+
* AI assisted/generated commits can NOT use the `Co-authored-by` tag as this is reserved for humans - use `Assisted-by`/`Generated-by` instead.

DEVELOPING.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
### Software Requirements
2+
You should have the following things installed:
3+
* Git
4+
* Java 25 - should be as unmodified as possible (Recommended: [Eclipse Adoptium](https://adoptium.net/temurin/releases/))
5+
* Maven (Note that the [Maven Wrapper](https://maven.apache.org/tools/wrapper/) is shipped with the repo)
6+
7+
### Recommended setup
8+
* Install `IntelliJ`
9+
* Recommended setup actions
10+
* Disable not needed plugins
11+
* Disable [telemetry](https://www.jetbrains.com/help/idea/settings-usage-statistics.html)
12+
* Configure the available memory
13+
* Import the project
14+
* You will get prompted to install the required plugins
15+
* Ensure that everything is encoded in `UTF-8`
16+
* Ensure that the JDK/Java-Version is correct
17+
18+
19+
## Releasing
20+
21+
Before releasing:
22+
* Consider doing a `test-deployment` before actually releasing.
23+
* Check the [changelog](CHANGELOG.md)
24+
25+
If the `develop` is ready for release, create a pull request to the `master`-Branch and merge the changes
26+
27+
When the release is finished do the following:
28+
* Merge the auto-generated PR (with the incremented version number) back into the `develop`
29+
30+
### Release failures
31+
32+
There are 2 modes of release failure:
33+
1. The remote server was e.g. down and non of the artifacts got published
34+
2. There was a build failure during release and only parts of the artifacts got released
35+
36+
In case 1 we can re-release the existing version,<br/>in case 2 we have to release a new version when we can't get the artifacts deleted (as is the case with Maven Central)
37+
38+
#### How-to: Re-Releasing an existing version
39+
40+
1. Delete the release on GitHub
41+
2. Delete the release Git tag from the repo (locally and remote!)
42+
3. Delete the ``master``-Branch and re-create it from the ``develop`` branch (or reset it to the state before the release-workflow commits have been done)
43+
* This requires __temporarily__ removing the branch protection
44+
* Once this was done a new release is triggered immediately!
45+
46+
#### How-to: Releasing a new version
47+
48+
1. Merge the ``master`` branch back into ``develop`` (or another temporary branch)
49+
2. Make sure all master branch versions are prepared for a new release<br/>e.g. if the broken release was ``1.0.0`` the version should now be at ``1.0.1-SNAPSHOT`` - the ``SNAPSHOT`` is important for the workflow!
50+
3. Mark the broken release as broken e.g. inside the Changelog, GitHub Release page, etc.<br/>
51+
You can use something like this:
52+
```
53+
> [!WARNING]
54+
> This release is broken as my cat accidentally clicked the abort button during the process
55+
```
56+
4. Merge the changes back into the ``master`` branch to trigger a new release

0 commit comments

Comments
 (0)