JSP Analysis causes maven build failure


(Andy Elliott) #1

Today we are having builds fail in our CI environment that were successfully built previously. The error is related to JSP and is as follows:-

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.1.1168:sonar (default-cli) on project [DELETED_PROJECT_NAME]: Language of file 'path/to/home.jsp' can not be decided as the file matches patterns of both sonar.lang.patterns.web : **/*.html,**/*.xhtml,**/*.jspf,**/*.jspx,**/*.cshtml,**/*.vbhtml,**/*.aspx,**/*.ascx,**/*.rhtml,**/*.erb,**/*.shtm,**/*.shtml,**/*.jsp and sonar.lang.patterns.jsp : **/*.jsp,**/*.jspf,**/*.jspx -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.1.1168:sonar (default-cli) on project mobility-server: Language of file 'path/to/home.jsp' can not be decided as the file matches patterns of both sonar.lang.patterns.web : **/*.html,**/*.xhtml,**/*.jspf,**/*.jspx,**/*.cshtml,**/*.vbhtml,**/*.aspx,**/*.ascx,**/*.rhtml,**/*.erb,**/*.shtm,**/*.shtml,**/*.jsp and sonar.lang.patterns.jsp : **/*.jsp,**/*.jspf,**/*.jspx

The analysis was being done by simply calling sonar:sonar without specifying a version but I also tried it by specifying an older version of Sonar scanner because I had noticed there was a new release of the scanner made a few days ago and assumed this was the issue but we get the same error even with older versions.

The source file referred to in the error report is an old file and hasn’t been modified in over 6 months.

If anyone has any ideas what could be causing this I’d appreciate the help.

Thanks, Andy.


(Andy Elliott) #2

I’m assuming this is the same issue? Language of file can not be decided


(Fabrice Bellingard) #3

Yes it is, and it’s fixed.