[ 
https://issues.apache.org/jira/browse/SLING-3512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13979529#comment-13979529
 ] 

Julian Sedding commented on SLING-3512:
---------------------------------------

Similar situation in Intellij IDEA. The tag seems to get resolved, but none of 
the "defined objects" are actually available in the JSP unless explicit 
dependencies to the o.a.sling.api, slf4j-api and (optionally) JCR are added. 
What's worse, there don't seem to be any error messages.

Declaring the three dependencies o.a.sling.api, slf4j-api and javax.jcr:jcr 
with {{scope=compile}} does indeed allow the <sling:defineObjects/> tag to be 
resolved.

The dependencies required for the IDE seem to coincide with the "uses" 
constraint of the Export-Package header of the jsp-taglib. The dependency to 
JCR is missing, because the implementation uses a String to identify the Node 
class in order to make it optional.

{code}
Export-Package: org.apache.sling.scripting.jsp.taglib;version="2.2.0"
    uses:="javax.servlet,javax.servlet.jsp,javax.servlet.jsp.tagext,
    org.apache.sling.api.adapter,org.apache.sling.api.resource"
{code}

Are there any concerns that changing the scope might have an undesired impact 
anywhere else? Otherwise, I very much support this change, as I know from 
experience how confusing the issue can be.

> All dependencies referenced from TEI classes should have "compile" scope
> ------------------------------------------------------------------------
>
>                 Key: SLING-3512
>                 URL: https://issues.apache.org/jira/browse/SLING-3512
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>    Affects Versions: Scripting JSP-Taglib 2.2.0
>            Reporter: Konrad Windszus
>
> Currently some classes which are referenced from TEI classes (e.g. 
> DefineObjectsTEI) cannot be resolved within an IDE, because the according 
> dependency is given with scope "provided". Since provided dependencies are 
> not evaluated if given in a transitive way [0], the classpath of the 
> referencing JSP does not necessarily contain those transitive dependencies, 
> but they are necessary for the TEI to be instanciated within the IDE.
> For example the DefineObjectsTEI references classes from org.apache.sling.api 
> and slf4j-api. Therefore both dependencies should have the "compile" scope.
> [0] - 
> http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to