3

I have a project in spring-boot java and on doing the sonarqube analysis of the code, javadoc errors are not detected.

The issue occurs during maven release when there is an error in javadoc the release build fails to build the javadoc jars and the release is interrupted.

   /**
     * Method to calculate the sum.
     * 
     * @param numberOne
     *            First number.
     * @param numberTwo
     *            Second number.  
     * @return sum of numbers.
     */
    public void sumCalculate(int numOne, int numTwo) {
        // code here
    }

In the above code, the parameter names given in javadoc with @param are different from the actual one and the @return statement is not actually required. But sonar qube doesnot report any of these issues in the analysis.

Kindly guide me how to solve this? Is there any custom rule to be made?

Thanks

Usman Khan
  • 3,052
  • 4
  • 30
  • 76
Jerrin Thomas
  • 204
  • 1
  • 11

1 Answers1

0

Finally I was able to solve this issue. After a lot of digging, i found a jira ticket (ticket link) for this particular issue. I tried searching through the java rules in sonar and was able to find it. For me, by default, it was not enabled. So had to create a new Sonar Gateway and add my java project to use this gateway and then enable this rule for the newly created gateway. Cheers.

Jerrin Thomas
  • 204
  • 1
  • 11