У меня есть проект с открытым исходным кодом Java / Maven с охватом sonarcloud. Мой CI / CD - Travis-ci, а мой источник кода - Github.
https://github.com/NoraUi/NoraUi
До 18 de c 2020 моя конфигурация surfire и jacoco Хорошо, но после изменения sonarcloud и моего покрытия кода для моего проекта не работает.
My pom. xml: https://github.com/NoraUi/NoraUi/blob/master/pom.xml
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<jacoco-maven-plugin.version>0.8.5</jacoco-maven-plugin.version>
<sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
<project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory>
<sonar.sources>${project.basedir}/src/main/java/</sonar.sources>
<sonar.junit.reportPaths>${project.build.directory}/surefire-reports/junit</sonar.junit.reportPaths>
<sonar.surefire.reportPaths>${project.build.directory}/surefire-reports</sonar.surefire.reportPaths>
<sonar.jacoco.directory>${project.testresult.directory}/coverage/jacoco</sonar.jacoco.directory>
<sonar.jacoco.reportPath>${sonar.jacoco.directory}/jacoco.exec</sonar.jacoco.reportPath>
<sonar.tests>${project.basedir}/src/test/</sonar.tests>
<sonar.sourceEncoding>UTF-8</sonar.sourceEncoding>
<sonar.exclusions>**/cucumber/**/*,**/*Exception.*,**/annotation/**/*,**/noraui/model/**/*,**/noraui/data/rest/Row.java,**/noraui/utils/Constants.java,**/noraui/application/steps/MailSteps.java</sonar.exclusions>
<sonar.test.exclusions>**/*.css</sonar.test.exclusions>
<profile>
<id>unit-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>pre-unit-tests</id>
<phase>compile</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${sonar.jacoco.reportPath}</destFile>
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${sonar.jacoco.reportPath}</dataFile>
<outputDirectory>${sonar.jacoco.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<resourcespath>${ciToolResourcesPath}</resourcespath>
<cucumber.options>${cucumber.options}</cucumber.options>
<webdriver.ie.driver>src/test/resources/drivers/%s/internetexplorer/%s/IEDriverServer%s</webdriver.ie.driver>
<webdriver.chrome.driver>src/test/resources/drivers/%s/googlechrome/%s/chromedriver%s</webdriver.chrome.driver>
<webdriver.gecko.driver>src/test/resources/drivers/%s/firefox/%s/geckodriver%s</webdriver.gecko.driver>
<SpeedRegulator.annotation.enable>false</SpeedRegulator.annotation.enable>
<SpeedRegulators.annotation.enable>false</SpeedRegulators.annotation.enable>
<Time.annotation.enable>false</Time.annotation.enable>
<Times.annotation.enable>false</Times.annotation.enable>
<uid>${uid}</uid>
<password>${password}</password>
<cookie>${cookie}</cookie>
<role>${role}</role>
</systemPropertyVariables>
<includes>
<include>**/*UT.java</include>
<include>**/Runner.java</include>
</includes>
<argLine>-Dfile.encoding=UTF-8 ${surefireArgLine}</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar-maven-plugin.version}</version>
</plugin>
</plugins>
</build>
</profile>
Я пытаюсь несколько изменений, но снова не работают.
Я пытаюсь добавить это:
sonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml