Examples of DefaultMavenExecutionRequest


Examples of org.apache.maven.execution.DefaultMavenExecutionRequest

    }

    protected MavenExecutionRequest createMavenExecutionRequest( File pom )
        throws Exception
    {       
        MavenExecutionRequest request = new DefaultMavenExecutionRequest()
            .setPom( pom )
            .setProjectPresent( true )
            .setShowErrors( true )
            .setPluginGroups( Arrays.asList( "org.apache.maven.plugins" ) )
            .setLocalRepository( getLocalRepository() )
View Full Code Here

Examples of org.apache.maven.execution.DefaultMavenExecutionRequest

                           
        DefaultRepositorySystemSession session = new DefaultRepositorySystemSession();
        LocalRepository localRepo = new LocalRepository( request.getLocalRepository().getBasedir() );
        session.setLocalRepositoryManager( new SimpleLocalRepositoryManagerFactory().newInstance( session, localRepo ) );
        LegacySupport legacySupport = lookup( LegacySupport.class );
        legacySupport.setSession( new MavenSession( getContainer(), session, new DefaultMavenExecutionRequest(),
                                                    new DefaultMavenExecutionResult() ) );

        ArtifactResolutionResult result = repositorySystem.resolve( request );
        resolutionErrorHandler.throwErrors( request, result );       
        assertEquals( 2, result.getArtifacts().size() );
View Full Code Here

Examples of org.apache.maven.execution.DefaultMavenExecutionRequest

        artifactFactory = lookup( ArtifactFactory.class);       
        artifactRepositoryFactory = lookup( ArtifactRepositoryFactory.class );

        RepositorySystemSession repoSession = initRepoSession();
        MavenSession session =
            new MavenSession( getContainer(), repoSession, new DefaultMavenExecutionRequest(),
                              new DefaultMavenExecutionResult() );

        LegacySupport legacySupport = lookup(LegacySupport.class);
        legacySupport.setSession( session );
    }
View Full Code Here

Examples of org.apache.maven.execution.DefaultMavenExecutionRequest

    @SuppressWarnings( "deprecation" )
    private static MavenSession createSession( PlexusContainer container, ArtifactRepository repo, Properties properties )
        throws CycleDetectedException, DuplicateProjectException
    {
        MavenExecutionRequest request = new DefaultMavenExecutionRequest()
            .setSystemProperties( properties )
            .setGoals( Collections.<String>emptyList() )
            .setBaseDirectory( new File( "" ) )
            .setLocalRepository( repo );
View Full Code Here

Examples of org.apache.maven.execution.DefaultMavenExecutionRequest

        CliRequest( String[] args, ClassWorld classWorld )
        {
            this.args = args;
            this.classWorld = classWorld;
            this.request = new DefaultMavenExecutionRequest();
        }
View Full Code Here

Examples of org.apache.maven.execution.DefaultMavenExecutionRequest

    final CountDownLatch latch = new CountDownLatch(1);
    final DefaultLegacySupport defaultLegacySupport = new DefaultLegacySupport();

    public void testSetSession() throws Exception {

        MavenExecutionRequest mavenExecutionRequest = new DefaultMavenExecutionRequest();
        MavenSession m1 = new MavenSession(null, null, mavenExecutionRequest, null);
        defaultLegacySupport.setSession(m1);

        MyRunnable myRunnable = new MyRunnable();
        Thread thread = new Thread(myRunnable);
View Full Code Here

Examples of org.apache.maven.execution.DefaultMavenExecutionRequest

      {
         Settings settings = getSettings();
         // TODO this needs to be configurable via .forge
         // TODO this reference to the M2_REPO should probably be centralized

         MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest();
         lookup(MavenExecutionRequestPopulator.class).populateFromSettings(executionRequest, getSettings());
         request = executionRequest.getProjectBuildingRequest();
         ArtifactRepository localRepository = new MavenArtifactRepository(
                  "local", new File(settings.getLocalRepository()).toURI().toURL().toString(),
                  getContainer().lookup(ArtifactRepositoryLayout.class),
                  new ArtifactRepositoryPolicy(true, ArtifactRepositoryPolicy.UPDATE_POLICY_NEVER,
                           ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN),
View Full Code Here

Examples of org.apache.maven.execution.DefaultMavenExecutionRequest

    }

    protected MavenExecutionRequest createMavenExecutionRequest( File pom )
        throws Exception
    {       
        MavenExecutionRequest request = new DefaultMavenExecutionRequest()
            .setPom( pom )
            .setProjectPresent( true )
            .setShowErrors( true )
            .setPluginGroups( Arrays.asList( new String[] { "org.apache.maven.plugins" } ) )
            .setLocalRepository( getLocalRepository() )
View Full Code Here

Examples of org.apache.maven.execution.DefaultMavenExecutionRequest

    }

    public static MavenSession getMavenSession()
    {
        final DefaultMavenExecutionResult defaultMavenExecutionResult = new DefaultMavenExecutionResult();
        MavenExecutionRequest mavenExecutionRequest = new DefaultMavenExecutionRequest();
        mavenExecutionRequest.setExecutionListener( new AbstractExecutionListener() );
        mavenExecutionRequest.setGoals( Arrays.asList( "clean", "aggr", "install" ) );
        final MavenSession session = new MavenSession( null, null, mavenExecutionRequest, defaultMavenExecutionResult );
        final ProjectDependencyGraphStub dependencyGraphStub = new ProjectDependencyGraphStub();
        session.setProjectDependencyGraph( dependencyGraphStub );
        session.setProjects( dependencyGraphStub.getSortedProjects() );
        return session;
View Full Code Here

Examples of org.apache.maven.execution.DefaultMavenExecutionRequest

        CliRequest( String[] args, ClassWorld classWorld )
        {
            this.args = args;
            this.classWorld = classWorld;
            this.request = new DefaultMavenExecutionRequest();
        }
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.