Package org.apache.maven.plugin

Examples of org.apache.maven.plugin.Mojo.execute()


    {
        File pluginXmlFile = new File( getBasedir(), "src/test/idea-plugin-configs/macro-plugin-config.xml" );

        Mojo mojo = lookupMojo( "idea", pluginXmlFile );

        mojo.execute();

        File basedir = new File( getBasedir(), "target/test-harness/i-macro" );

        String artifactId = "plugin-test-i-macro";
View Full Code Here


        File iwsFile = new File( basedir, artifactId + ".iws" );
        assertTrue( "Test creation of project files", iwsFile.createNewFile() );

        Mojo mojo = lookupMojo( "clean", pluginXmlFile );

        mojo.execute();

        assertFalse( "Test idea project file was deleted", iprFile.exists() );

        assertFalse( "Test idea module file was deleted", imlFile.exists() );
View Full Code Here

            new File( getBasedir(), "target/test-classes/unit/skip-test/" + configFile );
        Mojo mojo = lookupMojo( mojoName, testPom );
        assertNotNull( mojo );
        CapturingLog log = new CapturingLog();
        mojo.setLog( log );
        mojo.execute();

        assertTrue( log.getContent().indexOf( "Skipping plugin execution" ) != -1 );
    }

    class CapturingLog
View Full Code Here

                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

        assertNotNull( "Mojo found.", mojo );

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

        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 );
View Full Code Here

        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

            new File( getBasedir(), "target/test-classes/unit/skip-test/" + configFile );
        Mojo mojo = lookupMojo( mojoName, testPom );
        assertNotNull( mojo );
        CapturingLog log = new CapturingLog();
        mojo.setLog( log );
        mojo.execute();

        assertTrue(log.getContent().contains("Skipping plugin execution"));
    }

    class CapturingLog
View Full Code Here

    public void testAttachedMojo()
        throws Exception
    {
        Mojo mojo = lookupMojo( "attached", basedir + "/src/test/plugin-configs/attached/min-plugin-config.xml" );

        mojo.execute();

        assertTrue( "Test an archive was created", ArchiverManagerStub.archiverStub.getDestFile().exists() );
    }

    public void testAttachedMojoDependencySet()
View Full Code Here

        Mojo mojo = (Mojo) lookupMojo( mojoName, pluginConfigFile.getAbsolutePath() );

        FileLoggingArchiverManagerStub archiverManager = (FileLoggingArchiverManagerStub) getVariableValueFromObject( mojo, "archiverManager" );
        archiverManager.clearArchiver();
       
        mojo.execute();

        return mojo;
    }

    private void assertFilesAdded( Mojo mojo, List requiredDependencies ) throws Exception
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.