JSP referring custom tag: Unresolved imports/types

  • ALM used: GitHub
  • CI system used: Jenkins
  • Scanner command used:
mvn -X -Duser.home=.home org.sonarsource.scanner.maven:sonar-maven-plugin:sonar --batch-mode ...
  • Languages of the repository: Java, JSP, JS
  • Error observed
[WARNING] 15:08:30.510 Unresolved imports/types have been detected during analysis. Enable DEBUG mode to see them.
[DEBUG] 15:08:30.510 Unresolved imports/types:
- org.apache.jsp.tag cannot be resolved to a type
  * <pathtodir>/target/sonar/jsp/org/apache/jsp/WEB_002dINF/views/sonar_jsp.java
  • Steps to reproduce

Create 2 files

sonar.jsp

<%@ taglib prefix="t" tagdir="/WEB-INF/tags"%>

<t:sonartemplate>test content</t:sonartemplate>

sonartemplate.tag

<!DOCTYPE html>
<%@ tag language="java" description="Template to reproduce Sonar JSP issue"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	</head>
	<body>
		<jsp:doBody/>
	</body>
</html>

Extra details:
The compiled jsp in the target/sonar directory has lines

    //  t:sonartemplate
    org.apache.jsp.tag.web.sonartemplate_tag _jspx_th_t_005fsonartemplate_005f0 = new org.apache.jsp.tag.web.sonartemplate_tag();

The compiled tag is also existing in the target/sonar directory but maybe not added to the sonar analyzer properly.