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

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


        String curl = getUrl( context );

        URL url;

        ContinuumProjectBuilder projectBuilder = projectBuilderManager.getProjectBuilder( projectBuilderId );

        ContinuumProjectBuildingResult result;

        try
        {
            BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate( context );
            if ( buildDefinitionTemplate == null )
            {
                buildDefinitionTemplate = projectBuilder.getDefaultBuildDefinitionTemplate();
            }
            if ( !curl.startsWith( "http" ) )
            {
                url = new URL( curl );

                result = projectBuilder.buildProjectsFromMetadata( url, null, null, loadRecursiveProjects,
                                                                   buildDefinitionTemplate );

            }
            else
            {
                url = new URL( curl );
                String username = null;
                String password = null;

                try
                {
                    Settings settings = getSettings();

                    getLogger().info( "checking for settings auth setup" );
                    if ( settings != null && settings.getServer( url.getHost() ) != null )
                    {
                        getLogger().info( "found setting based auth setup, using" );
                        Server server = settings.getServer( url.getHost() );

                        username = server.getUsername();
                        password = server.getPassword();
                    }
                }
                catch ( SettingsConfigurationException se )
                {
                    getLogger().warn( "problem with settings file, disabling scm resolution of username and password" );
                }

                if ( username == null )
                {
                    URLUserInfo urlUserInfo = urlValidator.extractURLUserInfo( curl );
                    username = urlUserInfo.getUsername();
                    password = urlUserInfo.getPassword();
                }

                if ( urlValidator.isValid( curl ) )
                {

                    result = projectBuilder.buildProjectsFromMetadata( url, username, password, loadRecursiveProjects,
                                                                       buildDefinitionTemplate );

                }
                else
                {
View Full Code Here


    }

    public void testGetEmailAddressWhenTypeIsSetToEmail()
        throws Exception
    {
        ContinuumProjectBuilder projectBuilder =
            (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID );

        File pom = getTestFile( "src/test/repository/maven-builder-helper-1.xml" );

        ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata( pom.toURL(), null, null );

        assertNotNull( result.getErrors() );

        assertEquals( 0, result.getErrors().size() );
View Full Code Here

    }

    public void testGetEmailAddressWhenTypeIsntSet()
        throws Exception
    {
        ContinuumProjectBuilder projectBuilder =
            (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID );

        File pom = getTestFile( "src/test/repository/maven-builder-helper-2.xml" );

        ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata( pom.toURL(), null, null );

        assertNotNull( result.getErrors() );

        assertEquals( 0, result.getErrors().size() );
View Full Code Here

    }

    public void testGetScmUrlWithParams()
        throws Exception
    {
        ContinuumProjectBuilder projectBuilder =
            (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID );

        File pom = getTestFile( "src/test/repository/maven-builder-helper-3.xml" );

        ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata( pom.toURL(), null, null );

        assertNotNull( result.getErrors() );

        assertEquals( 0, result.getErrors().size() );
View Full Code Here

    }

    public void testCreateProjectsWithModules()
        throws Exception
    {
        ContinuumProjectBuilder projectBuilder =
            (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID );

        URL url = getClass().getClassLoader().getResource( "projects/continuum/pom.xml" );


        ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata( url, null, null );


        assertNotNull( result );

        // ----------------------------------------------------------------------
View Full Code Here

    }

    public void testCreateProjectsWithModuleswithParentPomIsntPomXml()
        throws Exception
    {
        ContinuumProjectBuilder projectBuilder =
            (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID );

        URL url = getClass().getClassLoader().getResource( "projects/continuum/pom_ci.xml" );

        ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata( url, null, null );

        assertNotNull( result );

        // ----------------------------------------------------------------------
        // Assert the warnings
View Full Code Here

    public void testCreateProjectWithoutModules()
        throws Exception
    {
       
       
        ContinuumProjectBuilder projectBuilder =
            (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID );

        URL url = getClass().getClassLoader().getResource( "projects/continuum/continuum-core/pom.xml" );

        BuildDefinition bd = new BuildDefinition();

        bd.setDefaultForProject( true );

        bd.setGoals( "clean test-compile" );

        bd.setArguments( "-N" );

        bd.setBuildFile( "pom.xml" );

        bd.setType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );
       
        BuildDefinitionService service = (BuildDefinitionService) lookup( BuildDefinitionService.class );
       
        bd = service.addBuildDefinition( bd );
        BuildDefinitionTemplate bdt = new BuildDefinitionTemplate();
        bdt.setName( "maven2" );
        bdt = service.addBuildDefinitionTemplate( bdt );
        bdt = service.addBuildDefinitionInTemplate( bdt, bd, false );
        assertEquals( 5, service.getAllBuildDefinitionTemplate().size() );
        logger.debug( "templates number " + service.getAllBuildDefinitionTemplate().size() );

        ContinuumStore store = (ContinuumStore) lookup( ContinuumStore.class , "jdo" );
        logger.debug( "projectGroups number " + store.getAllProjectGroups().size() );       
       
        int all = service.getAllBuildDefinitions().size();
       
        ContinuumProjectBuildingResult result;
       
        result = projectBuilder.buildProjectsFromMetadata( url, null, null, false, bdt );

        assertEquals( 5, service.getAllBuildDefinitionTemplate().size() );

        assertEquals( all + 1, service.getAllBuildDefinitions().size() );
       
View Full Code Here

        String curl = getString( context, KEY_URL );

        URL url;

        ContinuumProjectBuilder projectBuilder = projectBuilderManager.getProjectBuilder( projectBuilderId );

        ContinuumProjectBuildingResult result;

        try
        {
            if ( !curl.startsWith( "http" ) )
            {
                url = new URL( curl );

                result = projectBuilder.buildProjectsFromMetadata( url, null, null );
            }
            else
            {
                url = new URL( curl );
                String username = null;
                String password = null;

                try
                {
                    Settings settings = getSettings();

                    getLogger().info( "checking for settings auth setup" );
                    if ( settings != null && settings.getServer( url.getHost() ) != null )
                    {
                        getLogger().info( "found setting based auth setup, using" );
                        Server server = settings.getServer( url.getHost() );

                        username = server.getUsername();
                        password = server.getPassword();
                    }
                }
                catch ( SettingsConfigurationException se )
                {
                    getLogger().warn( "problem with settings file, disabling scm resolution of username and password" );
                }

                if ( username == null )
                {
                    URLUserInfo urlUserInfo = urlValidator.extractURLUserInfo( curl );
                    username = urlUserInfo.getUsername();
                    password = urlUserInfo.getPassword();
                }

                if ( urlValidator.isValid( curl ) )
                {
                    BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate( context );
                    if ( buildDefinitionTemplate == null )
                    {
                        buildDefinitionTemplate = projectBuilder.getDefaultBuildDefinitionTemplate();
                    }
                    result = projectBuilder.buildProjectsFromMetadata( url, username, password, loadRecursiveProjects,
                                                                       buildDefinitionTemplate );

                }
                else
                {
View Full Code Here

    // ----------------------------------------------------------------------

    public ContinuumProjectBuilder getProjectBuilder( String id )
        throws ContinuumProjectBuilderManagerException
    {
        ContinuumProjectBuilder projectBuilder = (ContinuumProjectBuilder) projectBuilders.get( id );

        if ( projectBuilder == null )
        {
            throw new ContinuumProjectBuilderManagerException( "No such project creator with id '" + id + "'." );
        }
View Full Code Here

        String curl = getString( context, KEY_URL );

        URL url;

        ContinuumProjectBuilder projectBuilder = projectBuilderManager.getProjectBuilder( projectBuilderId );

        ContinuumProjectBuildingResult result;

        try
        {
            BuildDefinitionTemplate buildDefinitionTemplate = getBuildDefinitionTemplate( context );
            if ( buildDefinitionTemplate == null )
            {
                buildDefinitionTemplate = projectBuilder.getDefaultBuildDefinitionTemplate();
            }           
            if ( !curl.startsWith( "http" ) )
            {
                url = new URL( curl );

                result = projectBuilder.buildProjectsFromMetadata( url, null, null, loadRecursiveProjects,
                                                                   buildDefinitionTemplate );

            }
            else
            {
                url = new URL( curl );
                String username = null;
                String password = null;

                try
                {
                    Settings settings = getSettings();

                    getLogger().info( "checking for settings auth setup" );
                    if ( settings != null && settings.getServer( url.getHost() ) != null )
                    {
                        getLogger().info( "found setting based auth setup, using" );
                        Server server = settings.getServer( url.getHost() );

                        username = server.getUsername();
                        password = server.getPassword();
                    }
                }
                catch ( SettingsConfigurationException se )
                {
                    getLogger().warn( "problem with settings file, disabling scm resolution of username and password" );
                }

                if ( username == null )
                {
                    URLUserInfo urlUserInfo = urlValidator.extractURLUserInfo( curl );
                    username = urlUserInfo.getUsername();
                    password = urlUserInfo.getPassword();
                }

                if ( urlValidator.isValid( curl ) )
                {

                    result = projectBuilder.buildProjectsFromMetadata( url, username, password, loadRecursiveProjects,
                                                                       buildDefinitionTemplate );

                }
                else
                {
View Full Code Here

TOP

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

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.