Package org.apache.maven.plugin.descriptor

Examples of org.apache.maven.plugin.descriptor.PluginDescriptor


        PluginDescriptorParsingException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
        LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException
    {
        MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor();

        PluginDescriptor pluginDescriptor = mojoDescriptor.getPluginDescriptor();

        String forkedGoal = mojoDescriptor.getExecuteGoal();

        MojoDescriptor forkedMojoDescriptor = pluginDescriptor.getMojo( forkedGoal );
        if ( forkedMojoDescriptor == null )
        {
            throw new MojoNotFoundException( forkedGoal, pluginDescriptor );
        }
View Full Code Here


    {
        for ( Plugin plugin : plugins )
        {
            try
            {
                PluginDescriptor pluginDescriptor =
                    pluginManager.loadPlugin( plugin, request.getRepositories(), request.getRepositorySession() );

                if ( request.getPrefix().equals( pluginDescriptor.getGoalPrefix() ) )
                {
                    return new DefaultPluginPrefixResult( plugin );
                }
            }
            catch ( Exception e )
View Full Code Here

    public static MojoDescriptor createMojoDescriptor( String phaseName, boolean threadSafe )
    {
        final MojoDescriptor mojoDescriptor = new MojoDescriptor();
        mojoDescriptor.setPhase( phaseName );
        final PluginDescriptor descriptor = new PluginDescriptor();
        Plugin plugin = new Plugin();
        plugin.setArtifactId( "org.apache.maven.test.MavenExecutionPlan" );
        plugin.setGroupId( "stub-plugin-" + phaseName );
        descriptor.setPlugin( plugin );
        descriptor.setArtifactId( "artifact." + phaseName );
        mojoDescriptor.setPluginDescriptor( descriptor );
        mojoDescriptor.setThreadSafe( threadSafe );
        return mojoDescriptor;
    }
View Full Code Here

        targetDirectory = targetDirectory.replace('/', File.separatorChar);

        // FIXME: [rfeng] Workaround to figure out the current execution phase
        MojoDescriptor descriptor = (MojoDescriptor) mojos.get(0);
        PluginDescriptor pluginDescriptor = descriptor.getPluginDescriptor();
        Map pluginMap = project.getBuild().getPluginsAsMap();
        Plugin plugin = (Plugin) pluginMap.get(pluginDescriptor.getGroupId() + ":" + pluginDescriptor.getArtifactId());
        // How to get the current execution id?
        for (Iterator i = plugin.getExecutions().iterator(); i.hasNext();) {
            PluginExecution execution = (PluginExecution) i.next();
            String phase = execution.getPhase();
            if (phase != null && phase.indexOf("-test-") != -1) {
View Full Code Here

    {
        if (session == null)
        {
            return new HashMap();
        }
        PluginDescriptor desc = new PluginDescriptor();
        desc.setGroupId( PluginDescriptor.getDefaultPluginGroupId() );
        desc.setArtifactId( PluginDescriptor.getDefaultPluginArtifactId ("toolchains") );
        MavenProject current = getCurrentProject(session);
        if ( current != null )
        {
            return session.getPluginContext( desc, current );
           
View Full Code Here

    }

    public void testShouldExtractPluginArtifacts()
        throws Exception
    {
        PluginDescriptor pd = new PluginDescriptor();

        Artifact artifact = createArtifact( "testGroup", "testArtifact", "1.0" );

        pd.setArtifacts( Collections.singletonList( artifact ) );

        ExpressionEvaluator ee = createExpressionEvaluator( createDefaultProject(), pd, new Properties() );

        Object value = ee.evaluate( "${plugin.artifacts}" );
View Full Code Here

        return factory.createDependencyArtifact( dependency );
    }

    private MojoExecution newMojoExecution()
    {
        PluginDescriptor pd = new PluginDescriptor();
        pd.setArtifactId( "my-plugin" );
        pd.setGroupId( "org.myco.plugins" );
        pd.setVersion( "1" );

        MojoDescriptor md = new MojoDescriptor();
        md.setPluginDescriptor( pd );

        pd.addComponentDescriptor( md );

        return new MojoExecution( md );
    }
View Full Code Here

    }

    public void testShouldExtractPluginArtifacts()
        throws Exception
    {
        PluginDescriptor pd = new PluginDescriptor();

        Artifact artifact = createArtifact( "testGroup", "testArtifact", "1.0" );

        pd.setArtifacts( Collections.singletonList( artifact ) );

        ExpressionEvaluator ee = createExpressionEvaluator( createDefaultProject(), pd, new Properties() );

        Object value = ee.evaluate( "${plugin.artifacts}" );
View Full Code Here

        return factory.createDependencyArtifact( dependency );
    }

    private MojoExecution newMojoExecution()
    {
        PluginDescriptor pd = new PluginDescriptor();
        pd.setArtifactId( "my-plugin" );
        pd.setGroupId( "org.myco.plugins" );
        pd.setVersion( "1" );

        MojoDescriptor md = new MojoDescriptor();
        md.setPluginDescriptor( pd );

        pd.addComponentDescriptor( md );

        return new MojoExecution( md );
    }
View Full Code Here

        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

TOP

Related Classes of org.apache.maven.plugin.descriptor.PluginDescriptor

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.