Package org.apache.maven.tools.plugin.annotations.scanner

Examples of org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotatedClass


        System.out.println( "mojoAnnotatedClasses:" + mojoAnnotatedClasses );

        Assertions.assertThat( mojoAnnotatedClasses ).isNotNull().isNotEmpty().hasSize( 1 );

        MojoAnnotatedClass mojoAnnotatedClass = mojoAnnotatedClasses.values().iterator().next();

        assertEquals( FooMojo.class.getName(), mojoAnnotatedClass.getClassName() );
        assertEquals( AbstractMojo.class.getName(), mojoAnnotatedClass.getParentClassName() );

        Mojo mojo = mojoAnnotatedClass.getMojo();

        assertEquals( "foo", mojo.name() );
        assertEquals( true, mojo.threadSafe() );
        assertEquals( false, mojo.aggregator() );
        assertEquals( LifecyclePhase.COMPILE, mojo.defaultPhase() );

        Execute execute = mojoAnnotatedClass.getExecute();

        assertEquals( "compiler", execute.goal() );
        assertEquals( "my-lifecycle", execute.lifecycle() );
        assertEquals( LifecyclePhase.PACKAGE, execute.phase() );

        Collection<ComponentAnnotationContent> components = mojoAnnotatedClass.getComponents().values();
        Assertions.assertThat( components ).isNotNull().isNotEmpty().hasSize( 2 );

        Collection<ParameterAnnotationContent> parameters = mojoAnnotatedClass.getParameters().values();
        Assertions.assertThat( parameters ).isNotNull().isNotEmpty().hasSize( 2 ).contains(
            new ParameterAnnotationContent( "bar", null, "thebar", "coolbar", true, false, String.class.getName() ),
            new ParameterAnnotationContent( "beer", null, "thebeer", "coolbeer", false, false,
                                            String.class.getName() ) );
    }
View Full Code Here


        return mojoFieldVisitors;
    }

    public void visit( int version, int access, String name, String signature, String superName, String[] interfaces )
    {
        mojoAnnotatedClass = new MojoAnnotatedClass();
        mojoAnnotatedClass.setClassName( Type.getObjectType( name ).getClassName() ).setParentClassName(
            Type.getObjectType( superName ).getClassName() );
        logger.debug( "MojoClassVisitor#visit" );
    }
View Full Code Here

        String parentClassName = mojoAnnotatedClass.getParentClassName();
        if ( StringUtils.isEmpty( parentClassName ) )
        {
            return null;
        }
        MojoAnnotatedClass parent = mojoAnnotatedClasses.get( parentClassName );
        if ( parent == null )
        {
            return null;
        }
        return findExecuteInParentHierarchy( parent, mojoAnnotatedClasses );
View Full Code Here

    {
        parameterAnnotationContents.addAll( mojoAnnotatedClass.getParameters().values() );
        String parentClassName = mojoAnnotatedClass.getParentClassName();
        if ( parentClassName != null )
        {
            MojoAnnotatedClass parent = mojoAnnotatedClasses.get( parentClassName );
            if ( parent != null )
            {
                return getParametersParent( parent, parameterAnnotationContents, mojoAnnotatedClasses );
            }
        }
View Full Code Here

    {
        componentAnnotationContents.addAll( mojoAnnotatedClass.getComponents().values() );
        String parentClassName = mojoAnnotatedClass.getParentClassName();
        if ( parentClassName != null )
        {
            MojoAnnotatedClass parent = mojoAnnotatedClasses.get( parentClassName );
            if ( parent != null )
            {
                return getComponentParent( parent, componentAnnotationContents, mojoAnnotatedClasses );
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotatedClass

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.