Skip to content

Commit 08a747e

Browse files
authored
Merge pull request #229 from xdev-software/develop
Release
2 parents 5dc2f27 + 183f7e6 commit 08a747e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+476
-414
lines changed

.config/pmd/ruleset.xml

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset name="Default"
3+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
6+
7+
<description>
8+
This ruleset checks the code for discouraged programming constructs.
9+
</description>
10+
11+
<!-- Only rules that don't overlap with CheckStyle! -->
12+
13+
<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP"/>
14+
<rule ref="category/java/bestpractices.xml/PreserveStackTrace"/>
15+
<rule ref="category/java/bestpractices.xml/UseCollectionIsEmpty"/>
16+
<rule ref="category/java/bestpractices.xml/UseStandardCharsets"/>
17+
18+
<!-- Native code is platform dependent; Loading external native libs might pose a security threat -->
19+
<rule ref="category/java/codestyle.xml/AvoidUsingNativeCode"/>
20+
<rule ref="category/java/codestyle.xml/IdenticalCatchBranches"/>
21+
<rule ref="category/java/codestyle.xml/NoPackage"/>
22+
<rule ref="category/java/codestyle.xml/PrematureDeclaration"/>
23+
24+
<rule ref="category/java/design.xml">
25+
<!-- Sometimes abstract classes have just fields -->
26+
<exclude name="AbstractClassWithoutAnyMethod"/>
27+
28+
<!-- Using RuntimeExceptions is ok -->
29+
<exclude name="AvoidCatchingGenericException"/>
30+
<exclude name="AvoidThrowingRawExceptionTypes"/>
31+
32+
<!-- Limit too low -->
33+
<exclude name="AvoidDeeplyNestedIfStmts"/>
34+
35+
<!-- Limit too low -->
36+
<exclude name="CouplingBetweenObjects"/>
37+
38+
<!-- Limit too low -->
39+
<exclude name="CyclomaticComplexity"/>
40+
41+
<!-- Makes entity classes impossible -->
42+
<exclude name="DataClass"/>
43+
44+
<!-- Used commonly particular in bigger methods with upstream throws -->
45+
<exclude name="ExceptionAsFlowControl"/>
46+
47+
<!-- Limit too low -->
48+
<exclude name="ExcessiveImports"/>
49+
50+
<!-- Handled by TooManyFields/TooManyMethods -->
51+
<exclude name="ExcessivePublicCount"/>
52+
53+
<!-- Prohibits accessing members using multiple depths -->
54+
<exclude name="LawOfDemeter"/>
55+
56+
<!-- No effect -->
57+
<exclude name="LoosePackageCoupling"/>
58+
59+
<!-- Prohibits singleton pattern -->
60+
<exclude name="MutableStaticState"/>
61+
62+
<!-- Checks LoC, already handled by Checkstyle -->
63+
<exclude name="NcssCount"/>
64+
65+
<!-- Some override methods or Junit require this -->
66+
<exclude name="SignatureDeclareThrowsException"/>
67+
68+
<!-- Reports FP for equals methods -->
69+
<exclude name="SimplifyBooleanReturns"/>
70+
71+
<!-- Limit too low -->
72+
<exclude name="TooManyFields"/>
73+
74+
<!-- Limit too low -->
75+
<exclude name="TooManyMethods"/>
76+
77+
<!-- Limit too low -->
78+
<exclude name="UseObjectForClearerAPI"/>
79+
80+
<!-- Handled by checkstyle -->
81+
<exclude name="UseUtilityClass"/>
82+
</rule>
83+
84+
<rule ref="category/java/design.xml/AvoidDeeplyNestedIfStmts">
85+
<properties>
86+
<property name="problemDepth" value="4"/>
87+
</properties>
88+
</rule>
89+
<rule ref="category/java/design.xml/CouplingBetweenObjects">
90+
<properties>
91+
<property name="threshold" value="100"/>
92+
</properties>
93+
</rule>
94+
<rule ref="category/java/design.xml/CyclomaticComplexity">
95+
<properties>
96+
<property name="classReportLevel" value="150"/>
97+
<property name="methodReportLevel" value="25"/>
98+
<property name="cycloOptions" value=""/>
99+
</properties>
100+
</rule>
101+
<rule ref="category/java/design.xml/ExcessiveImports">
102+
<properties>
103+
<property name="minimum" value="200"/>
104+
</properties>
105+
</rule>
106+
<rule ref="category/java/design.xml/TooManyFields">
107+
<properties>
108+
<property name="maxfields" value="50"/>
109+
</properties>
110+
</rule>
111+
<rule ref="category/java/design.xml/TooManyMethods">
112+
<properties>
113+
<property name="maxmethods" value="100"/>
114+
</properties>
115+
</rule>
116+
117+
<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues"/>
118+
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
119+
<rule ref="category/java/errorprone.xml/ComparisonWithNaN"/>
120+
<rule ref="category/java/errorprone.xml/DoNotCallGarbageCollectionExplicitly"/>
121+
<rule ref="category/java/errorprone.xml/DontImportSun"/>
122+
<rule ref="category/java/errorprone.xml/MisplacedNullCheck"/>
123+
<rule ref="category/java/errorprone.xml/UnnecessaryCaseChange"/>
124+
125+
126+
<rule ref="category/java/multithreading.xml">
127+
<!-- Just bloats code -->
128+
<exclude name="AvoidSynchronizedAtMethodLevel"/>
129+
130+
<!-- NOPE -->
131+
<exclude name="DoNotUseThreads"/>
132+
133+
<!-- Doesn't detect nested thread safe singleton pattern -->
134+
<exclude name="NonThreadSafeSingleton"/>
135+
136+
<!-- Should relevant for fields that use multithreading which is rare -->
137+
<exclude name="UseConcurrentHashMap"/>
138+
</rule>
139+
140+
<rule ref="category/java/performance.xml">
141+
<!-- This was fixed in Java 10 -->
142+
<exclude name="AvoidFileStream"/>
143+
144+
<!-- Used everywhere and has neglectable performance impact -->
145+
<exclude name="AvoidInstantiatingObjectsInLoops"/>
146+
147+
<!-- Handled by checkstyle -->
148+
<exclude name="RedundantFieldInitializer"/>
149+
150+
<!-- Nowadays optimized by compiler; No code bloating needed -->
151+
<exclude name="UseStringBufferForStringAppends"/>
152+
</rule>
153+
154+
<rule ref="category/java/security.xml"/>
155+
</ruleset>

