maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1592237 - in /maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations: ./ scanner/
Date Sat, 03 May 2014 16:19:50 GMT
Author: hboutemy
Date: Sat May  3 16:19:49 2014
New Revision: 1592237

URL: http://svn.apache.org/r1592237
Log:
improved javadoc

Modified:
    maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/JavaAnnotationsMojoDescriptorExtractor.java
    maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/DefaultMojoAnnotationsScanner.java
    maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/MojoAnnotationsScanner.java

Modified: maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/JavaAnnotationsMojoDescriptorExtractor.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/JavaAnnotationsMojoDescriptorExtractor.java?rev=1592237&r1=1592236&r2=1592237&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/JavaAnnotationsMojoDescriptorExtractor.java
(original)
+++ maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/JavaAnnotationsMojoDescriptorExtractor.java
Sat May  3 16:19:49 2014
@@ -69,6 +69,7 @@ import java.util.TreeSet;
 
 /**
  * JavaMojoDescriptorExtractor, a MojoDescriptor extractor to read descriptors from java
classes with annotations.
+ * Notice that source files are also parsed to get description, since and deprecation information.
  *
  * @author Olivier Lamy
  * @since 3.0
@@ -185,13 +186,9 @@ public class JavaAnnotationsMojoDescript
 
     private boolean isMojoAnnnotatedClassCandidate( MojoAnnotatedClass mojoAnnotatedClass
)
     {
-        if ( mojoAnnotatedClass == null )
-        {
-            return false;
-        }
-        return ( !mojoAnnotatedClass.getComponents().isEmpty() || !mojoAnnotatedClass.getParameters().isEmpty()
-            || mojoAnnotatedClass.getExecute() != null || mojoAnnotatedClass.getMojo() !=
null );
-
+        return mojoAnnotatedClass != null
+            && !( mojoAnnotatedClass.getComponents().isEmpty() && mojoAnnotatedClass.getParameters().isEmpty()
+                && mojoAnnotatedClass.getExecute() == null && mojoAnnotatedClass.getMojo()
== null );
     }
 
     protected Map<String, JavaClass> discoverClassesFromSourcesJar( Artifact artifact,
PluginToolsRequest request,
@@ -612,7 +609,6 @@ public class JavaAnnotationsMojoDescript
     protected ExecuteAnnotationContent findExecuteInParentHierarchy( MojoAnnotatedClass mojoAnnotatedClass,
                                                                      Map<String, MojoAnnotatedClass>
mojoAnnotatedClasses )
     {
-
         if ( mojoAnnotatedClass.getExecute() != null )
         {
             return mojoAnnotatedClass.getExecute();

Modified: maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/DefaultMojoAnnotationsScanner.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/DefaultMojoAnnotationsScanner.java?rev=1592237&r1=1592236&r2=1592237&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/DefaultMojoAnnotationsScanner.java
(original)
+++ maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/DefaultMojoAnnotationsScanner.java
Sat May  3 16:19:49 2014
@@ -143,6 +143,7 @@ public class DefaultMojoAnnotationsScann
         {
             IOUtil.close( archiveStream );
         }
+
         return mojoAnnotatedClasses;
     }
 

Modified: maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/MojoAnnotationsScanner.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/MojoAnnotationsScanner.java?rev=1592237&r1=1592236&r2=1592237&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/MojoAnnotationsScanner.java
(original)
+++ maven/plugin-tools/trunk/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/annotations/scanner/MojoAnnotationsScanner.java
Sat May  3 16:19:49 2014
@@ -41,6 +41,13 @@ public interface MojoAnnotationsScanner
 
     final List<String> FIELD_LEVEL_ANNOTATIONS = Arrays.asList( Parameter.class.getName(),
Component.class.getName() );
 
+    /**
+     * Scan classes for mojo annotations.
+     * 
+     * @param request
+     * @return map of mojo-annotated classes keyed by full class name
+     * @throws ExtractionException
+     */
     Map<String, MojoAnnotatedClass> scan( MojoAnnotationsScannerRequest request )
         throws ExtractionException;
 }



Mime
View raw message