You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ra...@apache.org on 2017/11/21 16:12:22 UTC

[sling-htl-maven-plugin] branch master updated: enhanced documentation

This is an automated email from the ASF dual-hosted git repository.

radu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-htl-maven-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 35b1c32  enhanced documentation
35b1c32 is described below

commit 35b1c3278edc5792a9939552d0c2d3169bd09f79
Author: Radu Cotescu <co...@adobe.com>
AuthorDate: Tue Nov 21 17:11:54 2017 +0100

    enhanced documentation
---
 pom.xml                                            |  2 +-
 .../org/apache/sling/maven/htl/ValidateMojo.java   | 16 ++++++++++
 src/site/markdown/index.md                         |  2 +-
 src/site/markdown/usage.md.vm                      | 36 +++++++++++++++++++++-
 4 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index cedf1fe..16f9db0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -52,7 +52,7 @@
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <site.jira.version.id>12336741,12338350,12338646,12338974,12341271</site.jira.version.id>
+        <site.jira.version.id>12336741,12338350,12338646,12338974,12341271,12342047</site.jira.version.id>
         <maven.version>3.3.9</maven.version>
         <maven.site.path>${project.artifactId}-archives/${project.artifactId}-LATEST</maven.site.path>
     </properties>
diff --git a/src/main/java/org/apache/sling/maven/htl/ValidateMojo.java b/src/main/java/org/apache/sling/maven/htl/ValidateMojo.java
index efa9389..e4d1973 100644
--- a/src/main/java/org/apache/sling/maven/htl/ValidateMojo.java
+++ b/src/main/java/org/apache/sling/maven/htl/ValidateMojo.java
@@ -69,6 +69,8 @@ public class ValidateMojo extends AbstractMojo {
 
     /**
      * Defines the root folder where this Mojo expects to find Sightly scripts to validate.
+     *
+     * @since 1.0.0
      */
     @Parameter(property = "htl.sourceDirectory", defaultValue = "${project.build.sourceDirectory}")
     private File sourceDirectory;
@@ -76,6 +78,8 @@ public class ValidateMojo extends AbstractMojo {
     /**
      * List of files to include. Specified as fileset patterns which are relative to the input directory whose contents will be scanned
      * (see the sourceDirectory configuration option).
+     *
+     * @since 1.0.0
      */
     @Parameter(defaultValue = DEFAULT_INCLUDES)
     private String[] includes;
@@ -83,12 +87,16 @@ public class ValidateMojo extends AbstractMojo {
     /**
      * List of files to exclude. Specified as fileset patterns which are relative to the input directory whose contents will be scanned
      * (see the sourceDirectory configuration option).
+     *
+     * @since 1.0.0
      */
     @Parameter
     private String[] excludes;
 
     /**
      * If set to "true" it will fail the build on compiler warnings.
+     *
+     * @since 1.0.0
      */
     @Parameter(property = "htl.failOnWarnings", defaultValue = "false")
     private boolean failOnWarnings;
@@ -96,6 +104,8 @@ public class ValidateMojo extends AbstractMojo {
     /**
      * If set to "true" it will generate the Java classes resulted from transpiling the HTL scripts to Java. The generated classes will
      * be stored in the folder identified by the {@code generatedJavaClassesDirectory} parameter.
+     *
+     * @since 1.1.0
      */
     @Parameter(property = "htl.generateJavaClasses", defaultValue = "false")
     private boolean generateJavaClasses;
@@ -103,6 +113,8 @@ public class ValidateMojo extends AbstractMojo {
     /**
      * Defines the folder where the generated Java classes resulted from transpiling the project's HTL scripts will be stored. This
      * folder will be added to the list of source folders for this project.
+     *
+     * @since 1.1.0
      */
     @Parameter(property = "htl.generatedJavaClassesDirectory", defaultValue = "${project.build.directory}/generated-sources/htl")
     private File generatedJavaClassesDirectory;
@@ -110,12 +122,16 @@ public class ValidateMojo extends AbstractMojo {
     /**
      * Defines a list of Java packages that should be ignored when generating the import statements for the Java classes resulted from
      * transpiling the project's HTL scripts. Subpackages of these packages will also be part automatically of the ignore list.
+     *
+     * @since 1.1.0
      */
     @Parameter(property = "htl.ignoreImports")
     private Set<String> ignoreImports;
 
     /**
      * If set to "true" the validation will be skipped.
+     *
+     * @since 1.0.2
      */
     @Parameter(property = "htl.skip", defaultValue = "false")
     private boolean skip;
diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md
index 7d449e4..9317ce6 100644
--- a/src/site/markdown/index.md
+++ b/src/site/markdown/index.md
@@ -14,7 +14,7 @@ The HTL Maven Plugin has only one goal:
 
 
 ### Usage
-General instructions on how to use the HTL Maven Plugin can be found on the usage page.
+General instructions on how to use the HTL Maven Plugin can be found on the [usage](usage.html) page.
 
 In case you still have questions regarding the plugin's usage feel free to contact the Apache Sling Development List. The posts to the
 mailing list are archived and could already contain the answer to your question as part of an older thread. Hence, it is also worth
diff --git a/src/site/markdown/usage.md.vm b/src/site/markdown/usage.md.vm
index 1518825..9429805 100644
--- a/src/site/markdown/usage.md.vm
+++ b/src/site/markdown/usage.md.vm
@@ -30,7 +30,7 @@ if your Maven user settings file provides the following configuration
 </pluginGroups>
 ```
 
-$h3 Configuring Your HTL Maven Plugin
+$h3 Configuring the HTL Maven Plugin
 
 ```
 <project>
@@ -58,3 +58,37 @@ $h3 Configuring Your HTL Maven Plugin
 </project>
 ```
 
+$h3 Generating Java classes from your HTL scripts
+
+Since version 1.1.0 it's possible to generate Java classes from the project's HTL scripts. This is useful when you want to identify your
+script's Java dependencies. To do this the following configuration should be applied:
+
+```
+<project>
+    ...
+    <build>
+        <pluginManagement>
+            <plugin>
+                <groupId>org.apache.sling</groupId>
+                <artifactId>htl-maven-plugin</artifactId>
+                <version>${project.version}/version>
+                <configuration>
+                    <!-- put your configurations here -->
+                    <failOnWarnings>true</failOnWarnings>
+                    <generateJavaClasses>true</generateJavaClasses>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>validate-scripts</id>
+                        <goals>
+                            <goal>validate</goal>
+                        </goals>
+                        <phase>generate-sources</phase>
+                    </execution>
+                </executions>
+            </plugin>
+        </pluginManagement>
+    </build>
+    ...
+</project>
+```

-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].