Package org.apache.maven.continuum.project.builder

Examples of org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult


        File rootPom = getTestFile( "src/test/resources/projects/continuum/continuum-core/pom.xml" );

        assertTrue( rootPom.exists() );
        //String url = getTestFile( "src/test-projects/project1/pom.xml" ).toURL().toExternalForm();
        ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
                                                                                   rootPom.toURI().toURL()
                                                                                       .toExternalForm(), pg.getId(),
                                                                                   true, false, false, bdt.getId() );
        assertNotNull( result );

        assertEquals( 1, result.getProjects().size() );

        Project project = result.getProjects().get( 0 );
        project = getContinuum().getProjectWithBuildDetails( project.getId() );
        assertNotNull( project );
        pg = getContinuum().getProjectGroupWithBuildDetails( pg.getId() );
        log.info( "project buildDef list size : " + project.getBuildDefinitions().size() );
        // project with the build def coming from template
View Full Code Here


        //bdt = bds.addBuildDefinitionInTemplate( bdt, bd, true );
        File rootPom = getTestFile( "src/test/resources/projects/continuum/continuum-core/pom.xml" );

        assertTrue( rootPom.exists() );

        ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
                                                                                   rootPom.toURI().toURL()
                                                                                       .toExternalForm(), -1, true,
                                                                                   false, true, bdt.getId() );
        assertNotNull( result );

        assertEquals( 1, result.getProjects().size() );
        Project project = result.getProjects().get( 0 );
        assertNotNull( project );
        project = getContinuum().getProjectWithBuildDetails( project.getId() );
        log.info( "project buildDef list size : " + project.getBuildDefinitions().size() );
        // build def only at the group level du to group creation
        assertEquals( 0, project.getBuildDefinitions().size() );
       
        log.info( "all pg size " + getContinuum().getAllProjectGroups().size() );
        ProjectGroup pg = result.getProjectGroups().get( 0 );

        pg = getContinuum().getProjectGroupWithBuildDetails( pg.getId() );

        log.info( " pg groupId " + pg.getGroupId() );
        //@ group level the db from template must be used
View Full Code Here

        //bdt = bds.addBuildDefinitionInTemplate( bdt, bd, true );
        File rootPom = getTestFile( "src/test/resources/projects/continuum/continuum-core/pom.xml" );

        assertTrue( rootPom.exists() );

        ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
                                                                                   rootPom.toURI().toURL()
                                                                                       .toExternalForm(), -1, true,
                                                                                   false, true, -1 );
        assertNotNull( result );

        assertEquals( 1, result.getProjects().size() );

        Project project = result.getProjects().get( 0 );
        assertNotNull( project );
       
        assertNotNull( project );
        project = getContinuum().getProjectWithBuildDetails( project.getId() );
        log.info( "project buildDef list size : " + project.getBuildDefinitions().size() );
        // only build def at group level
        assertEquals( 0, project.getBuildDefinitions().size() );
       
        log.info( "all pg size " + getContinuum().getAllProjectGroups().size() );
        ProjectGroup pg = result.getProjectGroups().get( 0 );

        log.info( getContinuum().getAllProjectGroups().toString() );
        log.info( " pg id " + Integer.toString( pg.getId() ) );

        pg = getContinuum().getProjectGroupWithBuildDetails( pg.getId() );
View Full Code Here

        File rootPom = getTestFile( "src/test/resources/projects/continuum/continuum-core/pom.xml" );

        assertTrue( rootPom.exists() );
        //String url = getTestFile( "src/test-projects/project1/pom.xml" ).toURL().toExternalForm();
        ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
                                                                                   rootPom.toURI().toURL()
                                                                                       .toExternalForm(), pg.getId(),
                                                                                   true, false, false, -1 );
        assertNotNull( result );

        assertEquals( 1, result.getProjects().size() );

        Project project = result.getProjects().get( 0 );
        project = getContinuum().getProjectWithBuildDetails( project.getId() );
        assertNotNull( project );
        pg = getContinuum().getProjectGroupWithBuildDetails( pg.getId() );
        log.info( "project buildDef list size : " + project.getBuildDefinitions().size() );
        assertEquals( 0, project.getBuildDefinitions().size() );
        pg = result.getProjectGroups().get( 0 );

        pg = getContinuum().getProjectGroupWithBuildDetails( pg.getId() );
       
        assertEquals( "clean install", ( (BuildDefinition) pg.getBuildDefinitions().get( 0 ) ).getGoals() );
    }
