Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

missing scripting variables

Avatar

Level 4

I have set up a CQ5 project in IntelliJ, but there's one thing that's still missing. I'm using the CQ taglib and cq:defineObjects:

<%@taglib prefix="cq" uri="http://www.day.com/taglibs/cq/1.0" %>

<cq:defineObjects />

All the needed JARs are included and all imports, taglibs etc. look good.

However, when I try to use the defined scripting variables (slingRequest, currentPage, resource etc.) IntelliJ is unable to resolve them.

Any ideas on what to do?

1 Reply

Avatar

Level 10

Looks like you are missing some dependencies. Read this document's section: 

Prepare for JSP support in IntelliJ IDE 

 

Modify the POM file located at C:\AdobeCQ\echoproject\content to add support for JSP compilation in IntelliJ. The Maven setup described so far creates a content package that can also include components and their corresponding JSPs. However, Maven treats them as any other file that is part of the content package and does not even recognize them as JSPs.

The resulting components work in AEM all the same, but making Maven aware of the JSPs has two major benefits:

  • It allows Maven to fail if the JSPs contain errors, so that these are surfaced at build time and not when they are first compiled in AEM
  • For IDEs that can import Maven projects, this also enables code completion and tag library support in the JSPs