Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Tested with Maven version 2.0.4, and 2.0.x SNAPSHOT.
-
Patch
Description
Part of my plugin includes a .java file that contains an annotation type declaration. It looks like this:
package org.jboss.lang.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface Inherited {
}
When the JavaMojoDescriptorExtractor encounters this file it crashes because of an ArrayIndexOutOfBoundsException. Because the code is trying to access the 1st element of a zero length array. The attached file has a simple fix where the descriptor extractor just ignores any java source file that does not contain a valid class.