添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

tool:SonarQube Scanner 3.2

Wish to exclude some packages from sonar code Coverage where sonar is part of build pipeline of jenkins

Ways tried (for now added all files under the package mentioned just to check if it really excludes all java file !)
pom.xml
<sonar.coverage.exclusions>com/**/ </sonar.coverage.exclusions>
B:<sonar.exclusions> {project.basedir}/src/main/java/com/ept/scheduleinterface/dto/**/*, {project/basedir}/src/main/java/com/test/aa//model/
</sonar.exclusions>

jenkinsfile
sonar: [projectKey: PROJECT_NAME, ‘java.libraries’:
‘/root/.m2/repository/org/projectlombok/lombok/ /lombok- .jar’, ‘sonar.coverage.exclusions’: 'src/main/java/com/ / ’**],
’-Dsonar.coverage.exclusions’: 'src/main/java/com/ /
’]**
’-Dsonar.coverage.exclusions’: 'com/ /*’]**,

in my project structure there is a jenkinsfile and pom.xml file along with dockerfile

But it looks is sonar is not obeying the configuration at all.
Also I can see in jenkins console logs the changes I did in e.g. jenkins file are considered
Running shell script
‘-Dsonar.java.libraries=/root/.m2/repository/org/projectlombok/lombok/ /lombok- .jar’ ‘-Dsonar.sonar.coverage.exclusions=src/main/java/com/**/*’ -Dsonar.sources=src -Dsonar.java.binaries=target/classes -Dsonar.jacoco.reportPaths=target/jacoco.exec -