Skip to content

Commit 9501b3d

Browse files
aepflitoddbaert
andauthored
build: utilizing new java version, but still building with language level 8 (#1205)
Signed-off-by: Simon Schrottner <[email protected]> Co-authored-by: Todd Baert <[email protected]>
1 parent 2bf613f commit 9501b3d

File tree

7 files changed

+274
-215
lines changed

7 files changed

+274
-215
lines changed

.github/workflows/ci.yml

+15-6
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,35 @@ on:
1010

1111
jobs:
1212
main:
13-
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest]
16+
build:
17+
- java: 17
18+
profile: codequality
19+
- java: 8
20+
profile: java8
1421

22+
name: with Java ${{ matrix.build.java }}
23+
runs-on: ${{ matrix.os}}
1524
steps:
1625
- name: Checkout Repository
1726
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1827

19-
- name: Set up JDK 8
28+
- name: Set up JDK ${{ matrix.build.java }}
2029
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4
2130
with:
22-
java-version: '8'
31+
java-version: ${{ matrix.build.java }}
2332
distribution: 'temurin'
2433
cache: maven
2534

2635
- name: Cache local Maven repository
2736
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4
2837
with:
2938
path: ~/.m2/repository
30-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
39+
key: ${{ runner.os }}${{ matrix.build.java }}-maven-${{ hashFiles('**/pom.xml') }}
3140
restore-keys: |
32-
${{ runner.os }}-maven-
41+
${{ runner.os }}${{ matrix.build.java }}-maven-
3342
3443
- name: Maven Verify
35-
run: mvn --batch-mode --activate-profiles e2e clean verify
44+
run: mvn --batch-mode --activate-profiles e2e,${{ matrix.build.profile }} clean verify

.github/workflows/release-please.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ jobs:
1919
if: ${{ steps.release.outputs.releases_created }}
2020
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2121

22-
- name: Set up JDK 8
22+
- name: Set up JDK 17
2323
if: ${{ steps.release.outputs.releases_created }}
2424
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4
2525
with:
26-
java-version: '8'
26+
java-version: '17'
2727
distribution: 'temurin'
2828
cache: maven
2929
server-id: ossrh

checkstyle.xml

+36-44
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,23 @@
2828
<module name="BeforeExecutionExclusionFileFilter">
2929
<property name="fileNamePattern" value="module\-info\.java$"/>
3030
</module>
31-
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
31+
32+
<module name="SuppressWarningsFilter"/>
33+
34+
<!-- https://checkstyle.org/filters/suppressionfilter.html -->
3235
<module name="SuppressionFilter">
33-
<property name="file" value="checkstyle-suppressions.xml" />
36+
<property name="file" value="${org.checkstyle.google.suppressionfilter.config}"
37+
default="checkstyle-suppressions.xml" />
3438
<property name="optional" value="true"/>
3539
</module>
3640

3741
<!-- https://checkstyle.org/filters/suppresswithnearbytextfilter.html -->
38-
<!--<module name="SuppressWithNearbyTextFilter">
42+
<module name="SuppressWithNearbyTextFilter">
3943
<property name="nearbyTextPattern"
4044
value="CHECKSTYLE.SUPPRESS\: (\w+) for ([+-]\d+) lines"/>
4145
<property name="checkPattern" value="$1"/>
4246
<property name="lineRange" value="$2"/>
43-
</module>-->
47+
</module>
4448

4549
<!-- Checks for whitespace -->
4650
<!-- See http://checkstyle.org/checks/whitespace/index.html -->
@@ -51,27 +55,11 @@
5155
<module name="LineLength">
5256
<property name="fileExtensions" value="java"/>
5357
<property name="max" value="120"/>
54-
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
58+
<property name="ignorePattern"
59+
value="^package.*|^import.*|href\s*=\s*&quot;[^&quot;]*&quot;|http://|https://|ftp://"/>
5560
</module>
5661

