Skip to content

Commit 76fb834

Browse files
psxjoytisonkun
andauthored
chore: update pom.xml for improved formatting and add JDK 8+ profile (#432)
* chore: update pom.xml for improved formatting and add JDK 9+ profile * chore: update pom.xml for improved formatting and add JDK 9+ profile * chore: update pom.xml to use variable for argLine configuration * chore: update pom.xml to use variable for argLine configuration * chore: update pom.xml to use variable for argLine configuration * chore: update pom.xml to skip tests and add file encoding to surefireArgLine * chore: update pom.xml to enable tests and modify JDK profiles * chore: update pom.xml to enable tests and modify JDK profiles * Apply suggestion from @tisonkun Co-authored-by: tison <[email protected]> * Apply suggestion from @tisonkun Co-authored-by: tison <[email protected]> --------- Co-authored-by: tison <[email protected]>
1 parent c82e999 commit 76fb834

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ jobs:
5555
restore-keys: |
5656
${{ runner.os }}-m2
5757
- name: Test with Maven
58-
if: ${{ matrix.java == '8' }}
5958
run: ./mvnw test -B -Dmaven.test.skip=false
60-
- name: Test with Maven
61-
if: ${{ matrix.java != '8' }}
62-
run: ./mvnw test -B -Dmaven.test.skip=false -DargLine="--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/sun.reflect.annotation=ALL-UNNAMED"
6359
- name: Publish Unit Test Results
6460
uses: EnricoMi/publish-unit-test-result-action@v2
6561
if: (!cancelled())

pom.xml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@
228228
<artifactId>maven-surefire-plugin</artifactId>
229229
<version>${maven-surefire-plugin.version}</version>
230230
<configuration>
231-
<argLine>${argLine} -Dfile.encoding=UTF-8</argLine>
231+
<argLine>
232+
${argLine} ${surefireArgLine}
233+
</argLine>
232234
</configuration>
233235
<!-- please add below configuration if you are using JDK 9 or higher-->
234236
<!-- <configuration>-->
@@ -413,8 +415,8 @@
413415
</indent>
414416
</java>
415417
<pom>
416-
<trimTrailingWhitespace />
417-
<endWithNewline />
418+
<trimTrailingWhitespace/>
419+
<endWithNewline/>
418420
<indent>
419421
<spaces>true</spaces>
420422
<spacesPerTab>4</spacesPerTab>
@@ -445,4 +447,24 @@
445447
</plugin>
446448
</plugins>
447449
</build>
450+
<profiles>
451+
<profile>
452+
<id>jdk9plus</id>
453+
<activation>
454+
<jdk>[9,)</jdk>
455+
</activation>
456+
<properties>
457+
<surefireArgLine>--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/sun.reflect.annotation=ALL-UNNAMED -Dfile.encoding=UTF-8</surefireArgLine>
458+
</properties>
459+
</profile>
460+
<profile>
461+
<id>jdk8</id>
462+
<activation>
463+
<jdk>1.8</jdk>
464+
</activation>
465+
<properties>
466+
<surefireArgLine> -Dfile.encoding=UTF-8</surefireArgLine>
467+
</properties>
468+
</profile>
469+
</profiles>
448470
</project>

0 commit comments

Comments
 (0)