|
104 | 104 | <maven.sevntu.checkstyle.plugin.checkstyle.version> |
105 | 105 | 8.28 |
106 | 106 | </maven.sevntu.checkstyle.plugin.checkstyle.version> |
| 107 | + <maven.jacoco.plugin.version>0.8.5</maven.jacoco.plugin.version> |
107 | 108 | <java.version>1.8</java.version> |
108 | 109 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
109 | 110 | <!-- we disable ITs by default as it need download of 200MB sonar application jar --> |
|
240 | 241 | <version>1.9.7</version> |
241 | 242 | <scope>test</scope> |
242 | 243 | </dependency> |
| 244 | + <dependency> |
| 245 | + <groupId>org.jacoco</groupId> |
| 246 | + <artifactId>org.jacoco.agent</artifactId> |
| 247 | + <version>${maven.jacoco.plugin.version}</version> |
| 248 | + <classifier>runtime</classifier> |
| 249 | + <scope>test</scope> |
| 250 | + </dependency> |
243 | 251 | <dependency> |
244 | 252 | <groupId>com.puppycrawl.tools</groupId> |
245 | 253 | <artifactId>checkstyle</artifactId> |
|
321 | 329 | <artifactId>maven-surefire-plugin</artifactId> |
322 | 330 | <version>2.22.1</version> |
323 | 331 | <configuration> |
| 332 | + <systemPropertyVariables> |
| 333 | + <jacoco-agent.destfile>${project.build.directory}/jacoco.exec</jacoco-agent.destfile> |
| 334 | + </systemPropertyVariables> |
324 | 335 | <includes> |
325 | 336 | <include>org/sonar/**/*.java</include> |
326 | 337 | </includes> |
|
483 | 494 | </executions> |
484 | 495 | </plugin> |
485 | 496 | <plugin> |
486 | | - <groupId>org.codehaus.mojo</groupId> |
487 | | - <artifactId>cobertura-maven-plugin</artifactId> |
488 | | - <version>2.7</version> |
489 | | - <configuration> |
490 | | - <formats> |
491 | | - <format>xml</format> |
492 | | - <format>html</format> |
493 | | - </formats> |
494 | | - <check> |
495 | | - <haltOnFailure>true</haltOnFailure> |
496 | | - <branchRate>100</branchRate> |
497 | | - <lineRate>100</lineRate> |
498 | | - <totalBranchRate>82</totalBranchRate> |
499 | | - <totalLineRate>96</totalLineRate> |
500 | | - <regexes> |
501 | | - <regex> |
502 | | - <pattern>org.sonar.plugins.checkstyle.CheckstyleAuditListener</pattern> |
503 | | - <branchRate>71</branchRate> |
504 | | - <lineRate>86</lineRate> |
505 | | - </regex> |
506 | | - <regex> |
507 | | - <pattern>org.sonar.plugins.checkstyle.CheckstyleConfiguration</pattern> |
508 | | - <branchRate>60</branchRate> |
509 | | - <lineRate>93</lineRate> |
510 | | - </regex> |
511 | | - <regex> |
512 | | - <pattern>org.sonar.plugins.checkstyle.CheckstyleProfileExporter</pattern> |
513 | | - <branchRate>87</branchRate> |
514 | | - <lineRate>97</lineRate> |
515 | | - </regex> |
516 | | - <regex> |
517 | | - <pattern>org.sonar.plugins.checkstyle.CheckstyleProfileImporter</pattern> |
518 | | - <branchRate>96</branchRate> |
519 | | - <lineRate>100</lineRate> |
520 | | - </regex> |
521 | | - <regex> |
522 | | - <pattern>org.sonar.plugins.checkstyle.CheckstyleRulesDefinition</pattern> |
523 | | - <branchRate>35</branchRate> |
524 | | - <lineRate>90</lineRate> |
525 | | - </regex> |
526 | | - <regex> |
527 | | - <pattern>org.sonar.plugins.checkstyle.CheckstyleSensor</pattern> |
528 | | - <branchRate>100</branchRate> |
529 | | - <lineRate>87</lineRate> |
530 | | - </regex> |
531 | | - <regex> |
532 | | - <pattern>org.sonar.plugins.checkstyle.CheckstyleSeverityUtils</pattern> |
533 | | - <branchRate>75</branchRate> |
534 | | - <lineRate>96</lineRate> |
535 | | - </regex> |
536 | | - </regexes> |
537 | | - </check> |
538 | | - </configuration> |
| 497 | + <groupId>org.jacoco</groupId> |
| 498 | + <artifactId>jacoco-maven-plugin</artifactId> |
| 499 | + <version>${maven.jacoco.plugin.version}</version> |
539 | 500 | <executions> |
540 | 501 | <execution> |
| 502 | + <id>default-instrument</id> |
| 503 | + <goals> |
| 504 | + <goal>instrument</goal> |
| 505 | + </goals> |
| 506 | + <phase>test-compile</phase> |
| 507 | + </execution> |
| 508 | + <execution> |
| 509 | + <id>default-restore-instrumented-classes</id> |
| 510 | + <goals> |
| 511 | + <goal>restore-instrumented-classes</goal> |
| 512 | + </goals> |
| 513 | + </execution> |
| 514 | + <execution> |
| 515 | + <id>default-report</id> |
| 516 | + <phase>site</phase> |
| 517 | + <goals> |
| 518 | + <goal>report</goal> |
| 519 | + </goals> |
| 520 | + </execution> |
| 521 | + <execution> |
| 522 | + <id>default-check</id> |
541 | 523 | <goals> |
542 | 524 | <goal>check</goal> |
543 | 525 | </goals> |
| 526 | + <configuration> |
| 527 | + <rules> |
| 528 | + <rule> |
| 529 | + <element>CLASS</element> |
| 530 | + <excludes> |
| 531 | + <exclude>org.sonar.plugins.checkstyle.CheckstyleRulesDefinition</exclude> |
| 532 | + <exclude>org.sonar.plugins.checkstyle.CheckstyleAuditListener</exclude> |
| 533 | + <exclude>org.sonar.plugins.checkstyle.CheckstyleProfileExporter</exclude> |
| 534 | + <exclude>org.sonar.plugins.checkstyle.CheckstyleExecutor</exclude> |
| 535 | + <exclude>org.sonar.plugins.checkstyle.CheckstyleSeverityUtils</exclude> |
| 536 | + <exclude>org.sonar.plugins.checkstyle.CheckstyleConfiguration</exclude> |
| 537 | + <exclude>org.sonar.plugins.checkstyle.CheckstyleProfileImporter</exclude> |
| 538 | + </excludes> |
| 539 | + <limits> |
| 540 | + <limit> |
| 541 | + <counter>LINE</counter> |
| 542 | + <value>COVEREDRATIO</value> |
| 543 | + <minimum>1.00</minimum> |
| 544 | + </limit> |
| 545 | + <limit> |
| 546 | + <counter>BRANCH</counter> |
| 547 | + <value>COVEREDRATIO</value> |
| 548 | + <minimum>1.00</minimum> |
| 549 | + </limit> |
| 550 | + </limits> |
| 551 | + </rule> |
| 552 | + <rule> |
| 553 | + <element>CLASS</element> |
| 554 | + <includes> |
| 555 | + <include>org.sonar.plugins.checkstyle.CheckstyleRulesDefinition</include> |
| 556 | + </includes> |
| 557 | + <limits> |
| 558 | + <limit> |
| 559 | + <counter>LINE</counter> |
| 560 | + <value>COVEREDRATIO</value> |
| 561 | + <minimum>0.89</minimum> |
| 562 | + </limit> |
| 563 | + <limit> |
| 564 | + <counter>BRANCH</counter> |
| 565 | + <value>COVEREDRATIO</value> |
| 566 | + <minimum>0.5</minimum> |
| 567 | + </limit> |
| 568 | + </limits> |
| 569 | + </rule> |
| 570 | + <rule> |
| 571 | + <element>CLASS</element> |
| 572 | + <includes> |
| 573 | + <include>org.sonar.plugins.checkstyle.CheckstyleAuditListener</include> |
| 574 | + </includes> |
| 575 | + <limits> |
| 576 | + <limit> |
| 577 | + <counter>LINE</counter> |
| 578 | + <value>COVEREDRATIO</value> |
| 579 | + <minimum>0.90</minimum> |
| 580 | + </limit> |
| 581 | + <limit> |
| 582 | + <counter>BRANCH</counter> |
| 583 | + <value>COVEREDRATIO</value> |
| 584 | + <minimum>0.78</minimum> |
| 585 | + </limit> |
| 586 | + </limits> |
| 587 | + </rule> |
| 588 | + <rule> |
| 589 | + <element>CLASS</element> |
| 590 | + <includes> |
| 591 | + <include>org.sonar.plugins.checkstyle.CheckstyleProfileExporter</include> |
| 592 | + </includes> |
| 593 | + <limits> |
| 594 | + <limit> |
| 595 | + <counter>LINE</counter> |
| 596 | + <value>COVEREDRATIO</value> |
| 597 | + <minimum>1.0</minimum> |
| 598 | + </limit> |
| 599 | + <limit> |
| 600 | + <counter>BRANCH</counter> |
| 601 | + <value>COVEREDRATIO</value> |
| 602 | + <minimum>0.91</minimum> |
| 603 | + </limit> |
| 604 | + </limits> |
| 605 | + </rule> |
| 606 | + <rule> |
| 607 | + <element>CLASS</element> |
| 608 | + <includes> |
| 609 | + <include>org.sonar.plugins.checkstyle.CheckstyleExecutor</include> |
| 610 | + </includes> |
| 611 | + <limits> |
| 612 | + <limit> |
| 613 | + <counter>LINE</counter> |
| 614 | + <value>COVEREDRATIO</value> |
| 615 | + <minimum>0.97</minimum> |
| 616 | + </limit> |
| 617 | + <limit> |
| 618 | + <counter>BRANCH</counter> |
| 619 | + <value>COVEREDRATIO</value> |
| 620 | + <minimum>1.0</minimum> |
| 621 | + </limit> |
| 622 | + </limits> |
| 623 | + </rule> |
| 624 | + <rule> |
| 625 | + <element>CLASS</element> |
| 626 | + <includes> |
| 627 | + <include>org.sonar.plugins.checkstyle.CheckstyleSeverityUtils</include> |
| 628 | + </includes> |
| 629 | + <limits> |
| 630 | + <limit> |
| 631 | + <counter>LINE</counter> |
| 632 | + <value>COVEREDRATIO</value> |
| 633 | + <minimum>1.0</minimum> |
| 634 | + </limit> |
| 635 | + <limit> |
| 636 | + <counter>BRANCH</counter> |
| 637 | + <value>COVEREDRATIO</value> |
| 638 | + <minimum>0.87</minimum> |
| 639 | + </limit> |
| 640 | + </limits> |
| 641 | + </rule> |
| 642 | + <rule> |
| 643 | + <element>CLASS</element> |
| 644 | + <includes> |
| 645 | + <include>org.sonar.plugins.checkstyle.CheckstyleConfiguration</include> |
| 646 | + </includes> |
| 647 | + <limits> |
| 648 | + <limit> |
| 649 | + <counter>LINE</counter> |
| 650 | + <value>COVEREDRATIO</value> |
| 651 | + <minimum>0.93</minimum> |
| 652 | + </limit> |
| 653 | + <limit> |
| 654 | + <counter>BRANCH</counter> |
| 655 | + <value>COVEREDRATIO</value> |
| 656 | + <minimum>0.8</minimum> |
| 657 | + </limit> |
| 658 | + </limits> |
| 659 | + </rule> |
| 660 | + <rule> |
| 661 | + <element>CLASS</element> |
| 662 | + <includes> |
| 663 | + <include>org.sonar.plugins.checkstyle.CheckstyleProfileImporter</include> |
| 664 | + </includes> |
| 665 | + <limits> |
| 666 | + <limit> |
| 667 | + <counter>LINE</counter> |
| 668 | + <value>COVEREDRATIO</value> |
| 669 | + <minimum>1.0</minimum> |
| 670 | + </limit> |
| 671 | + <limit> |
| 672 | + <counter>BRANCH</counter> |
| 673 | + <value>COVEREDRATIO</value> |
| 674 | + <minimum>0.96</minimum> |
| 675 | + </limit> |
| 676 | + </limits> |
| 677 | + </rule> |
| 678 | + </rules> |
| 679 | + </configuration> |
544 | 680 | </execution> |
545 | 681 | </executions> |
546 | 682 | </plugin> |
|
630 | 766 | <spotbugs.skip>true</spotbugs.skip> |
631 | 767 | <xml.skip>true</xml.skip> |
632 | 768 | <forbiddenapis.skip>true</forbiddenapis.skip> |
633 | | - <cobertura.skip>true</cobertura.skip> |
| 769 | + <jacoco.skip>true</jacoco.skip> |
634 | 770 | <maven.javadoc.skip>true</maven.javadoc.skip> |
635 | 771 | </properties> |
636 | 772 | </profile> |
|
0 commit comments