sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tobias Bocanegra (JIRA)" <>
Subject [jira] [Commented] (SLING-7155) htl-maven-plugin: Add option to precompile the HTL scripts
Date Thu, 19 Oct 2017 00:48:00 GMT


Tobias Bocanegra commented on SLING-7155:

[~radu.cotescu] cool, thanks!

it has one flaw, though: the use classes are not used as class references in the java but
via reflection, which causes them to be removed from the compiled class file.

html script:
<form data-sly-use.container="com.adobe.cq.wcm.core.components.models.form.Container"
      method="${container.method}" action="${container.action}" id="${}" name="${}"
      class="cmp-form ${grid.cssClass}">

generated java:
import com.adobe.cq.wcm.core.components.models.form.Container;
public final class container_html extends RenderUnit {
_global_container ="use", "com.adobe.cq.wcm.core.components.models.form.Container",
_global_grid ="use", "",

but the class {{com.adobe.cq.wcm.core.components.models.form.Container}} is never referenced
as such in the code, so it is not visible in the class file and not detected as dependency
by the class scanner.

ideally, the htl compiler should do something like:
_global_container ="use", com.adobe.cq.wcm.core.components.models.form.Container.class.getName(),

or the {{renderContext}} also offers a signature with the class instead of just the string,
_global_container ="use", com.adobe.cq.wcm.core.components.models.form.Container.class,


> htl-maven-plugin: Add option to precompile the HTL scripts
> ----------------------------------------------------------
>                 Key: SLING-7155
>                 URL:
>             Project: Sling
>          Issue Type: Improvement
>          Components: Maven Plugins and Archetypes
>    Affects Versions: HTL Maven Plugin 1.0.8
>            Reporter: Tobias Bocanegra
>            Assignee: Radu Cotescu
> It would be cool if the HTL Maven Plugin could precompile the HTL scripts, similar to
the JSPC plugin.
> This would have the following advantages:
> * the project needs to specify all the (compile time) dependencies the scripts needs;
this makes the project more robust and changes in dependencies are easier detectable;
> * the compiled classes could be used as source to generate the import-package statements
for the {{filevault-package-maven-plugin}}.

This message was sent by Atlassian JIRA

View raw message