Package org.apache.maven.profiles

Examples of org.apache.maven.profiles.DefaultProfileManager


        {
            IOUtil.close( writer );
        }

        String baseDirectory = dir.getAbsolutePath();
        ProfileManager globalProfileManager = new DefaultProfileManager( getContainer(), new Properties() );

        boolean showErrors = false;
        Properties userProperties = new Properties();

        MavenExecutionRequest req =
View Full Code Here


            session.getExecutionProperties().putAll(phaseCall.getProperties());
            //project.getProperties().putAll(commandCall.getProperties());

            session.setCurrentProject(currentProject);
            session.getSettings().setOffline(phaseCall.isOffline() ? true : pluginExecutionOfflineMode);
            ProfileManager profileManager = new DefaultProfileManager(session.getContainer(), phaseCall.getProperties());
            profileManager.explicitlyActivate(phaseCall.getProfiles());

            Settings settings = session.getSettings();
           
            Class<DefaultMavenExecutionRequest> merClass = DefaultMavenExecutionRequest.class;
            Constructor[] ctrs = merClass.getConstructors();

            MavenExecutionRequest request = null;
            Method pomMethod = null;
            if(ctrs[0].getParameterTypes().length < 1)
            {
                request = merClass.newInstance();
               
                request.setLocalRepository(session.getLocalRepository())
                       .setOffline( session.isOffline() )
                       .setRemoteRepositories(project.getRemoteArtifactRepositories())
                       .setPluginArtifactRepositories(project.getPluginArtifactRepositories())
                       .setInteractiveMode( settings.isInteractiveMode() )
                       .setProxies( settings.getProxies() )
                       .setServers( settings.getServers() )
                       .setMirrors( settings.getMirrors() )
                       .setPluginGroups( session.getPluginGroups() )
                       .setGoals( phaseCall.getPhases() )
                       .setSystemProperties( session.getSystemProperties() )
                       .setUserProperties( session.getUserProperties() )
                       .setActiveProfiles( profileManager.getActiveProfiles() );

                pomMethod = request.getClass().getMethod("setPom",File.class);
                pomMethod.invoke(request,new File(currentProject.getBasedir(), "pom.xml"));
            }
            else
View Full Code Here

                // Ideally, we could use Warn across the board
                loggerManager.setThreshold( Logger.LEVEL_ERROR );
                // TODO:Additionally, we can't change the mojo level because the component key includes the version and it isn't known ahead of time. This seems worth changing.
            }

            ProfileManager profileManager = new DefaultProfileManager( embedder.getContainer(), executionProperties );

            if ( commandLine.hasOption( CLIManager.ACTIVATE_PROFILES ) )
            {
                String profilesLine = commandLine.getOptionValue( CLIManager.ACTIVATE_PROFILES );

                StringTokenizer profileTokens = new StringTokenizer( profilesLine, "," );

                while ( profileTokens.hasMoreTokens() )
                {
                    String profileAction = profileTokens.nextToken().trim();

                    if ( profileAction.startsWith( "-" ) )
                    {
                        profileManager.explicitlyDeactivate( profileAction.substring( 1 ) );
                    }
                    else if ( profileAction.startsWith( "+" ) )
                    {
                        profileManager.explicitlyActivate( profileAction.substring( 1 ) );
                    }
                    else
                    {
                        // TODO: deprecate this eventually!
                        profileManager.explicitlyActivate( profileAction );
                    }
                }
            }

            request = createRequest( commandLine, settings, eventDispatcher, loggerManager, profileManager,
View Full Code Here

    // what is using this externally? jvz.
    public MavenProject buildStandaloneSuperProject( ArtifactRepository localRepository )
        throws ProjectBuildingException
    {
        //TODO mkleint - use the (Container, Properties) constructor to make system properties embeddable
        ProfileManager profileManager = new DefaultProfileManager( container );

        return buildStandaloneSuperProject( new DefaultProjectBuilderConfiguration().setLocalRepository( localRepository )
                                                                                    .setGlobalProfileManager( profileManager ) );
    }
View Full Code Here

        ProfileManager profileManager = config.getGlobalProfileManager();

        if ( profileManager == null )
        {
            profileManager = new DefaultProfileManager( container );
        }

        profileManager.addProfiles( superModel.getProfiles() );

        String projectId = safeVersionlessKey( STANDALONE_SUPERPOM_GROUPID, STANDALONE_SUPERPOM_ARTIFACTID );
View Full Code Here

        ProfileManager externalProfileManager = config.getGlobalProfileManager();
        ProfileManager superProjectProfileManager;
        if ( externalProfileManager != null )
        {
            superProjectProfileManager = new DefaultProfileManager(
                                                                    container,
                                                                    externalProfileManager.getRequestProperties() );
        }
        else
        {
            superProjectProfileManager = new DefaultProfileManager( container );
        }

        List activeProfiles;

        superProjectProfileManager.addProfiles( superModel.getProfiles() );
View Full Code Here

        ProfileManager externalProfileManager = config.getGlobalProfileManager();
        ProfileManager profileManager;
        if ( externalProfileManager != null )
        {
            profileManager = new DefaultProfileManager( container, externalProfileManager.getRequestProperties() );
        }
        else
        {
            //TODO mkleint - use the (Container, Properties constructor to make system properties embeddable
            profileManager = new DefaultProfileManager( container );
        }

        if ( externalProfileManager != null )
        {
            profileManager.explicitlyActivate( externalProfileManager.getExplicitlyActivatedIds() );
View Full Code Here

    // what is using this externally? jvz.
    public MavenProject buildStandaloneSuperProject( ArtifactRepository localRepository )
        throws ProjectBuildingException
    {
        //TODO mkleint - use the (Container, Properties) constructor to make system properties embeddable
        ProfileManager profileManager = new DefaultProfileManager( container );

        return buildStandaloneSuperProject( new DefaultProjectBuilderConfiguration().setLocalRepository( localRepository )
                                                                                    .setGlobalProfileManager( profileManager ) );
    }
View Full Code Here

        ProfileManager profileManager = config.getGlobalProfileManager();

        if ( profileManager == null )
        {
            profileManager = new DefaultProfileManager( container );
        }

        profileManager.addProfiles( superModel.getProfiles() );

        String projectId = safeVersionlessKey( STANDALONE_SUPERPOM_GROUPID, STANDALONE_SUPERPOM_ARTIFACTID );
View Full Code Here

        ProfileManager externalProfileManager = config.getGlobalProfileManager();
        ProfileManager superProjectProfileManager;
        if ( externalProfileManager != null )
        {
            superProjectProfileManager = new DefaultProfileManager(
                                                                    container,
                                                                    externalProfileManager.getRequestProperties() );
        }
        else
        {
            superProjectProfileManager = new DefaultProfileManager( container );
        }

        List activeProfiles;

        superProjectProfileManager.addProfiles( superModel.getProfiles() );
View Full Code Here

TOP

Related Classes of org.apache.maven.profiles.DefaultProfileManager

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.