Package org.apache.maven.continuum.model.project

Examples of org.apache.maven.continuum.model.project.BuildDefinitionTemplate


    }

    public BuildDefinitionTemplate getDefaultShellBuildDefinitionTemplate()
        throws BuildDefinitionServiceException
    {
        BuildDefinitionTemplate template =
            getContinuumDefaultWithType( ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR );
        if ( template != null )
        {
            return template;
        }
        log.info( "create default ShellBuildDefinitionTemplate" );
        template = new BuildDefinitionTemplate();
        template.setContinuumDefault( true );
        template.setName( "Default Shell Template" );
        template.setType( ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR );

        template = addBuildDefinitionTemplate( template );

        BuildDefinition bd = new BuildDefinition();
View Full Code Here


    public BuildDefinitionTemplate updateBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate )
        throws BuildDefinitionServiceException
    {
        try
        {
            BuildDefinitionTemplate stored = getBuildDefinitionTemplate( buildDefinitionTemplate.getId() );
            stored.setName( buildDefinitionTemplate.getName() );
            stored.setBuildDefinitions( buildDefinitionTemplate.getBuildDefinitions() );
            return buildDefinitionTemplateDao.updateBuildDefinitionTemplate( stored );
        }
        catch ( ContinuumStoreException e )
        {
            throw new BuildDefinitionServiceException( e.getMessage(), e );
View Full Code Here

                                                                 BuildDefinition buildDefinition, boolean template )
        throws BuildDefinitionServiceException
    {
        try
        {
            BuildDefinitionTemplate stored = getBuildDefinitionTemplate( buildDefinitionTemplate.getId() );
            stored.setName( buildDefinitionTemplate.getName() );
            BuildDefinition storedBuildDefinition = getBuildDefinition( buildDefinition.getId() );
            if ( storedBuildDefinition != null )
            {
                buildDefinition = storedBuildDefinition;
            }
            buildDefinition.setTemplate( template );
            //stored.addBuildDefinition( addBuildDefinition( buildDefinition ) );
            stored.addBuildDefinition( buildDefinition );
            return buildDefinitionTemplateDao.updateBuildDefinitionTemplate( stored );
        }
        catch ( ContinuumStoreException e )
        {
            throw new BuildDefinitionServiceException( e.getMessage(), e );
View Full Code Here

                                                                      BuildDefinition buildDefinition )
        throws BuildDefinitionServiceException
    {
        try
        {
            BuildDefinitionTemplate stored = getBuildDefinitionTemplate( buildDefinitionTemplate.getId() );
            stored.setName( buildDefinitionTemplate.getName() );
            List<BuildDefinition> buildDefinitions = new ArrayList<BuildDefinition>();
            for ( int i = 0, size = stored.getBuildDefinitions().size(); i < size; i++ )
            {
                BuildDefinition buildDef = (BuildDefinition) stored.getBuildDefinitions().get( i );
                if ( buildDef.getId() != buildDefinition.getId() )
                {
                    buildDefinitions.add( getBuildDefinition( buildDef.getId() ) );
                }
            }
            stored.setBuildDefinitions( buildDefinitions );
            return buildDefinitionTemplateDao.updateBuildDefinitionTemplate( stored );
        }
        catch ( ContinuumStoreException e )
        {
            throw new BuildDefinitionServiceException( e.getMessage(), e );
View Full Code Here

    public void addTemplateInProject( int buildDefinitionTemplateId, Project project )
        throws BuildDefinitionServiceException
    {
        try
        {
            BuildDefinitionTemplate template = getBuildDefinitionTemplate( buildDefinitionTemplateId );
            if ( template.getBuildDefinitions().isEmpty() )
            {
                return;
            }
            project = projectDao.getProjectWithBuildDetails( project.getId() );
            List<BuildDefinition> buildDefs = new ArrayList<BuildDefinition>();
            for ( Iterator<BuildDefinition> iterator = template.getBuildDefinitions().iterator(); iterator.hasNext(); )
            {
                BuildDefinition bd = iterator.next();
                bd = cloneBuildDefinition( bd );
                bd.setTemplate( false );
                bd = buildDefinitionDao.addBuildDefinition( bd );
View Full Code Here

    public void execute( Map map )
        throws Exception
    {
        int projectGroupId = getProjectGroupId( map );
        ProjectGroup projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
        BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate( map );
        if ( buildDefinitionTemplate != null )
        {
            for ( Iterator<BuildDefinition> iterator = buildDefinitionTemplate.getBuildDefinitions().iterator();
                  iterator.hasNext(); )
            {
                BuildDefinition buildDefinition = iterator.next();
                resolveDefaultBuildDefinitionsForProjectGroup( buildDefinition, projectGroup );
View Full Code Here

        try
        {
            if ( executorId.equalsIgnoreCase( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR ) )
            {
                BuildDefinitionTemplate bdt = null;
                if ( buildDefintionTemplateId <= 0 )
                {
                    bdt = buildDefinitionService.getDefaultAntBuildDefinitionTemplate();
                }
                else
                {
                    bdt = buildDefinitionService.getBuildDefinitionTemplate( buildDefintionTemplateId );
                }
                buildDefinitions = bdt.getBuildDefinitions();
            }
            else
            {
                //shell default

                BuildDefinitionTemplate bdt = null;
                if ( buildDefintionTemplateId <= 0 )
                {
                    bdt = buildDefinitionService.getDefaultShellBuildDefinitionTemplate();
                }
                else
                {
                    bdt = buildDefinitionService.getBuildDefinitionTemplate( buildDefintionTemplateId );
                }
                buildDefinitions = bdt.getBuildDefinitions();
            }
            for ( BuildDefinition buildDefinition : buildDefinitions )
            {

                BuildDefinition cloned = buildDefinitionService.cloneBuildDefinition( buildDefinition );
View Full Code Here

        int all = buildDefinitionDao.getAllBuildDefinitions().size();
        BuildDefinition buildDefinition = new BuildDefinition();
        buildDefinition.setBuildFile( "pom.xml" );
        buildDefinition.setGoals( "clean" );
        buildDefinition.setTemplate( true );
        BuildDefinitionTemplate template = new BuildDefinitionTemplate();
        template.setName( "test" );
        template.setContinuumDefault( true );
        template.setType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );
        template = buildDefinitionTemplateDao.addBuildDefinitionTemplate( template );
        buildDefinition = buildDefinitionDao.addBuildDefinition( buildDefinition );

        template.addBuildDefinition( buildDefinition );

        template = buildDefinitionTemplateDao.updateBuildDefinitionTemplate( template );

        assertEquals( "test", template.getName() );
        assertTrue( template.isContinuumDefault() );
        assertEquals( 1, template.getBuildDefinitions().size() );
        assertEquals( all + 1, buildDefinitionDao.getAllBuildDefinitions().size() );
        assertEquals( 1, buildDefinitionTemplateDao.getAllBuildDefinitionTemplate().size() );

        template = buildDefinitionTemplateDao
            .getContinuumBuildDefinitionTemplateWithType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );

        assertNotNull( template );
        assertEquals( 1, template.getBuildDefinitions().size() );

        assertEquals( 1, buildDefinitionTemplateDao.getAllBuildDefinitionTemplate().size() );
    }
View Full Code Here

        bd.setBuildFile( "pom.xml" );

        bd.setType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );

        BuildDefinitionTemplate bdt = new BuildDefinitionTemplate();
        bdt.addBuildDefinition( bd );
        return bdt;
    }
View Full Code Here

    public String save()
        throws Exception
    {
        List<BuildDefinition> selectedBuildDefinitions = getBuildDefinitionsFromSelectedBuildDefinitions();
       
        BuildDefinitionTemplate result;
       
        AuditLog event = new AuditLog( buildDefinitionTemplate.getName(), AuditLogConstants.ADD_TEMPLATE );
        event.setCategory( AuditLogConstants.TEMPLATE );
        event.setCurrentUser( getPrincipal() );
View Full Code Here

TOP

Related Classes of org.apache.maven.continuum.model.project.BuildDefinitionTemplate

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.