.github/workflows/check-build.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
path: ${{ env.PRIMARY_MAVEN_MODULE }}/target/screenshots
8080
if-no-files-found: ignore
8181

82-
code-style:
82+
checkstyle:
8383
runs-on: ubuntu-latest
8484
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
8585

@@ -100,3 +100,40 @@ jobs:
100100

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

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
131131

132132
- name: Publish to Apache Maven Central
133-
run: ../mvnw -B deploy -Possrh
133+
run: ../mvnw -B deploy -Possrh -DskipTests
134134
env:
135135
MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }}
136136
MAVEN_CENTRAL_TOKEN: ${{ secrets.S01_OSS_SONATYPE_MAVEN_TOKEN }}
@@ -157,7 +157,7 @@ jobs:
157157
cache: 'maven'
158158

159159
- name: Build site
160-
run: ../mvnw -B site
160+
run: ../mvnw -B compile site -DskipTests -T2C
161161
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
162162

163163
- name: Deploy to Github pages
@@ -186,7 +186,7 @@ jobs:
186186
for i in "${modules[@]}"
187187
do
188188
echo "Processing $i/pom.xml"
189-
(cd "$i" && $mvnwPath -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true)
189+
(cd "$i" && $mvnwPath -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true -DupdateMatchingVersions=false)
190190
done
191191
192192
- name: Git Commit and Push

.github/workflows/test-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
2525

2626
- name: Publish to OSSRH
27-
run: ../mvnw -B deploy -Possrh
27+
run: ../mvnw -B deploy -Possrh -DskipTests
2828
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
2929
env:
3030
MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }}

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ buildNumber.properties
3939
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
4040
hs_err_pid*
4141

42-
43-
# bin / compiled stuff
44-
target/
45-
46-
4742
# JRebel
4843
**/resources/rebel.xml
4944
**/resources/rebel-remote.xml

.idea/saveactions_settings.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.mvn/wrapper/maven-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 2.1.0
2+
* Charts no longer check if they are drawable #198
3+
* ChartJS behavior: If a chart can't be drawn it will render a empty canvas
4+
* Deprecated methods: ``Chart#toJsonNative`` and ``Chart#isDrawable``
5+
* Make ``IndexAxis`` available in all options
6+
17
## 2.0.1
28
* Restored ``DisplayFormats`` #186
39

CONTRIBUTING.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,31 @@ If the ``develop`` is ready for release, create a pull request to the ``master``
4444

4545
When the release is finished do the following:
4646
* Merge the auto-generated PR (with the incremented version number) back into the ``develop``
47+
48+
### Release failures
49+
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
53+
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)
55+
56+
#### How-to: Re-Releasing an existing version
57+
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!
63+
64+
#### How-to: Releasing a new version
65+
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

chartjs-java-model-demo/pom.xml

Lines changed: 6 additions & 33 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>chartjs-java-model-root</artifactId>
10+
<version>2.0.2-SNAPSHOT</version>
11+
</parent>
12+
813
<artifactId>chartjs-java-model-demo</artifactId>
914
<version>2.0.2-SNAPSHOT</version>
1015
<packaging>jar</packaging>
@@ -77,36 +82,4 @@
7782
</plugin>
7883
</plugins>
7984
</build>
80-
<profiles>
81-
<profile>
82-
<id>checkstyle</id>
83-
<build>
84-
<plugins>
85-
<plugin>
86-
<groupId>org.apache.maven.plugins</groupId>
87-
<artifactId>maven-checkstyle-plugin</artifactId>
88-
<version>3.4.0</version>
89-
<dependencies>
90-
<dependency>
91-
<groupId>com.puppycrawl.tools</groupId>
92-
<artifactId>checkstyle</artifactId>
93-
<version>10.17.0</version>
94-
</dependency>
95-
</dependencies>
96-
<configuration>
97-
<configLocation>../.config/checkstyle/checkstyle.xml</configLocation>
98-
<includeTestSourceDirectory>true</includeTestSourceDirectory>
99-
</configuration>
100-
<executions>
101-
<execution>
102-
<goals>
103-
<goal>check</goal>
104-
</goals>
105-
</execution>
106-
</executions>
107-
</plugin>
108-
</plugins>
109-
</build>
110-
</profile>
111-
</profiles>
11285
</project>

0 commit comments

Comments
 (0)