You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/10/18 23:30:13 UTC

[sling-maven-jcrocm-plugin] 10/14: SLING-5107 - Switch to Java annotations for Maven plugins

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-maven-jcrocm-plugin.git

commit 1f2deef6e8717a467b885a531c4f2ee545500418
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Oct 7 07:58:02 2015 +0000

    SLING-5107 - Switch to Java annotations for Maven plugins
    
    Switch to Java annotations for the maven-jcrocm-plugin
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1707198 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            | 33 ++++++++++++++++++----
 .../org/apache/sling/maven/jcrocm/JcrOcmMojo.java  | 27 ++++++------------
 2 files changed, 36 insertions(+), 24 deletions(-)

diff --git a/pom.xml b/pom.xml
index ed8adf7..b1b2286 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,13 +46,29 @@
         <url>http://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-jcrocm-plugin</url>
     </scm>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-plugin-plugin</artifactId>
+                 <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-plugin-plugin</artifactId>
-				<version>2.5.1</version>
-			</plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
@@ -88,5 +104,12 @@
 			<artifactId>qdox</artifactId>
             <version>1.9.1</version>
 		</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/jcrocm/JcrOcmMojo.java b/src/main/java/org/apache/sling/maven/jcrocm/JcrOcmMojo.java
index 523a1fd..4a6fb39 100644
--- a/src/main/java/org/apache/sling/maven/jcrocm/JcrOcmMojo.java
+++ b/src/main/java/org/apache/sling/maven/jcrocm/JcrOcmMojo.java
@@ -29,6 +29,10 @@ import org.apache.maven.artifact.Artifact;
 import org.apache.maven.model.Resource;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoFailureException;
+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.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
@@ -45,35 +49,20 @@ import com.thoughtworks.qdox.model.JavaSource;
  * <em>maven-jcrocm-plugin</em>. It is by default run in the
  * <code>generate-resources</code> phase and requires the compile scoped
  * dependencies to be resolved.
- *
- * @goal ocm
- * @phase generate-resources
- * @description Build Jackrabbit OCM Descriptors from Java Source
- * @requiresDependencyResolution compile
  */
+@Mojo(name = "ocm", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, requiresDependencyResolution = ResolutionScope.COMPILE)
 public class JcrOcmMojo extends AbstractMojo {
 
-    /**
-     * @parameter expression="${project.build.directory}/sling-generated"
-     * @required
-     * @readonly
-     */
+    @Parameter ( defaultValue = "${project.build.directory}/sling-generated", readonly = true)
     private File outputDirectory;
 
-    /**
-     * The Maven project.
-     *
-     * @parameter expression="${project}"
-     * @required
-     * @readonly
-     */
+    @Parameter( defaultValue = "${project}", readonly = true )
     private MavenProject project;
 
     /**
      * Name and path of the generated descriptor.
-     *
-     * @parameter expression="${jcrocm.descriptor.name}" default-value="mappings.xml"
      */
+    @Parameter( property = "jcrocm.descriptor.name", defaultValue = "mappings.xml")
     private String finalName;
 
     public void execute() throws MojoFailureException {

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