Package org.apache.maven.model

Examples of org.apache.maven.model.Plugin.addDependency()


        Plugin plugin = createPlugin( "other.group", "other-artifact", "1.0" );

        Dependency dep = createDependency( "group", "artifact", "1.0" );

        plugin.addDependency( dep );

        build.addPlugin( plugin );

        new ProjectSorter( Collections.singletonList( project ) );
    }
View Full Code Here


        Plugin plugin = createPlugin( "other.group", "other-artifact", "1.0" );

        Dependency dep = createDependency( "group", "artifact", "1.0" );

        plugin.addDependency( dep );

        pMgmt.addPlugin( plugin );

        build.setPluginManagement( pMgmt );
View Full Code Here

        pluginProject.getModel().setParent( createParent( parentProject ) );
        projects.add( pluginProject );

        Plugin plugin = createPlugin( pluginProject );

        plugin.addDependency( createDependency( pluginLevelDepProject ) );

        Build build = declaringProject.getModel().getBuild();

        build.addPlugin( plugin );
View Full Code Here

        pluginLevelDepProject.getModel().setParent( createParent( parentProject ) );
        projects.add( pluginLevelDepProject );

        Plugin plugin = createPlugin( pluginProject );

        plugin.addDependency( createDependency( pluginLevelDepProject ) );

        Build build = parentProject.getModel().getBuild();

        build.addPlugin( plugin );
View Full Code Here

    public void testShouldUseMainPluginDependencyVersionOverManagedDepVersion()
    {
        Plugin mgtPlugin = createPlugin( "group", "artifact", "1", Collections.EMPTY_MAP );
        Dependency mgtDep = createDependency( "g", "a", "2" );
        mgtPlugin.addDependency( mgtDep );

        Plugin plugin = createPlugin( "group", "artifact", "1", Collections.EMPTY_MAP );
        Dependency dep = createDependency( "g", "a", "1" );
        plugin.addDependency( dep );
View Full Code Here

        Dependency mgtDep = createDependency( "g", "a", "2" );
        mgtPlugin.addDependency( mgtDep );

        Plugin plugin = createPlugin( "group", "artifact", "1", Collections.EMPTY_MAP );
        Dependency dep = createDependency( "g", "a", "1" );
        plugin.addDependency( dep );

        ModelUtils.mergePluginDefinitions( plugin, mgtPlugin, false );

        assertEquals( dep.getVersion(), ((Dependency) plugin.getDependencies().get( 0 ) ).getVersion() );
    }
View Full Code Here

        fDep.setGroupId( "group" );
        fDep.setArtifactId( "artifact" );
        fDep.setVersion( "1" );

        first.addPlugin( fPlugin );
        fPlugin.addDependency( fDep );

        Plugin sPlugin = createPlugin( "g", "a", "1", Collections.EMPTY_MAP );
        Dependency sDep = new Dependency();
        sDep.setGroupId( "group" );
        sDep.setArtifactId( "artifact2" );
View Full Code Here

        Dependency sDep = new Dependency();
        sDep.setGroupId( "group" );
        sDep.setArtifactId( "artifact2" );
        sDep.setVersion( "1" );
        first.addPlugin( sPlugin );
        sPlugin.addDependency( sDep );

        ModelUtils.mergeDuplicatePluginDefinitions( first );

        assertEquals( 2, ((Plugin)first.getPlugins().get( 0 ) ).getDependencies().size() );
    }
View Full Code Here

        Dependency dep = new Dependency();
        dep.setGroupId( "group" );
        dep.setArtifactId( "artifact" );
        dep.setVersion( "1.0" );

        plugin.addDependency( dep );

        build.addPlugin( plugin );

        new ProjectSorter( Collections.singletonList( project ) );
    }
View Full Code Here

        Dependency dep = new Dependency();
        dep.setGroupId( "group" );
        dep.setArtifactId( "artifact" );
        dep.setVersion( "1.0" );

        plugin.addDependency( dep );

        pMgmt.addPlugin( plugin );
       
        build.setPluginManagement( pMgmt );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.