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

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


    public void testDeleteDependency()
        throws ContinuumStoreException
    {
        Project project = store.getProjectWithAllDetails( testProject1.getId() );
        ProjectDependency dependency = (ProjectDependency) project.getDependencies().get( 1 );
        project.getDependencies().remove( 0 );
        store.updateProject( project );

        project = store.getProjectWithAllDetails( testProject1.getId() );
        assertEquals( "check size is now 1", 1, project.getDependencies().size() );
View Full Code Here


        ProjectDeveloper projectDeveloper1 = createTestDeveloper( testDeveloper1 );
        project1.addDeveloper( projectDeveloper1 );
        testProject1.addDeveloper( testDeveloper1 );

        ProjectDependency projectDependency1 = createTestDependency( testDependency1 );
        project1.addDependency( projectDependency1 );
        testProject1.addDependency( testDependency1 );

        ProjectDependency projectDependency2 = createTestDependency( testDependency2 );
        project1.addDependency( projectDependency2 );
        testProject1.addDependency( testDependency2 );

        group.addProject( project1 );
        defaultProjectGroup.addProject( project1 );
        Project project2 = createTestProject( testProject2 );
        project2.addBuildResult( buildResult3 );
        ProjectNotifier notifier2 = createTestNotifier( testNotifier2 );
        project2.addNotifier( notifier2 );
        testProject2.addNotifier( testNotifier2 );
        ProjectNotifier notifier3 = createTestNotifier( testNotifier3 );
        project2.addNotifier( notifier3 );
        testProject2.addNotifier( testNotifier3 );

        BuildDefinition buildDefinition3 = createTestBuildDefinition( testBuildDefinition3 );
        project2.addBuildDefinition( buildDefinition3 );
        testProject2.addBuildDefinition( testBuildDefinition3 );

        BuildDefinition buildDefinition4 = createTestBuildDefinition( testBuildDefinition4 );
        project2.addBuildDefinition( buildDefinition4 );
        testProject2.addBuildDefinition( testBuildDefinition4 );

        ProjectDeveloper projectDeveloper2 = createTestDeveloper( testDeveloper2 );
        project2.addDeveloper( projectDeveloper2 );
        testProject2.addDeveloper( testDeveloper2 );

        ProjectDeveloper projectDeveloper3 = createTestDeveloper( testDeveloper3 );
        project2.addDeveloper( projectDeveloper3 );
        testProject2.addDeveloper( testDeveloper3 );

        ProjectDependency projectDependency3 = createTestDependency( testDependency3 );
        project2.addDependency( projectDependency3 );
        testProject2.addDependency( testDependency3 );

        group.addProject( project2 );
        defaultProjectGroup.addProject( project2 );
View Full Code Here

            .getScmId() );
    }

    protected static ProjectDependency createTestDependency( String groupId, String artifactId, String version )
    {
        ProjectDependency dependency = new ProjectDependency();
        dependency.setArtifactId( artifactId );
        dependency.setGroupId( groupId );
        dependency.setVersion( version );
        return dependency;
    }
View Full Code Here

        buildResult2.setState( ContinuumProjectState.OK );
        buildResult2.setBuildDefinition( bd1 );
        getStore().addBuildResult( project1, buildResult2 );

        Project project2 = createProject( "project2" );
        ProjectDependency dep1 = new ProjectDependency();
        dep1.setGroupId( "org.apache.maven.testproject" );
        dep1.setArtifactId( "project1" );
        dep1.setVersion( "1.0-SNAPSHOT" );
        project2.addDependency( dep1 );
        ProjectDependency dep2 = new ProjectDependency();
        dep2.setGroupId( "junit" );
        dep2.setArtifactId( "junit" );
        dep2.setVersion( "3.8.1" );
        project2.addDependency( dep2 );
        BuildDefinition bd2 = createBuildDefinition();
        project2.addBuildDefinition( bd2 );
        project2.setState( ContinuumProjectState.OK );
        projectId2 = addProject( getStore(), project2 ).getId();
View Full Code Here

        return project;
    }

    private ProjectDependency generateProjectDependency( Project project )
    {
        ProjectDependency dep = new ProjectDependency();
        dep.setArtifactId( project.getArtifactId() );
        dep.setGroupId( project.getGroupId() );
        dep.setVersion( project.getVersion() );

        return dep;
    }
