Package org.apache.maven.plugin

Examples of org.apache.maven.plugin.Mojo


                executionScope.enter();

                executionScope.seed( MavenProject.class, project );
                executionScope.seed( MojoExecution.class, execution );

                Mojo mojo = lookupConfiguredMojo( session, execution );
                mojo.execute();

                MojoExecutionEvent event = new MojoExecutionEvent( session, project, execution, mojo );
                for ( MojoExecutionListener listener : getContainer().lookupList( MojoExecutionListener.class ) )
                {
                    listener.afterMojoExecutionSuccess( event );
View Full Code Here


  public void testExecute() throws Exception {

    File testPom = new File("src/test/resources/test-1-pom.xml");

    Mojo mojo = lookupMojo("notify-progress", testPom);

    assertNotNull(mojo);

  }
View Full Code Here

  public void testExecuteModules() throws Exception {

    File testPom = new File("src/test/resources/test-modules-pom.xml");

    Mojo mojo = lookupMojo("notify-progress", testPom);

    assertNotNull(mojo);

  }
View Full Code Here

  public void testExecute() throws Exception {

    File testPom = new File("src/test/resources/test-1-pom.xml");

    Mojo mojo = lookupMojo("display-progress", testPom);

    assertNotNull(mojo);

  }
View Full Code Here

  public void testExecuteModules() throws Exception {

    File testPom = new File("src/test/resources/test-modules-pom.xml");

    Mojo mojo = lookupMojo("display-progress", testPom);

    assertNotNull(mojo);

    }
View Full Code Here

    public void testReportWithWrongUrl()
        throws Exception
    {
        File pluginXmlFile = new File( getBasedir(), "src/test/resources/plugin-configs/"
                + "scm-wrong-url-plugin-config.xml" );
        Mojo mojo = lookupMojo( "scm", pluginXmlFile );
        assertNotNull( "Mojo found.", mojo );

        setVariableValueToObject( mojo, "anonymousConnection", "scm:svn" );
        try
        {
            mojo.execute();
            assertTrue( "IllegalArgumentException NOT catched", false );
        }
        catch ( IllegalArgumentException e )
        {
            assertTrue( "IllegalArgumentException catched", true );
        }

        tearDown();
        setUp();

        mojo = lookupMojo( "scm", pluginXmlFile );
        assertNotNull( "Mojo found.", mojo );
        setVariableValueToObject( mojo, "anonymousConnection", "scm:svn:http" );
        try
        {
            mojo.execute();
            assertTrue( "IllegalArgumentException NOT catched", false );
        }
        catch ( Exception e )
        {
            assertTrue( "IllegalArgumentException catched", true );
        }

        tearDown();
        setUp();

        mojo = lookupMojo( "scm", pluginXmlFile );
        assertNotNull( "Mojo found.", mojo );
        setVariableValueToObject( mojo, "anonymousConnection", "scm" );
        try
        {
            mojo.execute();
            assertTrue( "IllegalArgumentException NOT catched", false );
        }
        catch ( Exception e )
        {
            assertTrue( "IllegalArgumentException catched", true );
View Full Code Here

    {
        validateContainerStatus();

        // pluginkey = groupId : artifactId : version : goal

        Mojo mojo = (Mojo) lookup( Mojo.ROLE, groupId + ":" + artifactId + ":" + version + ":" + goal );

        LoggerManager loggerManager = (LoggerManager) getContainer().lookup( LoggerManager.class );
       
        Log mojoLogger = new DefaultLog( loggerManager.getLoggerForComponent( Mojo.ROLE ) );

        mojo.setLog( mojoLogger );

        if ( pluginConfiguration != null )
        {
            /* requires v10 of plexus container for lookup on expression evaluator
             ExpressionEvaluator evaluator = (ExpressionEvaluator) getContainer().lookup( ExpressionEvaluator.ROLE,
View Full Code Here

        throws Exception, ComponentConfigurationException
    {
        MavenProject project = session.getCurrentProject();
        MojoDescriptor mojoDescriptor = execution.getMojoDescriptor();

        Mojo mojo = (Mojo) lookup( mojoDescriptor.getRole(), mojoDescriptor.getRoleHint() );

        ExpressionEvaluator evaluator = new PluginParameterExpressionEvaluator( session, execution );

        Xpp3Dom configuration = null;
        Plugin plugin = project.getPlugin( mojoDescriptor.getPluginDescriptor().getPluginLookupKey() );
View Full Code Here

    {

        MavenReport mavenReport = null;
        try
        {
            Mojo mojo = mavenPluginManager.getConfiguredMojo( Mojo.class,
                                                              mavenReportExecutorRequest.getMavenSession(),
                                                              mojoExecution );
            if ( !isMavenReport( mojoExecution, pluginDescriptor, mojo ) )
            {
                return null;
View Full Code Here

        null, (new DefaultArtifactHandlerStub("aar", null)));
    artifact.setBaseVersion("SNAPSHOT");
    artifact.setVersion("SNAPSHOT");
    setVariableValueToObject(project, "artifact", artifact);
    // Create and set Mojo properties.
    Mojo mojo = lookupMojo(goal, pom);
    setVariableValueToObject(mojo, "aarDirectory", new File(getBasedir(),
        "target/aar"));
    setVariableValueToObject(mojo, "aarName", model.getArtifactId());
    setVariableValueToObject(mojo, "outputDirectory", "target");
    setVariableValueToObject(mojo, "project", project);
View Full Code Here

TOP

Related Classes of org.apache.maven.plugin.Mojo

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.