Package org.apache.maven.plugin

Examples of org.apache.maven.plugin.Mojo


        List requiredDependencies = new ArrayList();
       
        requiredDependencies.add( "dependencies/test.jar" );
        requiredDependencies.add( "dependencies/test2.jar" );
       
        Mojo mojo = run( pluginConfig, "directory-inline" );
        assertFilesAdded( mojo, requiredDependencies );
    }
View Full Code Here


   
    public void testModuleSetSourceIncludedBinariesNotIncluded() throws Exception
    {
        String pluginConfig = "moduleSetSourceIncludedBinariesNotIncluded-pluginConfig.xml";
       
        Mojo mojo = run( pluginConfig, "attached" );
       
        List required = Collections.singletonList( "sources/module1/src/main/java/org/test/module1/App.java" );
       
        assertFilesAdded( mojo, required );
    }
View Full Code Here

        File pluginConfigFile = new File( getBasedir(), "src/test/plugin-configs/" + pluginConfigResource );
       
        assertTrue( "Cannot find plugin-configuration: \'" + pluginConfigResource + "\' in context-classloader\'s classpath.", pluginConfigFile.exists() );
       
        // TODO: Need to replace this with test-only mojos...
        Mojo mojo = (Mojo) lookupMojo( mojoName, pluginConfigFile.getAbsolutePath() );

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

        return mojo;
    }
View Full Code Here

                                                  MavenReportExecutorRequest mavenReportExecutorRequest )
        throws PluginContainerException, PluginConfigurationException
    {
        try
        {
            Mojo mojo = mavenPluginManager.getConfiguredMojo( Mojo.class,
                                                              mavenReportExecutorRequest.getMavenSession(),
                                                              mojoExecution );

            return (MavenReport) mojo;
        }
View Full Code Here

    private void doConfigTest(String mojoName, String configFile)
        throws Exception
    {
        File testPom =
            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 );
    }
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

     */
    public void testCreateClownfish() {
       
        Command command = new Command(null);
       
        Mojo mojo = EasyMock.createMock(Mojo.class);
        Log log = EasyMock.createMock(Log.class);
       
        ClownfishHelper clownfishHelper = EasyMock.createMock(
                ClownfishHelper.class);
       
View Full Code Here

  @Test
    public void testCreateClownfish() {
       
        Command command = new Command();
       
        Mojo mojo = EasyMock.createMock(Mojo.class);
        Log log = EasyMock.createMock(Log.class);
       
        ClownfishHelper clownfishHelper = EasyMock.createMock(
                ClownfishHelper.class);
       
View Full Code Here

            if ( !isMavenReport( mojoExecution, pluginDescriptor ) )
            {
                return null;
            }

            Mojo mojo = mavenPluginManager.getConfiguredMojo( Mojo.class,
                                                              mavenReportExecutorRequest.getMavenSession(),
                                                              mojoExecution );

            return (MavenReport) mojo;
        }
View Full Code Here

    extends AbstractCoberturaTestCase
{
    public void testMojo()
        throws Exception
    {
        Mojo mojo =
            lookupMojo( "check", PlexusTestCase.getBasedir() + "/src/test/plugin-configs/check-plugin-config.xml" );

        setVariableValueToObject( mojo, "pluginClasspathList", getPluginClasspath() );

        mojo.execute();
    }
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.