View Full Code Here

    protected ContinuumProjectBuildingResult doExecute( String pomUrl, int selectedProjectGroup, boolean checkProtocol,
                                                        boolean scmUseCache )
        throws ContinuumException
    {
        ContinuumProjectBuildingResult result = null;

        // TODO: remove this part once uploading of an m2 project with modules is supported ( CONTINUUM-1098 )
        if ( checkProtocol == false )
        {
            MavenXpp3Reader m2pomReader = new MavenXpp3Reader();

            try
            {
                String filePath = pomUrl;

                if ( !filePath.startsWith( FILE_SCHEME + "/" ) && filePath.startsWith( FILE_SCHEME ) )
                {
                    //Little hack for linux (CONTINUUM-1169)
                    filePath = StringUtils.replace( filePath, FILE_SCHEME, FILE_SCHEME + "/" );
                }

                if ( filePath.startsWith( FILE_SCHEME ) )
                {
                    filePath = filePath.substring( FILE_SCHEME.length() );
                }

                Model model = m2pomReader.read( new FileReader( filePath ) );

                List modules = model.getModules();

                if ( modules != null && modules.size() != 0 )
                {
                    result = new ContinuumProjectBuildingResult();
                    result.addError( ERROR_UPLOADING_M2_PROJECT_WITH_MODULES );
                }
            }
            catch ( FileNotFoundException e )
            {
                throw new ContinuumException( ERROR_READING_POM_EXCEPTION_MESSAGE, e );
View Full Code Here

    {
        // ----------------------------------------------------------------------
        // We need to roll the project data into a file so that we can use it
        // ----------------------------------------------------------------------

        ContinuumProjectBuildingResult result = new ContinuumProjectBuildingResult();

        try
        {
            readModules( url, result, true, username, password, null, loadRecursiveProjects, buildDefinitionTemplate );
        }
View Full Code Here

                addActionError( getText( "add.project.field.required.error" ) );
                return doDefault();
            }
        }

        ContinuumProjectBuildingResult result = doExecute( pom, selectedProjectGroup, checkProtocol, scmUseCache );

        if ( result.hasErrors() )
        {
            for ( String key : result.getErrors() )
            {
                String cause = result.getErrorsWithCause().get( key );
                String msg = getText( key, new String[] { cause } );

                // olamy : weird getText(key, String[]) must do that something like bla bla {0}
                // here an ugly hack for CONTINUUM-1675
                if ( key.equals( ContinuumProjectBuildingResult.ERROR_MISSING_SCM ) )
                {
                    msg = getResourceBundle().getString( key ) + " " + cause;
                }
                if ( !StringUtils.equals( msg, key ) )
                {
                    errorMessages.add( msg );
                }
                else
                {
                    addActionError( msg );
                }

            }

            return doDefault();
        }

        if ( this.getSelectedProjectGroup() > 0 )
        {
            this.setProjectGroupId( this.getSelectedProjectGroup() );
            return "projectGroupSummary";
        }

        if ( result.getProjectGroups() != null && !result.getProjectGroups().isEmpty() )
        {
            this.setProjectGroupId( ( (ProjectGroup) result.getProjectGroups().get( 0 ) ).getId() );
            return "projectGroupSummary";
        }

        return SUCCESS;
    }
View Full Code Here

       
        String fileUrl = rootPom.toURL().toExternalForm();
       
        //assertTrue( validator.validate( fileUrl ) );
       
        ContinuumProjectBuildingResult result = continuum.addMavenTwoProject( rootPom.toURI().toURL()
                                                                              .toExternalForm(), -1, true,
                                                                              false, true, -1 );

        assertNotNull( result );

        assertEquals( "result.warnings.size", 0, result.getWarnings().size() );

        assertEquals( "result.projects.size", 3, result.getProjects().size() );

        assertEquals( "result.projectGroups.size", 1, result.getProjectGroups().size() );

        log.info( "number of projects: " + getProjectDao().getAllProjectsByName().size() );

        log.info(
            "number of project groups: " + getProjectGroupDao().getAllProjectGroupsWithProjects().size() );
View Full Code Here

        // Test projects with duplicate names
        // ----------------------------------------------------------------------

        String url = getTestFile( "src/test-projects/project1/pom.xml" ).toURL().toExternalForm();

        ContinuumProjectBuildingResult result = continuum.addMavenTwoProject( url );

        assertNotNull( result );

        List projects = result.getProjects();

        assertEquals( 1, projects.size() );

        assertEquals( Project.class, projects.get( 0 ).getClass() );
View Full Code Here

    {
        Continuum continuum = (Continuum) lookup( Continuum.ROLE );

        String url = getTestFile( "src/test-projects/project1/pom.xml" ).toURL().toExternalForm();

        ContinuumProjectBuildingResult result = continuum.addMavenTwoProject( url );

        assertNotNull( result );

        List projects = result.getProjects();

        assertEquals( 1, projects.size() );

        assertEquals( Project.class, projects.get( 0 ).getClass() );
View Full Code Here

TOP

Related Classes of org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult

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.