View Full Code Here

        if ( mavenProject.getParent() != null )
        {
            MavenProject parentProject = mavenProject.getParent();

            ProjectDependency parent = new ProjectDependency();

            parent.setGroupId( parentProject.getGroupId() );

            parent.setArtifactId( parentProject.getArtifactId() );

            parent.setVersion( parentProject.getVersion() );

            continuumProject.setParent( parent );
        }

        // ----------------------------------------------------------------------
        // Dependencies
        // ----------------------------------------------------------------------

        List dependencies = new ArrayList();

        for ( Iterator i = mavenProject.getDependencies().iterator(); i.hasNext(); )
        {
            Dependency dependency = (Dependency) i.next();

            ProjectDependency cd = new ProjectDependency();

            cd.setGroupId( dependency.getGroupId() );

            cd.setArtifactId( dependency.getArtifactId() );

            cd.setVersion( dependency.getVersion() );

            dependencies.add( cd );
        }

        for ( Iterator i = mavenProject.getBuildPlugins().iterator(); i.hasNext(); )
        {
            Plugin dependency = (Plugin) i.next();

            ProjectDependency cd = new ProjectDependency();

            cd.setGroupId( dependency.getGroupId() );

            cd.setArtifactId( dependency.getArtifactId() );

            cd.setVersion( dependency.getVersion() );

            dependencies.add( cd );
        }

        for ( Iterator i = mavenProject.getReportPlugins().iterator(); i.hasNext(); )
        {
            ReportPlugin dependency = (ReportPlugin) i.next();

            ProjectDependency cd = new ProjectDependency();

            cd.setGroupId( dependency.getGroupId() );

            cd.setArtifactId( dependency.getArtifactId() );

            cd.setVersion( dependency.getVersion() );

            dependencies.add( cd );
        }

        for ( Iterator i = mavenProject.getBuildExtensions().iterator(); i.hasNext(); )
        {
            Extension dependency = (Extension) i.next();

            ProjectDependency cd = new ProjectDependency();

            cd.setGroupId( dependency.getGroupId() );

            cd.setArtifactId( dependency.getArtifactId() );

            cd.setVersion( dependency.getVersion() );

            dependencies.add( cd );
        }

        continuumProject.setDependencies( dependencies );
View Full Code Here

            List modifiedDependencies = new ArrayList();

            for ( Iterator i = dependencies.iterator(); i.hasNext(); )
            {
                ProjectDependency dep = (ProjectDependency) i.next();
                Project dependencyProject = store.getProject( dep.getGroupId(), dep.getArtifactId(), dep.getVersion() );

                if ( dependencyProject != null )
                {
                    List buildResults = store.getBuildResultsInSuccessForProject( dependencyProject.getId(),
                                                                                  context.getOldBuildResult().getEndTime() );
                    if ( buildResults != null && !buildResults.isEmpty() )
                    {
                        getLogger().debug( "Dependency changed: " + dep.getGroupId() + ":" + dep.getArtifactId() + ":" +
                            dep.getVersion() );
                        modifiedDependencies.add( dep );
                    }
                    else
                    {
                        getLogger().debug( "Dependency not changed: " + dep.getGroupId() + ":" + dep.getArtifactId() +
                            ":" + dep.getVersion() );
                    }
                }
                else
                {
                    getLogger().debug( "Skip non Continuum project: " + dep.getGroupId() + ":" + dep.getArtifactId() +
                        ":" + dep.getVersion() );
                }
            }

            context.setModifiedDependencies( modifiedDependencies );
            context.getActionContext().put( AbstractContinuumAction.KEY_UPDATE_DEPENDENCIES, modifiedDependencies );
View Full Code Here

            for ( int i = 0; i < dependenciesList.length; i++ )
            {
                Xpp3Dom dependency = dependenciesList[i];

                ProjectDependency cd = new ProjectDependency();

                if ( getValue( dependency, "groupId", null ) != null )
                {
                    cd.setGroupId( getValue( dependency, "groupId", null ) );

                    cd.setArtifactId( getValue( dependency, "artifactId", null ) );
                }
                else
                {
                    cd.setGroupId( getValue( dependency, "id", null ) );

                    cd.setArtifactId( getValue( dependency, "id", null ) );
                }

                cd.setVersion( getValue( dependency, "version", null ) );

                deps.add( cd );
            }

            project.setDependencies( deps );
View Full Code Here

TOP

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

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.