[MPLUGIN-189] support components field inheritance without role defined
git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/branches/MPLUGIN-189@1335092 13f79535-47bb-0310-9956-ffa450edef68master
parent
e008c8012c
commit
2373bae319
|
|
@ -52,7 +52,7 @@ public abstract class AbstractFirstMojo
|
||||||
/**
|
/**
|
||||||
* Plexus compiler manager.
|
* Plexus compiler manager.
|
||||||
*/
|
*/
|
||||||
@Component(role = "org.codehaus.plexus.compiler.manager.CompilerManager")
|
@Component
|
||||||
protected CompilerManager compilerManager;
|
protected CompilerManager compilerManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ import org.apache.maven.tools.plugin.extractor.ExtractionException;
|
||||||
import org.codehaus.plexus.logging.AbstractLogEnabled;
|
import org.codehaus.plexus.logging.AbstractLogEnabled;
|
||||||
import org.codehaus.plexus.util.DirectoryScanner;
|
import org.codehaus.plexus.util.DirectoryScanner;
|
||||||
import org.codehaus.plexus.util.IOUtil;
|
import org.codehaus.plexus.util.IOUtil;
|
||||||
|
import org.codehaus.plexus.util.StringUtils;
|
||||||
import org.codehaus.plexus.util.reflection.Reflector;
|
import org.codehaus.plexus.util.reflection.Reflector;
|
||||||
import org.objectweb.asm.ClassReader;
|
import org.objectweb.asm.ClassReader;
|
||||||
|
|
||||||
|
|
@ -256,7 +257,10 @@ public class DefaultMojoAnnotationsScanner
|
||||||
reflector.invoke( componentAnnotationContent, entry.getKey(),
|
reflector.invoke( componentAnnotationContent, entry.getKey(),
|
||||||
new Object[]{ entry.getValue() } );
|
new Object[]{ entry.getValue() } );
|
||||||
}
|
}
|
||||||
|
if ( StringUtils.isEmpty( componentAnnotationContent.role() ) )
|
||||||
|
{
|
||||||
|
componentAnnotationContent.role( mojoFieldVisitor.getClassName() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mojoClassVisitor.getMojoAnnotatedClass().getComponents().put( componentAnnotationContent.getFieldName(),
|
mojoClassVisitor.getMojoAnnotatedClass().getComponents().put( componentAnnotationContent.getFieldName(),
|
||||||
componentAnnotationContent );
|
componentAnnotationContent );
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue