|
119 | 119 | <!-- Coverage floors; each module overrides them with its own (see the JaCoCo plugin) --> |
120 | 120 | <jacoco.minimum.line>1.00</jacoco.minimum.line> |
121 | 121 | <jacoco.minimum.branch>1.00</jacoco.minimum.branch> |
| 122 | + <!-- A module whose JDK 21 build runs code JDK 17 cannot (virtual threads) declares |
| 123 | + higher floors for it; otherwise JDK 21 checks the same floors. --> |
| 124 | + <jacoco.jdk21.minimum.line>${jacoco.minimum.line}</jacoco.jdk21.minimum.line> |
| 125 | + <jacoco.jdk21.minimum.branch>${jacoco.minimum.branch}</jacoco.jdk21.minimum.branch> |
| 126 | + <!-- The floors the gate checks on this JDK (the coverage-jdk21 profile switches them) --> |
| 127 | + <jacoco.gate.line>${jacoco.minimum.line}</jacoco.gate.line> |
| 128 | + <jacoco.gate.branch>${jacoco.minimum.branch}</jacoco.gate.branch> |
122 | 129 | <owasp.version>13.0.0</owasp.version> |
123 | 130 | <cyclonedx-maven-plugin.version>2.9.3</cyclonedx-maven-plugin.version> |
124 | 131 | <maven-pmd-plugin.version>3.28.0</maven-pmd-plugin.version> |
|
531 | 538 | (integration-testing/) is outside the Maven build and is not counted. |
532 | 539 |
|
533 | 540 | The gate (check, in verify) fails when a module's LINE or BRANCH covered ratio |
534 | | - falls below its floor. Every module declares jacoco.minimum.line and |
| 541 | + falls below its floor. CI builds on JDK 17 and on JDK 21, and a module may cover |
| 542 | + more on JDK 21, where its virtual-thread code runs: such a module also declares |
| 543 | + jacoco.jdk21.minimum.line and jacoco.jdk21.minimum.branch, which the JDK 21 |
| 544 | + build checks instead (the coverage-jdk21 profile); without them JDK 21 checks |
| 545 | + the same floors. Measure a floor on both JDKs: the JDK 17 one from the JDK 17 |
| 546 | + build, the JDK 21 one from the JDK 21 build, and a shared floor from the lower. Every module declares jacoco.minimum.line and |
535 | 547 | jacoco.minimum.branch; the default below is full coverage, so a new module |
536 | 548 | fails until it declares measured floors. A floor is the coverage measured from a clean verify less a margin of |
537 | 549 | 2 points, rounded down to a whole percent: enough for the run-to-run variation |
|
586 | 598 | <limit> |
587 | 599 | <counter>LINE</counter> |
588 | 600 | <value>COVEREDRATIO</value> |
589 | | - <minimum>${jacoco.minimum.line}</minimum> |
| 601 | + <minimum>${jacoco.gate.line}</minimum> |
590 | 602 | </limit> |
591 | 603 | <limit> |
592 | 604 | <counter>BRANCH</counter> |
593 | 605 | <value>COVEREDRATIO</value> |
594 | | - <minimum>${jacoco.minimum.branch}</minimum> |
| 606 | + <minimum>${jacoco.gate.branch}</minimum> |
595 | 607 | </limit> |
596 | 608 | </limits> |
597 | 609 | </rule> |
|
622 | 634 | </build> |
623 | 635 |
|
624 | 636 | <profiles> |
| 637 | + <!-- The coverage gate's JDK 21 floors (see the JaCoCo plugin). --> |
| 638 | + <profile> |
| 639 | + <id>coverage-jdk21</id> |
| 640 | + <activation> |
| 641 | + <jdk>[21,)</jdk> |
| 642 | + </activation> |
| 643 | + <properties> |
| 644 | + <jacoco.gate.line>${jacoco.jdk21.minimum.line}</jacoco.gate.line> |
| 645 | + <jacoco.gate.branch>${jacoco.jdk21.minimum.branch}</jacoco.gate.branch> |
| 646 | + </properties> |
| 647 | + </profile> |
625 | 648 | <!-- Error Prone: Error Prone's own bug checks and NullAway, at ERROR, on main sources. |
626 | 649 | Error Prone 2.50 runs only on JDK 21+, while the SDK targets Java 17 and its |
627 | 650 | release build runs on JDK 17, so the profile activates by JDK: every build on |
|
0 commit comments