Examples of DefaultProjectBuildingRequest


Examples of org.apache.maven.project.DefaultProjectBuildingRequest

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

         request = new DefaultProjectBuildingRequest();
         ArtifactRepository localRepository = new MavenArtifactRepository(
                  "local", new File(settings.getLocalRepository()).toURI().toURL().toString(),
                  container.lookup(ArtifactRepositoryLayout.class),
                  new ArtifactRepositoryPolicy(true, ArtifactRepositoryPolicy.UPDATE_POLICY_NEVER,
                           ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN),
View Full Code Here

Examples of org.apache.maven.project.DefaultProjectBuildingRequest

    //TODO: this does not belong here.
    public ProjectBuildingRequest getProjectBuildingRequest()
    {
        if ( projectBuildingRequest == null )
        {
            projectBuildingRequest = new DefaultProjectBuildingRequest();
            projectBuildingRequest.setLocalRepository( getLocalRepository() );
            projectBuildingRequest.setSystemProperties( getSystemProperties() );
            projectBuildingRequest.setUserProperties( getUserProperties() );
            projectBuildingRequest.setRemoteRepositories( getRemoteRepositories() );
            projectBuildingRequest.setPluginArtifactRepositories( getPluginArtifactRepositories() );
View Full Code Here

Examples of org.apache.maven.project.DefaultProjectBuildingRequest

            }
            else
            {
                try
                {
                    ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
                    configuration.setRepositoryCache( repositoryRequest.getCache() );
                    configuration.setLocalRepository( repositoryRequest.getLocalRepository() );
                    configuration.setRemoteRepositories( repositoryRequest.getRemoteRepositories() );
                    configuration.setOffline( repositoryRequest.isOffline() );
                    configuration.setForceUpdate( repositoryRequest.isForceUpdate() );
                    configuration.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL );
                    configuration.setProcessPlugins( false );
                    configuration.setSystemProperties( getSystemProperties() );
                    configuration.setTransferListener( repositoryRequest.getTransferListener() );
                    configuration.setServers( repositoryRequest.getServers() );
                    configuration.setMirrors( repositoryRequest.getMirrors() );
                    configuration.setProxies( repositoryRequest.getProxies() );

                    project = getProjectBuilder().build( pomArtifact, configuration ).getProject();
                }
                catch ( ProjectBuildingException e )
                {
View Full Code Here

Examples of org.apache.maven.project.DefaultProjectBuildingRequest

    }

    private Model getArtifactModel(Artifact artifact) {
        org.apache.maven.artifact.Artifact mavenArtifact = artifactFactory.createArtifact(artifact.getGroupId(),artifact.getArtifactId(),artifact.getVersion(),"runtime",artifact.getExtension());

        DefaultProjectBuildingRequest req = new DefaultProjectBuildingRequest();
        req.setRepositorySession(session);
        req.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_STRICT);

        try {
            ProjectBuildingResult res = projectBuilder.build(mavenArtifact, req);

            return res.getProject().getModel();
View Full Code Here

Examples of org.apache.maven.project.DefaultProjectBuildingRequest

    }

    private Model getArtifactModel(Artifact artifact) {
        org.apache.maven.artifact.Artifact mavenArtifact = artifactFactory.createArtifact(artifact.getGroupId(),artifact.getArtifactId(),artifact.getVersion(),"runtime",artifact.getExtension());

        DefaultProjectBuildingRequest req = new DefaultProjectBuildingRequest();
        req.setRepositorySession(session);
        req.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_STRICT);

        try {
            ProjectBuildingResult res = projectBuilder.build(mavenArtifact, req);

            return res.getProject().getModel();
View Full Code Here

Examples of org.apache.maven.project.DefaultProjectBuildingRequest

    //TODO: this does not belong here.
    public ProjectBuildingRequest getProjectBuildingRequest()
    {
        if ( projectBuildingRequest == null )
        {
            projectBuildingRequest = new DefaultProjectBuildingRequest();
            projectBuildingRequest.setLocalRepository( getLocalRepository() );
            projectBuildingRequest.setSystemProperties( getSystemProperties() );
            projectBuildingRequest.setUserProperties( getUserProperties() );
            projectBuildingRequest.setRemoteRepositories( getRemoteRepositories() );
            projectBuildingRequest.setPluginArtifactRepositories( getPluginArtifactRepositories() );
View Full Code Here

Examples of org.apache.maven.project.DefaultProjectBuildingRequest

    {
        File pomFile = new File( testDirectory + File.separator + pomPath, "pom.xml" );
        File settingsFile = new File( testDirectory + File.separator + pomPath, "settings.xml" );
        Settings settings = readSettingsFile( settingsFile );

        ProjectBuildingRequest config = new DefaultProjectBuildingRequest();

        for ( org.apache.maven.settings.Profile rawProfile : settings.getProfiles() )
        {
            Profile profile = SettingsUtils.convertFromSettingsProfile( rawProfile );
            config.addProfile( profile );
        }

        String localRepoUrl =
            System.getProperty( "maven.repo.local", System.getProperty( "user.home" ) + "/.m2/repository" );
        localRepoUrl = "file://" + localRepoUrl;
        config.setLocalRepository( repositorySystem.createArtifactRepository( "local", localRepoUrl,
                                                                              new DefaultRepositoryLayout(), null, null ) );
        config.setActiveProfileIds( settings.getActiveProfiles() );

        return new PomTestWrapper( pomFile, projectBuilder.build( pomFile, config ).getProject() );
    }
View Full Code Here

Examples of org.apache.maven.project.DefaultProjectBuildingRequest

    protected MavenSession createMavenSession( File pom, Properties executionProperties )
        throws Exception
    {
        MavenExecutionRequest request = createMavenExecutionRequest( pom );
       
        ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest()
            .setLocalRepository( request.getLocalRepository() )
            .setRemoteRepositories( request.getRemoteRepositories() )
            .setPluginArtifactRepositories( request.getPluginArtifactRepositories() )
            .setSystemProperties( executionProperties );
View Full Code Here

Examples of org.apache.maven.project.DefaultProjectBuildingRequest

            }
            else
            {
                try
                {
                    ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
                    configuration.setRepositoryCache( repositoryRequest.getCache() );
                    configuration.setLocalRepository( repositoryRequest.getLocalRepository() );
                    configuration.setRemoteRepositories( repositoryRequest.getRemoteRepositories() );
                    configuration.setOffline( repositoryRequest.isOffline() );
                    configuration.setForceUpdate( repositoryRequest.isForceUpdate() );
                    configuration.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL );
                    configuration.setProcessPlugins( false );
                    configuration.setSystemProperties( getSystemProperties() );
                    configuration.setTransferListener( repositoryRequest.getTransferListener() );
                    configuration.setServers( repositoryRequest.getServers() );
                    configuration.setMirrors( repositoryRequest.getMirrors() );
                    configuration.setProxies( repositoryRequest.getProxies() );

                    project = getProjectBuilder().build( pomArtifact, configuration ).getProject();
                }
                catch ( ProjectBuildingException e )
                {
View Full Code Here

Examples of org.apache.maven.project.DefaultProjectBuildingRequest

            }
            else
            {
                try
                {
                    ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
                    configuration.setRepositoryCache( repositoryRequest.getCache() );
                    configuration.setLocalRepository( repositoryRequest.getLocalRepository() );
                    configuration.setRemoteRepositories( repositoryRequest.getRemoteRepositories() );
                    configuration.setOffline( repositoryRequest.isOffline() );
                    configuration.setForceUpdate( repositoryRequest.isForceUpdate() );
                    configuration.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL );
                    configuration.setProcessPlugins( false );
                    configuration.setSystemProperties( System.getProperties() );
                    configuration.setTransferListener( repositoryRequest.getTransferListener() );
                    configuration.setServers( repositoryRequest.getServers() );
                    configuration.setMirrors( repositoryRequest.getMirrors() );
                    configuration.setProxies( repositoryRequest.getProxies() );

                    project = getProjectBuilder().build( pomArtifact, configuration ).getProject();
                }
                catch ( ProjectBuildingException e )
                {
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.