Package org.apache.maven.model

Examples of org.apache.maven.model.Plugin


            return null;
        }

        Map<String, Plugin> plugins = build.getPluginsAsMap();

        Plugin sitePlugin = plugins.get( sitePluginKey );
        if ( sitePlugin == null )
        {
            final PluginManagement buildPluginManagement = build.getPluginManagement();
            if ( buildPluginManagement == null )
            {
                return null;
            }

            plugins = buildPluginManagement.getPluginsAsMap();
            sitePlugin = plugins.get( sitePluginKey );
        }

        if ( sitePlugin == null )
        {
            return null;
        }

        final Xpp3Dom sitePluginConfiguration = (Xpp3Dom) sitePlugin.getConfiguration();
        if ( sitePluginConfiguration == null )
        {
            return null;
        }
View Full Code Here


        // these are injected if -DperformRelease=true
        validPluginCounts.put( "maven-deploy-plugin", new Integer( 0 ) );
        validPluginCounts.put( "maven-javadoc-plugin", new Integer( 0 ) );
        validPluginCounts.put( "maven-source-plugin", new Integer( 0 ) );
       
        Plugin testPlugin = null;
       
        for ( Iterator it = plugins.iterator(); it.hasNext(); )
        {
            Plugin plugin = (Plugin) it.next();
           
            String pluginArtifactId = plugin.getArtifactId();
           
            if ( !validPluginCounts.containsKey( pluginArtifactId ) )
            {
                fail( "Illegal plugin found: " + pluginArtifactId );
            }
View Full Code Here

    {
        String g = mojoExecution.getGroupId();

        String a = mojoExecution.getArtifactId();

        Plugin plugin = findPlugin( g, a, project.getBuildPlugins() );

        if ( plugin == null && project.getPluginManagement() != null )
        {
            plugin = findPlugin( g, a, project.getPluginManagement().getPlugins() );
        }

        if ( plugin != null )
        {
            PluginExecution pluginExecution =
                findPluginExecution( mojoExecution.getExecutionId(), plugin.getExecutions() );

            Xpp3Dom pomConfiguration = null;

            if ( pluginExecution != null )
            {
                pomConfiguration = (Xpp3Dom) pluginExecution.getConfiguration();
            }
            else if ( allowPluginLevelConfig )
            {
                pomConfiguration = (Xpp3Dom) plugin.getConfiguration();
            }

            Xpp3Dom mojoConfiguration = ( pomConfiguration != null ) ? new Xpp3Dom( pomConfiguration ) : null;

            mojoConfiguration = Xpp3Dom.mergeXpp3Dom( mojoExecution.getConfiguration(), mojoConfiguration );
View Full Code Here

                for ( Plugin element : src )
                {
                    if ( element.isInherited() || !element.getExecutions().isEmpty() )
                    {
                        // NOTE: Enforce recursive merge to trigger merging/inheritance logic for executions
                        Plugin plugin = new Plugin();
                        plugin.setLocation( "", element.getLocation( "" ) );
                        plugin.setGroupId( null );
                        mergePlugin( plugin, element, sourceDominant, context );

                        Object key = getPluginKey( element );

                        master.put( key, plugin );
                    }
                }

                Map<Object, List<Plugin>> predecessors = new LinkedHashMap<Object, List<Plugin>>();
                List<Plugin> pending = new ArrayList<Plugin>();
                for ( Plugin element : tgt )
                {
                    Object key = getPluginKey( element );
                    Plugin existing = master.get( key );
                    if ( existing != null )
                    {
                        mergePlugin( element, existing, sourceDominant, context );

                        master.put( key, element );
View Full Code Here

    public void testPluginLoading()
        throws Exception
    {
        MavenSession session = createMavenSession( null );      
        Plugin plugin = new Plugin();
        plugin.setGroupId( "org.apache.maven.its.plugins" );
        plugin.setArtifactId( "maven-it-plugin" );
        plugin.setVersion( "0.1" );
        PluginDescriptor pluginDescriptor =
            pluginManager.loadPlugin( plugin, session.getCurrentProject().getRemotePluginRepositories(),
                                      session.getRepositorySession() );
        assertNotNull( pluginDescriptor );
    }
View Full Code Here

    public void testMojoDescriptorRetrieval()
        throws Exception
    {
        MavenSession session = createMavenSession( null );      
        String goal = "it";
        Plugin plugin = new Plugin();
        plugin.setGroupId( "org.apache.maven.its.plugins" );
        plugin.setArtifactId( "maven-it-plugin" );
        plugin.setVersion( "0.1" );
       
        MojoDescriptor mojoDescriptor =
            pluginManager.getMojoDescriptor( plugin, goal, session.getCurrentProject().getRemotePluginRepositories(),
                                             session.getRepositorySession() );
        assertNotNull( mojoDescriptor );
View Full Code Here

        System.out.println( artifacts );
        */
       
        MavenSession session = createMavenSession( getProject( "project-contributing-system-scope-plugin-dep" ) );
        MavenProject project = session.getCurrentProject();
        Plugin plugin = project.getPlugin( "org.apache.maven.its.plugins:maven-it-plugin" );               
       
        RepositoryRequest repositoryRequest = new DefaultRepositoryRequest();
        repositoryRequest.setLocalRepository( getLocalRepository() );
        repositoryRequest.setRemoteRepositories( getPluginArtifactRepositories() );

View Full Code Here

        repositoryRequest.setRemoteRepositories( getPluginArtifactRepositories() );

        // prime realm cache
        MavenSession session = createMavenSession( getProject( "project-contributing-system-scope-plugin-dep" ) );
        MavenProject project = session.getCurrentProject();
        Plugin plugin = project.getPlugin( "org.apache.maven.its.plugins:maven-it-plugin" );

        PluginDescriptor pluginDescriptor =
            pluginManager.loadPlugin( plugin, session.getCurrentProject().getRemotePluginRepositories(),
                                      session.getRepositorySession() );
        pluginManager.getPluginRealm( session, pluginDescriptor );
View Full Code Here

        }
    }

    private boolean isCompatible( PluginVersionRequest request, String version )
    {
        Plugin plugin = new Plugin();
        plugin.setGroupId( request.getGroupId() );
        plugin.setArtifactId( request.getArtifactId() );
        plugin.setVersion( version );

        PluginDescriptor pluginDescriptor;

        try
        {
View Full Code Here

                metadata.getLicense().add(licenseType);
            }
        }

        PluginArtifactType instance;
        Plugin plugin = (Plugin) project.getModel().getBuild().getPluginsAsMap().get("org.apache.geronimo.buildsupport:car-maven-plugin");
        if (plugin == null) {
            throw new Error("Unable to resolve car plugin");
        }

        Xpp3Dom dom;
        if (plugin.getExecutions().isEmpty()) {
            dom = (Xpp3Dom) plugin.getConfiguration();
        } else {
            if (plugin.getExecutions().size() > 1) {
                throw new IllegalStateException("Cannot determine correct configuration for PluginMetadataGeneratorMojo: " + plugin.getExecutionsAsMap().keySet());
            }
            dom = (Xpp3Dom) ((PluginExecution) plugin.getExecutions().get(0)).getConfiguration();
        }
        Xpp3Dom instanceDom = dom.getChild("instance");

        if (instanceDom == null || instanceDom.getChild("plugin-artifact") == null) {
            instance = new PluginArtifactType();
View Full Code Here

TOP

Related Classes of org.apache.maven.model.Plugin

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.