Ignore test cases while running maven project with sonar

17,612

Solution 1

Found the solution, added -DskipTests=true with maven command.

The full command which works for me is :

mvn clean install -DskipTests=true -Dmaven.test.failure.ignore=true sonar:sonar
-Dsonar.database=mysql
-Dsonar.jdbc.driver=com.mysql.jdbc.Driver -Dsonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8

Solution 2

mvn sonar:sonar -Dmaven.test.skip=true

is also an option, but make sure that your unit tests ran before to have results for unit test coverage in sonar

Share:
17,612
Nirmal
Author by

Nirmal

Java, J2EE(Spring, Struts2, Hibernate, Grails, Tapestry)

Updated on June 17, 2022

Comments

  • Nirmal
    Nirmal almost 2 years

    I have installed sonar and trying to analyze maven based application using following command :

    clean install -Dmaven.test.skip=true -Psonar  sonar:sonar
    

    still its executing test-cases.

    What if I doesn't want the analysis of unit test cases?