Author: vsiveton
Date: Thu Jan 31 15:54:48 2008
New Revision: 617308
URL: http://svn.apache.org/viewvc?rev=617308&view=rev
Log:
MPLUGIN-53: Plugin descriptor extractor crashes on certain types of Java source
files
Submitted by: Paul Gier
Reviewed by: Vincent Siveton
o applied
Added:
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/source3/
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/source3/TestAnnotation.java
(with props)
Modified:
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java
Modified:
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java
URL:
http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java?rev=617308&r1=617307&r2=617308&view=diff
==============================================================================
---
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java
(original)
+++
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractorTest.java
Thu Jan 31 15:54:48 2008
@@ -117,5 +117,35 @@
return result;
}
+
+ /**
+ * Check that the mojo descriptor extractor will ignore any annotations
that are found.
+ *
+ * @throws Exception
+ */
+ public void testAnnotationInPlugin()
+ throws Exception
+ {
+ JavaMojoDescriptorExtractor extractor = new
JavaMojoDescriptorExtractor();
+
+ File sourceFile = fileOf( "dir-flag.txt" );
+
+ File dir = sourceFile.getParentFile();
+
+ Model model = new Model();
+ model.setArtifactId( "maven-unitTesting-plugin" );
+
+ MavenProject project = new MavenProject( model );
+
+ project.setFile( new File( dir, "pom.xml" ) );
+ project.addCompileSourceRoot( new File( dir, "source3" ).getPath() );
+
+ PluginDescriptor pluginDescriptor = new PluginDescriptor();
+ pluginDescriptor.setGoalPrefix( "test" );
+ List results = extractor.execute( project, pluginDescriptor );
+ assertEquals( 0, results.size() );
+
+ }
+
}
Added:
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/source3/TestAnnotation.java
URL:
http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/source3/TestAnnotation.java?rev=617308&view=auto
==============================================================================
---
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/source3/TestAnnotation.java
(added)
+++
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/source3/TestAnnotation.java
Thu Jan 31 15:54:48 2008
@@ -0,0 +1,8 @@
+package source3;
+
[EMAIL PROTECTED](RetentionPolicy.RUNTIME)
[EMAIL PROTECTED](ElementType.ANNOTATION_TYPE)
+
+public @interface TestAnnotation {
+
+}
Propchange:
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/source3/TestAnnotation.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/plugin-tools/trunk/maven-plugin-tools-java/src/test/resources/source3/TestAnnotation.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"