57-
<module name="SuppressWarningsFilter" />
58-
5962
<module name="TreeWalker">
60-
<!-- needed for SuppressWarningsFilter -->
61-
<module name="SuppressWarningsHolder" />
62-
63-
<module name="SuppressWarnings">
64-
<property name="id" value="checkstyle:suppresswarnings"/>
65-
</module>
66-
67-
<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
68-
<module name="SuppressionXpathFilter">
69-
<property name="file" value="${org.checkstyle.google.suppressionxpathfilter.config}"
70-
default="checkstyle-xpath-suppressions.xml" />
71-
<property name="optional" value="true"/>
72-
</module>
73-
74-
<module name="UnusedImports"/>
7563
<module name="OuterTypeFilename"/>
7664
<module name="IllegalTokenText">
7765
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
@@ -98,26 +86,26 @@
9886
<property name="id" value="LeftCurlyEol"/>
9987
<property name="tokens"
10088
value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF,
101-
INTERFACE_DEF, LITERAL_CATCH,
102-
LITERAL_DO, LITERAL_ELSE, LITERAL_FOR, LITERAL_IF,
103-
LITERAL_WHILE, METHOD_DEF,
89+
INTERFACE_DEF, LAMBDA, LITERAL_CATCH,
90+
LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF,
91+
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF,
10492
OBJBLOCK, STATIC_INIT, RECORD_DEF, COMPACT_CTOR_DEF"/>
10593
</module>
10694
<module name="LeftCurly">
10795
<property name="id" value="LeftCurlyNl"/>
10896
<property name="option" value="nl"/>
10997
<property name="tokens"
110-
value=" LITERAL_DEFAULT"/>
98+
value="LITERAL_CASE, LITERAL_DEFAULT"/>
11199
</module>
112100
<module name="SuppressionXpathSingleFilter">
113-
<!-- LITERAL_DEFAULT are reused in SWITCH_RULE -->
101+
<!-- LITERAL_CASE, LITERAL_DEFAULT are reused in SWITCH_RULE -->
114102
<property name="id" value="LeftCurlyNl"/>
115103
<property name="query" value="//SWITCH_RULE/SLIST"/>
116104
</module>
117105
<module name="RightCurly">
118106
<property name="id" value="RightCurlySame"/>
119107
<property name="tokens"
120-
value="LITERAL_IF, LITERAL_ELSE,
108+
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_IF, LITERAL_ELSE,
121109
LITERAL_DO"/>
122110
</module>
123111
<module name="RightCurly">
@@ -126,7 +114,7 @@
126114
<property name="tokens"
127115
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
128116
INSTANCE_INIT, ANNOTATION_DEF, ENUM_DEF, INTERFACE_DEF, RECORD_DEF,
129-
COMPACT_CTOR_DEF"/>
117+
COMPACT_CTOR_DEF, LITERAL_SWITCH, LITERAL_CASE, LITERAL_FINALLY"/>
130118
</module>
131119
<module name="SuppressionXpathSingleFilter">
132120
<!-- suppression is required till https://github.com/checkstyle/checkstyle/issues/7541 -->
@@ -136,26 +124,28 @@
136124
</module>
137125
<module name="WhitespaceAfter">
138126
<property name="tokens"
139-
value="COMMA, SEMI, TYPECAST, LITERAL_IF, LITERAL_ELSE,
140-
LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, DO_WHILE"/>
127+
value="COMMA, SEMI, TYPECAST, LITERAL_IF, LITERAL_ELSE, LITERAL_RETURN,
128+
LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, LITERAL_FINALLY, DO_WHILE, ELLIPSIS,
129+
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_CATCH, LAMBDA,
130+
LITERAL_YIELD, LITERAL_CASE, LITERAL_WHEN"/>
141131
</module>
142132
<module name="WhitespaceAround">
143133
<property name="allowEmptyConstructors" value="true"/>
144134
<property name="allowEmptyLambdas" value="true"/>
145135
<property name="allowEmptyMethods" value="true"/>
146136
<property name="allowEmptyTypes" value="true"/>
147137
<property name="allowEmptyLoops" value="true"/>
148-
<!--<property name="allowEmptySwitchBlockStatements" value="true"/>-->
138+
<property name="allowEmptySwitchBlockStatements" value="true"/>
149139
<property name="ignoreEnhancedForColon" value="false"/>
150140
<property name="tokens"
151141
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR,
152-
BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAND,
153-
LCURLY, LE, LITERAL_DO, LITERAL_ELSE,
154-
LITERAL_FOR, LITERAL_IF,
155-
LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN,
142+
BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAMBDA, LAND,
143+
LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY,
144+
LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED,
145+
LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN,
156146
NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR,
157147
SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT,
158-
TYPE_EXTENSION_AND"/>
148+
TYPE_EXTENSION_AND, LITERAL_WHEN"/>
159149
<message key="ws.notFollowed"
160150
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks
161151
may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
@@ -319,7 +309,7 @@
319309
</module>
320310
<module name="NoWhitespaceBeforeCaseDefaultColon"/>
321311
<module name="OverloadMethodsDeclarationOrder"/>
322-
<!--<module name="ConstructorsDeclarationGrouping"/>-->
312+
<module name="ConstructorsDeclarationGrouping"/>
323313
<module name="VariableDeclarationUsageDistance"/>
324314
<module name="CustomImportOrder">
325315
<property name="sortImportsInGroupAlphabetically" value="true"/>
@@ -329,8 +319,8 @@
329319
</module>
330320
<module name="MethodParamPad">
331321
<property name="tokens"
332-
value="CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF,
333-
SUPER_CTOR_CALL, ENUM_CONSTANT_DEF"/>
322+
value="CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF, CTOR_CALL,
323+
SUPER_CTOR_CALL, ENUM_CONSTANT_DEF, RECORD_DEF, RECORD_PATTERN_DEF"/>
334324
</module>
335325
<module name="NoWhitespaceBefore">
336326
<property name="tokens"
@@ -340,10 +330,11 @@
340330
</module>
341331
<module name="ParenPad">
342332
<property name="tokens"
343-
value="ANNOTATION, ANNOTATION_FIELD_DEF, CTOR_DEF, DOT, ENUM_CONSTANT_DEF,
344-
EXPR, LITERAL_DO, LITERAL_FOR, LITERAL_IF, LITERAL_NEW,
345-
LITERAL_WHILE, METHOD_CALL,
346-
METHOD_DEF, QUESTION, RESOURCE_SPECIFICATION, SUPER_CTOR_CALL"/>
333+
value="ANNOTATION, ANNOTATION_FIELD_DEF, CTOR_CALL, CTOR_DEF, DOT, ENUM_CONSTANT_DEF,
334+
EXPR, LITERAL_CATCH, LITERAL_DO, LITERAL_FOR, LITERAL_IF, LITERAL_NEW,
335+
LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_WHILE, METHOD_CALL,
336+
METHOD_DEF, QUESTION, RESOURCE_SPECIFICATION, SUPER_CTOR_CALL, LAMBDA,
337+
RECORD_DEF, RECORD_PATTERN_DEF"/>
347338
</module>
348339
<module name="OperatorWrap">
349340
<property name="option" value="NL"/>
@@ -371,6 +362,7 @@
371362
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
372363
</module>
373364
<module name="JavadocParagraph">
365+
<property name="allowNewlineParagraph" value="false"/>
374366
</module>
375367
<module name="RequireEmptyLineBeforeBlockTagGroup"/>
376368
<module name="AtclauseOrder">

0 commit comments

Comments
 (0)