aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1741944 - in /aries/trunk/blueprint/blueprint-maven-plugin: pom.xml src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java src/main/java/org/apache/aries/blueprint/plugin/model/Introspector.java
Date Mon, 02 May 2016 09:41:57 GMT
Author: cschneider
Date: Mon May  2 09:41:57 2016
New Revision: 1741944

URL: http://svn.apache.org/viewvc?rev=1741944&view=rev
Log:
[ARIES-1541] Use annotations for maven, fix javadoc

Modified:
    aries/trunk/blueprint/blueprint-maven-plugin/pom.xml
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java
    aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Introspector.java

Modified: aries/trunk/blueprint/blueprint-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/pom.xml?rev=1741944&r1=1741943&r2=1741944&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/pom.xml (original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/pom.xml Mon May  2 09:41:57 2016
@@ -57,6 +57,11 @@
                     <source>1.7</source>
                 </configuration>
             </plugin>
+            <plugin>
+                <artifactId>maven-plugin-plugin</artifactId>
+                <version>3.4</version>
+            </plugin>
+
         </plugins>
         <pluginManagement>
             <plugins>
@@ -98,6 +103,11 @@
 
     <dependencies>
         <dependency>
+            <groupId>org.apache.maven.plugin-tools</groupId>
+            <artifactId>maven-plugin-annotations</artifactId>
+            <version>3.4</version>
+        </dependency>
+        <dependency>
             <groupId>javax.inject</groupId>
             <artifactId>javax.inject</artifactId>
             <version>1</version>
@@ -226,14 +236,5 @@
         </dependency>
     </dependencies>
 
-    <reporting>
-        <plugins>
-            <plugin>
-                <artifactId>maven-plugin-plugin</artifactId>
-                <version>2.9</version>
-            </plugin>
-        </plugins>
-
-    </reporting>
 
 </project>

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java?rev=1741944&r1=1741943&r2=1741944&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java
(original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java
Mon May  2 09:41:57 2016
@@ -24,6 +24,11 @@ import org.apache.maven.model.Resource;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+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.xbean.finder.ClassFinder;
 import org.sonatype.plexus.build.incremental.BuildContext;
@@ -38,47 +43,31 @@ import java.util.List;
 import java.util.Set;
 
 /**
- * Generates blueprint from spring annotations
- *
- * @goal blueprint-generate
- * @phase process-classes
- * @requiresDependencyResolution compile
- * @inheritByDefault false
- * @description Generates blueprint file from spring annotations @Component, @Autowire and
@Value
+ * Generates blueprint from CDI and spring annotations
  */
+@Mojo(name="blueprint-generate", requiresDependencyResolution=ResolutionScope.COMPILE, 
+    defaultPhase=LifecyclePhase.PROCESS_CLASSES, inheritByDefault=false)
 public class GenerateMojo extends AbstractMojo {
 
-    /**
-     * The maven project.
-     *
-     * @parameter default-value="${project}"
-     * @required
-     */
+    @Parameter(defaultValue="${project}", required=true)
     protected MavenProject project;
 
-    /**
-     * @parameter
-     * @required
-     */
+    @Parameter(required=true)
     protected List<String> scanPaths;
     
     /**
      * Which extension namespaces should the plugin support
-     *
-     * @parameter
      */
+    @Parameter
     protected Set<String> namespaces;
     
-    /**
-     * @component
-     */
+    @Component
     private BuildContext buildContext;
 
     /**
-     * Name of file to generate, default: autowire.xml
-     *
-     * @parameter
+     * Name of file to generate
      */
+    @Parameter(defaultValue="autowire.xml")
     protected String generatedFileName;
 
     public void execute() throws MojoExecutionException, MojoFailureException {
@@ -107,9 +96,7 @@ public class GenerateMojo extends Abstra
         resource.setDirectory(generatedDir);
         project.addResource(resource);
 
-        String fileName = generatedFileName != null ? generatedFileName : "autowire.xml";
-
-        File file = new File(generatedDir, "OSGI-INF/blueprint/" + fileName);
+        File file = new File(generatedDir, "OSGI-INF/blueprint/" + generatedFileName);
         file.getParentFile().mkdirs();
         System.out.println("Generating blueprint to " + file);
 

Modified: aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Introspector.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Introspector.java?rev=1741944&r1=1741943&r2=1741944&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Introspector.java
(original)
+++ aries/trunk/blueprint/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Introspector.java
Mon May  2 09:41:57 2016
@@ -47,7 +47,7 @@ public final class Introspector {
     }
 
     /**
-     * @param 
+     * @param requiredAnnotations annotations the fields must have
      * @return fields in the given class (including parent classes) that match this finder's
annotations requirements.
      * @throws UnsupportedOperationException if any field matching the annotations requirement
shares its name with a
      * field declared elsewhere in the class hierarchy.



Mime
View raw message