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

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


        }

        Map<Integer, Installation> installations = new HashMap<Integer, Installation>();
        for ( Iterator i = database.getInstallations().iterator(); i.hasNext(); )
        {
            Installation installation = (Installation) i.next();

            installation = (Installation) PlexusJdoUtils.addObject( pmf.getPersistenceManager(), installation );
            installations.put( Integer.valueOf( installation.getInstallationId() ), installation );
        }

        Map<Integer, Profile> profiles = new HashMap<Integer, Profile>();
        for ( Iterator i = database.getProfiles().iterator(); i.hasNext(); )
        {
            Profile profile = (Profile) i.next();

            // process installations
            if ( profile.getJdk() != null )
            {
                profile.setJdk( installations.get( profile.getJdk().getInstallationId() ) );
            }
            if ( profile.getBuilder() != null )
            {
                profile.setBuilder( installations.get( profile.getBuilder().getInstallationId() ) );
            }
            List environmentVariables = new ArrayList();
            for ( Iterator envIt = profile.getEnvironmentVariables().listIterator(); envIt.hasNext(); )
            {
                Installation installation = (Installation) envIt.next();
                environmentVariables.add( installations.get( installation.getInstallationId() ) );
                envIt.remove();
            }
            profile.setEnvironmentVariables( environmentVariables );
            profile = (Profile) PlexusJdoUtils.addObject( pmf.getPersistenceManager(), profile );
            profiles.put( Integer.valueOf( profile.getId() ), profile );
View Full Code Here


        String javaHome = getJavaHomeValue( buildDefinition );
        if ( !StringUtils.isEmpty( javaHome ) )
        {
            envVars.put( installationService.getEnvVar( InstallationService.JDK_TYPE ), javaHome );
        }
        Installation builder = profile.getBuilder();
        if ( builder != null )
        {
            envVars.put( installationService.getEnvVar( installationType ), builder.getVarValue() );
        }
        envVars.putAll( getEnvironmentVariables( buildDefinition ) );
        return envVars;
    }
View Full Code Here

        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

        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 ) );
        return envVars;

    }
View Full Code Here

    {
        super.setUp();
        DaoUtils daoUtils = (DaoUtils) lookup( DaoUtils.class.getName() );
        daoUtils.eraseDatabase();

        jdk1 = new Installation();
        jdk1.setType( InstallationService.JDK_TYPE );
        jdk1.setVarValue( "/foo/bar" );
        jdk1.setName( jdk1Name );
        jdk1 = getInstallationService().add( jdk1 );

        jdk2 = new Installation();
        jdk2.setType( InstallationService.JDK_TYPE );
        jdk2.setVarValue( "/foo/bar/zloug" );
        jdk2.setName( jdk2Name );
        jdk2 = getInstallationService().add( jdk2 );

        mvn205 = new Installation();
        mvn205.setType( InstallationService.MAVEN2_TYPE );
        mvn205.setVarValue( "/users/maven-2.0.5" );
        mvn205.setName( mvn205Name );
        mvn205 = getInstallationService().add( mvn205 );

        mvn206 = new Installation();
        mvn206.setType( InstallationService.MAVEN2_TYPE );
        mvn206.setVarValue( "/users/maven-2.0.6" );
        mvn206.setName( mvn206Name );
        mvn206 = getInstallationService().add( mvn206 );

        jdk1mvn205 = new Profile();
        jdk1mvn205.setJdk( jdk1 );
        jdk1mvn205.setBuilder( mvn205 );
        jdk1mvn205.setName( jdk1mvn205Name );
        getProfileService().addProfile( jdk1mvn205 );

        jdk2mvn206 = new Profile();
        jdk2mvn206.setJdk( jdk2 );
        jdk2mvn206.setBuilder( mvn206 );
        jdk2mvn206.setName( jdk2mvn206Name );
        getProfileService().addProfile( jdk2mvn206 );

        mvnOpts1 = new Installation();
        mvnOpts1.setType( InstallationService.ENVVAR_TYPE );
        mvnOpts1.setVarName( "MAVEN_OPTS" );
        mvnOpts1.setVarValue( "-Xmx256m -Djava.awt.headless=true" );
        mvnOpts1.setName( mvnOpts1Name );
        mvnOpts1 = getInstallationService().add( mvnOpts1 );

        mvnOpts2 = new Installation();
        mvnOpts2.setType( InstallationService.ENVVAR_TYPE );
        mvnOpts2.setVarName( "MAVEN_OPTS" );
        mvnOpts2.setVarValue( "-Xmx1024m -Xms1024m" );
        mvnOpts2.setName( mvnOpts2Name );
        mvnOpts2 = getInstallationService().add( mvnOpts2 );
View Full Code Here

        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.MAVEN2_TYPE ), builder.getVarValue() );
        }
        envVars.putAll( getEnvironmentVariables( buildDefinition ) );
        return envVars;

    }
View Full Code Here

    private List<String> getBuilderVersion( BuildDefinition buildDefinition, Project project )
        throws InstallationException
    {
        ExecutorConfigurator executorConfigurator;
        Installation builder = null;
        Profile profile = null;
        if ( buildDefinition != null )
        {
            profile = buildDefinition.getProfile();
            if ( profile != null )
            {
                builder = profile.getBuilder();
            }
        }
        if ( builder != null )
        {
            executorConfigurator = continuum.getInstallationService().getExecutorConfigurator( builder.getType() );
        }
        else
        {
            // depends on ExecutorId
            if ( MavenTwoBuildExecutor.ID.equals( project.getExecutorId() ) )
            {
                executorConfigurator = continuum.getInstallationService().getExecutorConfigurator(
                    InstallationService.MAVEN2_TYPE );
            }
            else if ( MavenOneBuildExecutor.ID.equals( project.getExecutorId() ) )
            {
                executorConfigurator = continuum.getInstallationService().getExecutorConfigurator(
                    InstallationService.MAVEN1_TYPE );
            }
            else if ( AntBuildExecutor.ID.equals( project.getExecutorId() ) )
            {
                executorConfigurator = continuum.getInstallationService().getExecutorConfigurator(
                    InstallationService.ANT_TYPE );
            }
            else
            {
                return Arrays.asList( "No builder defined" );
            }
        }

        return continuum.getInstallationService().getExecutorConfiguratorVersion(
            builder == null ? null : builder.getVarValue(), executorConfigurator, profile );
    }
View Full Code Here

                List<Map<String, String>> installationsList = client.getAvailableInstallations();

                for ( Map context : installationsList )
                {
                    Installation installation = new Installation();
                    installation.setName( ContinuumBuildConstant.getInstallationName( context ) );
                    installation.setType( ContinuumBuildConstant.getInstallationType( context ) );
                    installation.setVarName( ContinuumBuildConstant.getInstallationVarName( context ) );
                    installation.setVarValue( ContinuumBuildConstant.getInstallationVarValue( context ) );
                    installations.add( installation );
                }
            }
            else
            {
View Full Code Here

        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.ANT_TYPE ), builder.getVarValue() );
        }
        envVars.putAll( getEnvironmentVariables( buildDefinition ) );
        return envVars;

    }
View Full Code Here

    private Installation addInstallation( String name, String varName, String varValue, String type )
        throws Exception
    {

        Installation installation = new Installation();
        installation.setType( type );
        installation.setName( name );
        installation.setVarName( varName );
        installation.setVarValue( varValue );
        return getInstallationService().add( installation );
    }
View Full Code Here

TOP

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

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.