Package org.apache.maven.execution

Examples of org.apache.maven.execution.MavenSession


    // We need to take in multiple lifecycles
    public void testCalculationOfBuildPlanWithMultipleExecutionsOfModello()
        throws Exception
    {
        File pom = getProject( "project-with-multiple-executions" );
        MavenSession session = createMavenSession( pom );
        assertEquals( "project-with-multiple-executions", session.getCurrentProject().getArtifactId() );
        assertEquals( "1.0.1", session.getCurrentProject().getVersion() );

        MavenExecutionPlan plan = calculateExecutionPlan( session, "clean", "install" );

        List<MojoExecution> executions = getExecutions( plan );
View Full Code Here


    public void testLifecycleQueryingUsingADefaultLifecyclePhase()
        throws Exception
    {
        File pom = getProject( "project-with-additional-lifecycle-elements" );
        MavenSession session = createMavenSession( pom );
        assertEquals( "project-with-additional-lifecycle-elements", session.getCurrentProject().getArtifactId() );
        assertEquals( "1.0", session.getCurrentProject().getVersion() );
        List<MojoExecution> executionPlan = getExecutions( calculateExecutionPlan( session, "package" ) );

        //[01] resources:resources
        //[02] compiler:compile
        //[03] it:generate-metadata
View Full Code Here

    public void testPluginConfigurationCreation()
        throws Exception
    {
        File pom = getProject( "project-with-additional-lifecycle-elements" );
        MavenSession session = createMavenSession( pom );
        MojoDescriptor mojoDescriptor =
            mojoDescriptorCreator.getMojoDescriptor( "org.apache.maven.its.plugins:maven-it-plugin:0.1:java", session,
                                                     session.getCurrentProject() );
        Xpp3Dom dom = MojoDescriptorCreator.convert( mojoDescriptor );
        System.out.println( dom );
    }
View Full Code Here

    public void testInvalidGoalName()
        throws Exception
    {
        File pom = getProject( "project-basic" );
        MavenSession session = createMavenSession( pom );
        try
        {
            getExecutions( calculateExecutionPlan( session, "resources:" ) );
            fail( "expected a MojoNotFoundException" );
        }
View Full Code Here

    public void testPluginPrefixRetrieval()
        throws Exception
    {
        File pom = getProject( "project-basic" );
        MavenSession session = createMavenSession( pom );
        Plugin plugin = mojoDescriptorCreator.findPluginForPrefix( "resources", session );
        assertEquals( "org.apache.maven.plugins", plugin.getGroupId() );
        assertEquals( "maven-resources-plugin", plugin.getArtifactId() );
    }
View Full Code Here

    public void testFindingPluginPrefixforCleanClean()
        throws Exception
    {
        File pom = getProject( "project-basic" );
        MavenSession session = createMavenSession( pom );
        Plugin plugin = mojoDescriptorCreator.findPluginForPrefix( "clean", session );
        assertNotNull( plugin );
    }
View Full Code Here

            setVariableValueToObject( mojo, "settings", settings );

            MavenExecutionRequest request = new DefaultMavenExecutionRequest();
            request.setProxies( Arrays.asList( proxy ) );
            MavenSession mavenSession = new MavenSession( getContainer(), null, request, null );

            setVariableValueToObject( mojo, "mavenSession", mavenSession );

            File inputDirectory = new File( "src/test/resources/unit/deploy-dav/target/site" );
View Full Code Here

            setVariableValueToObject( mojo, "settings", settings );

            MavenExecutionRequest request = new DefaultMavenExecutionRequest();
            request.setProxies( Arrays.asList( proxy ) );
            MavenSession mavenSession = new MavenSession( getContainer(), null, request, null );

            setVariableValueToObject( mojo, "mavenSession", mavenSession );

            File inputDirectory = new File( "src/test/resources/unit/deploy-dav/target/site" );
View Full Code Here

    }

    private static MavenSession createSession( PlexusContainer container, ArtifactRepository repo )
        throws CycleDetectedException, DuplicateProjectException
    {
        return new MavenSession( container, new Settings(), repo, new DefaultEventDispatcher(),
                                 new ReactorManager( Collections.EMPTY_LIST ), Collections.EMPTY_LIST, ".",
                                 new Properties(), new Date() );
    }
View Full Code Here

                                                                                 "legacy" );

        ArtifactRepository repo = new DefaultArtifactRepository( "local", "target/repo", repoLayout );

        PlexusContainer container = getContainer();
        MavenSession session = createSession( container, repo );

        MojoDescriptor mojo = new MojoDescriptor();
        mojo.setPluginDescriptor( pluginDescriptor );
        mojo.setGoal( "goal" );
View Full Code Here

TOP

Related Classes of org.apache.maven.execution.MavenSession

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.