I recently worked on an existing project in Eclipse. It looks like the JSPs cannot resolve the variables such as xssAPI, i18n, sling although <%@include file="/libs/granite/ui/global.jsp"%> is included in the JSPs and I can find these global variables are defined in global.jsp. See below.
In the pom.xml, I use the uber-jar
Do I miss something? How can I fix this issue? Of course, I can remove the red X by disabling JSP Syntax Check in Preferences -> Validations, but that is not what I want.
You need to include these included JSPs in your IDE as well. I think I read once about how to do it, but that's been a while, and I don't have the reference anymore. You might want to think about migrating your overlay to HTL and Sling Models 🙂
Could you explain more about "include these inclued JSPs in the IDE as well"? In each JSP that uses these variables, the first line is <%@include file="/libs/wcm/global.jsp"%>, so global.jsp is already includes in the JSPs. In my understanding, based on the maven dependence, The JSPs in Eclipse should be able to recognize these variables, right?
No, the JSPs are not part of the AEM uber.jar. What you could do: Export the complete /libs path (probably you need much less, but just to be on the safe side), and place it somewhere on your local filesystem.
And then add the jcr:content/ to the build path of your Eclipse project (do not include it in your content package!!!); that should do the trick.
The maven building is ok. There is no error for JSPs when building and deploying, The built package that includes the JSPs can run well in the website. The issue just is it shows error flat - red X within Eclipse in the JSPs that use the variables.
BTW, how to add jcr:content to the build path? are you talking about java build path? I can see all the libs there. see the pic.