This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/sling-jspc-maven-plugin.git
commit cf94c9e57115603e8510cb245acb4c422e601f24 Author: Robert Munteanu <[email protected]> AuthorDate: Wed Oct 7 07:58:07 2015 +0000 SLING-5107 - Switch to Java annotations for Maven plugins Switch to Java annotations for the maven-jspc-plugin git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1707199 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 29 +++++++- .../java/org/apache/sling/maven/jspc/JspcMojo.java | 86 ++++++---------------- 2 files changed, 49 insertions(+), 66 deletions(-) diff --git a/pom.xml b/pom.xml index 825cfca..cb07f42 100644 --- a/pom.xml +++ b/pom.xml @@ -43,13 +43,29 @@ <url>http://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-jspc-plugin</url> </scm> - <reporting> + <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugin-plugin</artifactId> - <version>2.5.1</version> - </plugin> + <executions> + <execution> + <id>default-descriptor</id> + <phase>process-classes</phase> + </execution> + <execution> + <id>help-goal</id> + <goals> + <goal>helpmojo</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <reporting> + <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> @@ -131,5 +147,12 @@ <version>1.5.2</version> <scope>compile</scope> </dependency> + + <dependency> + <groupId>org.apache.maven.plugin-tools</groupId> + <artifactId>maven-plugin-annotations</artifactId> + <version>3.4</version> + <scope>provided</scope> + </dependency> </dependencies> </project> diff --git a/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java b/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java index 1ae3a38..1483b4d 100644 --- a/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java +++ b/src/main/java/org/apache/sling/maven/jspc/JspcMojo.java @@ -39,6 +39,10 @@ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DependencyResolutionRequiredException; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.project.MavenProject; import org.apache.sling.scripting.jsp.jasper.JasperException; import org.apache.sling.scripting.jsp.jasper.JspCompilationContext; @@ -58,124 +62,80 @@ import org.codehaus.plexus.util.DirectoryScanner; * <code>jspc</code> compiling JSP into the target and creating a component * descriptor for Declarative Services to use the JSP with the help of the * appropriate adapter as component. - * - * @goal jspc - * @phase compile - * @description Compile JSP Files into Servlet Classes using the same JSP - * Compiler as is used at runtime to compile Repository based JSP - * into classes. - * @requiresDependencyResolution compile */ +@Mojo( name = "jspc", defaultPhase = LifecyclePhase.COMPILE, requiresDependencyResolution = ResolutionScope.COMPILE) public class JspcMojo extends AbstractMojo implements Options { /** * The Maven project. - * - * @parameter expression="${project}" - * @required - * @readonly */ + @Parameter( defaultValue = "${project}", readonly = true ) private MavenProject project; /** * Location of JSP source files. - * - * @parameter expression="${jspc.sourceDirectory}" - * default-value="${project.build.scriptSourceDirectory}" */ + @Parameter( property = "jspc.sourceDirectory", defaultValue = "${project.build.scriptSourceDirectory}") private File sourceDirectory; /** * Target folder for the compiled classes. - * - * @parameter expression="${jspc.outputDirectory}" - * default-value="${project.build.outputDirectory}" - * @required */ + @Parameter ( property = "jspc.outputDirectory", defaultValue = "${project.build.outputDirectory}") private String outputDirectory; - /** - * @parameter expression="${jspc.jasper.classdebuginfo}" - * default-value="true" - */ + @Parameter ( property = "jspc.jasper.classdebuginfo", defaultValue = "true") private boolean jasperClassDebugInfo; - /** - * @parameter expression="${jspc.jasper.enablePooling}" default-value="true" - */ + @Parameter ( property = "jspc.jasper.enablePooling", defaultValue = "true") private boolean jasperEnablePooling; - /** - * @parameter expression="${jspc.jasper.ieClassId}" - * default-value="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" - */ + @Parameter ( property = "jspc.jasper.ieClassId", defaultValue = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93") private String jasperIeClassId; - /** - * @parameter expression="${jspc.jasper.genStringAsCharArray}" - * default-value="false" - */ + @Parameter ( property = "jspc.jasper.genStringAsCharArray", defaultValue = "false") private boolean jasperGenStringAsCharArray; - /** - * @parameter expression="${jspc.jasper.keepgenerated}" default-value="true" - */ + @Parameter ( property = "jspc.jasper.keepgenerated", defaultValue = "true") private boolean jasperKeepGenerated; - /** - * @parameter expression="${jspc.jasper.mappedfile}" default-value="true" - */ + @Parameter ( property = "jspc.jasper.mappedfile", defaultValue = "true") private boolean jasperMappedFile; - /** - * @parameter expression="${jspc.jasper.trimSpaces}" default-value="false" - */ + @Parameter ( property = "jspc.jasper.trimSpaces", defaultValue = "false") private boolean jasperTrimSpaces; - /** - * @parameter expression="${jspc.failOnError}" default-value="true" - */ + @Parameter ( property = "jspc.failOnError", defaultValue = "true") private boolean failOnError; - /** - * @parameter expression="${jspc.showSuccess}" default-value="false" - */ + @Parameter ( property = "jspc.showSuccess", defaultValue = "false") private boolean showSuccess; - /** - * @parameter expression="${jspc.compilerTargetVM}" default-value="1.5" - */ + @Parameter ( property = "jspc.compilerTargetVM", defaultValue = "1.5") private String compilerTargetVM; - /** - * @parameter expression="${jspc.compilerSourceVM}" default-value="1.5" - */ + @Parameter ( property = "jspc.compilerSourceVM", defaultValue = "1.5") private String compilerSourceVM; /** * Comma separated list of extensions of files to be compiled by the plugin. - * - * @parameter expression="${jspc.jspFileExtensions}" - * default-value="jsp,jspx" */ + @Parameter ( property = "jspc.jspFileExtensions", defaultValue = "jsp,jspx") private String jspFileExtensions; - /** - * @parameter expression="${jspc.servletPackage}" - * default-value="org.apache.jsp" - */ + @Parameter ( property = "jspc.servletPackage", defaultValue = "org.apache.jsp") private String servletPackage; /** * Included JSPs, defaults to <code>"**/*.jsp"</code> - * @parameter */ + @Parameter private String[] includes; /** * Excluded JSPs, empty by default - * @parameter */ + @Parameter private String[] excludes; private Set<String> jspFileExtensionSet; -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
