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

Tobias Bocanegra commented on SLING-6925:
-----------------------------------------

added new flag: {{printCompilationReport}} which produces a detail report of 
what classes were used.

example output:

{noformat}
[INFO] JSP compilation report:

Package                                                               Dependency
---------------------------------------------------------------
java.io                                                               n/a
java.lang                                                             n/a
java.util                                                             n/a
javax.jcr                                                             
javax.jcr:jcr:jar:2.0
javax.jcr.security                                                    
javax.jcr:jcr:jar:2.0
javax.servlet                                                         
javax.servlet:servlet-api:jar:2.5
javax.servlet.jsp                                                     
javax.servlet.jsp:jsp-api:jar:2.1
javax.servlet.jsp.jstl.core                                           
javax.servlet:jstl:jar:1.2
javax.servlet.jsp.tagext                                              
javax.servlet.jsp:jsp-api:jar:2.1
javax.xml.parsers                                                     n/a
org.apache.commons.codec.binary                                       
commons-codec:commons-codec:jar:1.10, 
org.apache.sling:org.apache.sling.auth.core:jar:1.1.4
org.apache.commons.collections                                        
commons-collections:commons-collections:jar:3.2.2
org.apache.commons.collections.iterators                              
commons-collections:commons-collections:jar:3.2.2
org.apache.commons.lang                                               
commons-lang:commons-lang:jar:2.5
org.apache.jackrabbit                                                 
org.apache.jackrabbit:jackrabbit-jcr-commons:jar:2.3.2
org.apache.jackrabbit.api                                             
org.apache.jackrabbit:jackrabbit-api:jar:2.3.5
org.apache.jackrabbit.api.security.principal                          
org.apache.jackrabbit:jackrabbit-api:jar:2.3.5
org.apache.jackrabbit.api.security.user                               
org.apache.jackrabbit:jackrabbit-api:jar:2.3.5
org.apache.jackrabbit.commons.jackrabbit.user                         
org.apache.jackrabbit:jackrabbit-jcr-commons:jar:2.3.2
org.apache.jackrabbit.util                                            
org.apache.jackrabbit:jackrabbit-jcr-commons:jar:2.3.2
org.apache.sling.api                                                  
org.apache.sling:org.apache.sling.api:jar:2.7.0
org.apache.sling.api.resource                                         
org.apache.sling:org.apache.sling.api:jar:2.7.0
org.apache.sling.api.scripting                                        
org.apache.sling:org.apache.sling.api:jar:2.7.0
org.apache.sling.auth.core                                            
org.apache.sling:org.apache.sling.auth.core:jar:1.1.4
org.apache.sling.commons.json                                         
org.apache.sling:org.apache.sling.commons.json:jar:2.0.6
org.apache.sling.commons.json.io                                      
org.apache.sling:org.apache.sling.commons.json:jar:2.0.6
org.apache.sling.featureflags                                         
org.apache.sling:org.apache.sling.featureflags:jar:1.0.0
org.apache.sling.resourcemerger.api                                   
org.apache.sling:org.apache.sling.resourcemerger:jar:1.0.0
org.apache.sling.scripting.jsp.taglib                                 
org.apache.sling:org.apache.sling.scripting.jsp.taglib:jar:2.2.6
org.apache.sling.scripting.jsp.taglib.tei                             
org.apache.sling:org.apache.sling.scripting.jsp.taglib:jar:2.2.6
org.apache.taglibs.standard.tag.rt.core                               
javax.servlet:jstl:jar:1.2
org.apache.taglibs.standard.tei                                       
javax.servlet:jstl:jar:1.2
org.apache.taglibs.standard.tlv                                       
javax.servlet:jstl:jar:1.2
org.joda.time                                                         
joda-time:joda-time:jar:2.7
org.joda.time.base                                                    
joda-time:joda-time:jar:2.7
org.joda.time.format                                                  
joda-time:joda-time:jar:2.7
org.osgi.framework                                                    
org.osgi:org.osgi.core:jar:5.0.0
org.slf4j                                                             
org.slf4j:slf4j-api:jar:1.7.6
org.xml.sax                                                           n/a
org.xml.sax.helpers                                                   n/a
sun.reflect                                                           n/a

7 dependencies not used by JSPs:
---------------------------------------------------------------
org.osgi:org.osgi.service.metatype.annotations:jar:1.3.0
org.apache.sling:org.apache.sling.scripting.sightly:jar:1.0.18
org.apache.felix:org.apache.felix.scr.annotations:jar:1.12.0
org.osgi:org.osgi.service.component.annotations:jar:1.3.0
org.osgi:osgi.annotation:jar:6.0.1
org.apache.sling:org.apache.sling.scripting.jsp:jar:2.3.0
biz.aQute:bndlib:jar:1.43.0

3 packages are multiply defined by dependencies:
---------------------------------------------------------------
org.apache.commons.codec                                              
commons-codec:commons-codec:jar:1.10, 
org.apache.sling:org.apache.sling.auth.core:jar:1.1.4
org.apache.commons.codec.binary                                       
commons-codec:commons-codec:jar:1.10, 
org.apache.sling:org.apache.sling.auth.core:jar:1.1.4
org.apache.sling.commons.osgi                                         
org.apache.sling:org.apache.sling.scripting.jsp:jar:2.3.0, 
org.apache.sling:org.apache.sling.auth.core:jar:1.1.4
{noformat}

> Make JSPC plugin useful to validation and analysys
> --------------------------------------------------
>
>                 Key: SLING-6925
>                 URL: https://issues.apache.org/jira/browse/SLING-6925
>             Project: Sling
>          Issue Type: Improvement
>          Components: Maven Plugins and Archetypes
>    Affects Versions: Maven JSPC Plugin 2.0.8
>            Reporter: Tobias Bocanegra
>            Priority: Minor
>
> the JSPs plugin is very useful to validate the JSPs before they get packaged 
> into the artifact. --but the deployment unit might not need to class files 
> but there is currently no way to disable their attachment--. further it might 
> be valuable to know which dependencies in the project are really used by the 
> JSPs. this helps developers to optimize the runtime dependencies of their 
> code.
> suggest:
> - --add new flag: {{attachClasses}} (default true)--
> - analyze the java packages of the class path used to compile the JSPs and 
> report which dependencies are not used.
> - add new flag: {{reportUnusedDependencies}} (default true)
> - add new flag: {{dumpClassPathUsage}} (default false)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to