Package org.apache.maven.continuum.model.system

Examples of org.apache.maven.continuum.model.system.Profile


    protected abstract Map<String, String> getEnvironments( BuildDefinition buildDefinition );

    protected String getJavaHomeValue( BuildDefinition buildDefinition )
    {
        Profile profile = buildDefinition.getProfile();
        if ( profile == null )
        {
            return null;
        }
        Installation jdk = profile.getJdk();
        if ( jdk == null )
        {
            return null;
        }
        return jdk.getVarValue();
View Full Code Here


        return true;
    }

    protected Map<String, String> getEnvironmentVariables( BuildDefinition buildDefinition )
    {
        Profile profile = buildDefinition.getProfile();
        Map<String, String> envVars = new HashMap<String, String>();
        if ( profile == null )
        {
            return envVars;
        }
        List<Installation> environmentVariables = profile.getEnvironmentVariables();
        if ( environmentVariables.isEmpty() )
        {
            return envVars;
        }
        for ( Installation installation : environmentVariables )
View Full Code Here

     * @see org.apache.maven.continuum.profile.ProfileService#setBuilderInProfile(org.apache.maven.continuum.model.system.Profile,org.apache.maven.continuum.model.system.Installation)
     */
    public void setBuilderInProfile( Profile profile, Installation builder )
        throws ProfileException
    {
        Profile stored = getProfile( profile.getId() );
        stored.setBuilder( builder );
        try
        {
            profileDao.updateProfile( stored );
        }
        catch ( ContinuumStoreException e )
View Full Code Here

     * @see org.apache.maven.continuum.profile.ProfileService#setJdkInProfile(org.apache.maven.continuum.model.system.Profile,org.apache.maven.continuum.model.system.Installation)
     */
    public void setJdkInProfile( Profile profile, Installation jdk )
        throws ProfileException
    {
        Profile stored = getProfile( profile.getId() );
        stored.setJdk( jdk );
        try
        {
            profileDao.updateProfile( stored );
        }
        catch ( ContinuumStoreException e )
View Full Code Here

     * @see org.apache.maven.continuum.profile.ProfileService#addEnvVarInProfile(org.apache.maven.continuum.model.system.Profile,org.apache.maven.continuum.model.system.Installation)
     */
    public void addEnvVarInProfile( Profile profile, Installation envVar )
        throws ProfileException
    {
        Profile stored = getProfile( profile.getId() );
        stored.addEnvironmentVariable( envVar );
        try
        {
            profileDao.updateProfile( stored );
        }
        catch ( ContinuumStoreException e )
View Full Code Here

    }

    public void removeInstallationFromProfile( Profile profile, Installation installation )
        throws ProfileException
    {
        Profile stored = getProfile( profile.getId() );
        if ( InstallationService.JDK_TYPE.equals( installation.getType() ) )
        {
            stored.setJdk( null );
        }
        else if ( InstallationService.MAVEN1_TYPE.equals( installation.getType() ) ||
            InstallationService.MAVEN2_TYPE.equals( installation.getType() ) ||
            InstallationService.ANT_TYPE.equals( installation.getType() ) )
        {
            stored.setBuilder( null );
        }
        else
        {
            // remove one
            List<Installation> storedEnvVars = stored.getEnvironmentVariables();
            List<Installation> newEnvVars = new ArrayList<Installation>();
            for ( Installation storedInstallation : storedEnvVars )
            {
                if ( !StringUtils.equals( storedInstallation.getName(), installation.getName() ) )
                {
                    newEnvVars.add( storedInstallation );
                }
            }
            stored.setEnvironmentVariables( newEnvVars );
        }
        try
        {
            updateProfileCheckDuplicateName( stored, false );
        }
View Full Code Here

     * @throws ProfileException
     */
    public boolean alreadyExistsProfileName( Profile profile )
        throws ProfileException
    {
        Profile storedProfile = getProfileWithName( profile.getName() );
        return ( storedProfile != null && storedProfile.getId() != profile.getId() );
    }
View Full Code Here

    public String save()
        throws Exception
    {
        try
        {
            Profile stored = profileService.getProfile( profile.getId() );

            if ( StringUtils.isBlank( profile.getName() ) )
            {
                if ( stored != null )
                {
View Full Code Here

        throws Exception
    {
        continuumMock = mock( Continuum.class );
        configurationServiceMock = mock( ConfigurationService.class );

        Profile profile = new Profile();
        profile.setBuildAgentGroup( "BUILDAGENT_GROUP" );
       
        action = new ReleaseActionStub();
        action.setProfile( profile );
        action.setDefaultBuildagent( defaultBuildagentUrl );
        action.setContinuum( (Continuum) continuumMock.proxy() );
View Full Code Here

        return executeShellCommand( project, executable, arguments.toString(), buildOutput, environments );
    }

    protected Map<String, String> getEnvironments( BuildDefinition buildDefinition )
    {
        Profile profile = buildDefinition.getProfile();
        if ( profile == null )
        {
            return Collections.EMPTY_MAP;
        }
        Map<String, String> envVars = new HashMap<String, String>();
        String javaHome = getJavaHomeValue( buildDefinition );
        if ( !StringUtils.isEmpty( javaHome ) )
        {
            envVars.put( getInstallationService().getEnvVar( InstallationService.JDK_TYPE ), javaHome );
        }
        Installation builder = profile.getBuilder();
        if ( builder != null )
        {
            envVars.put( getInstallationService().getEnvVar( InstallationService.MAVEN1_TYPE ), builder.getVarValue() );
        }
        envVars.putAll( getEnvironmentVariables( buildDefinition ) );
View Full Code Here

TOP

Related Classes of org.apache.maven.continuum.model.system.Profile

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.