Package org.apache.maven.plugin.descriptor

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


        {
            try
            {
                int pathSeparator = expression.indexOf( "/" );

                PluginDescriptor pluginDescriptor = mojoDescriptor.getPluginDescriptor();

                if ( pathSeparator > 0 )
                {
                    String pathExpression = expression.substring( 1, pathSeparator );
                    value = ReflectionValueExtractor.evaluate( pathExpression, pluginDescriptor );
View Full Code Here


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

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

    public <T> T getConfigurationValue(String configName, Class<T> type) throws ComponentConfigurationException {
        PlexusConfiguration child = configuration.getChild(configName);
        if(child==null) return null;    // no such config
      
        ClassLoader cl;
        PluginDescriptor pd = mojoExecution.getMojoDescriptor().getPluginDescriptor();
        // for maven2 builds ClassRealm doesn't extends ClassLoader !
        // so check stuff with reflection
        Method method = ReflectionUtils.getPublicMethodNamed( pd.getClass(), "getClassRealm" );
      
        if ( ReflectionUtils.invokeMethod( method, pd ) instanceof ClassRealm) {
            ClassRealm cr = (ClassRealm) ReflectionUtils.invokeMethod( method, pd );
            cl = cr.getClassLoader();
        } else {
View Full Code Here

    private MojoDescriptor mojoDescriptor;
    private Level oldLevel;
   
    @Before
    public void before() {
        PluginDescriptor pluginDescriptor = new PluginDescriptor();
        pluginDescriptor.setGroupId("com.test");
        pluginDescriptor.setArtifactId("testPlugin");
        pluginDescriptor.setVersion("1.0");
       
        ClassRealm classRealm = new ClassRealm(null, "test", getClass().getClassLoader());
        pluginDescriptor.setClassRealm(classRealm);
       
        MojoDescriptor descriptor = new MojoDescriptor();
        descriptor.setPluginDescriptor(pluginDescriptor);
        this.mojoDescriptor = descriptor;
       
View Full Code Here

       
        this.mojoInfo = spy;
    }

    private MojoInfo createMojoInfo() throws ComponentConfigurationException {
        PluginDescriptor pluginDescriptor = new PluginDescriptor();
        pluginDescriptor.setGroupId("org.apache.maven.plugins");
        pluginDescriptor.setArtifactId("maven-surefire-plugin");
        pluginDescriptor.setVersion("2.9");
       
        MojoDescriptor mojoDescriptor = new MojoDescriptor();
        mojoDescriptor.setPluginDescriptor(pluginDescriptor);
        mojoDescriptor.setGoal("test");
       
View Full Code Here

    {
        ComponentSetDescriptor componentSetDescriptor = event.getComponentSetDescriptor();

        if ( componentSetDescriptor instanceof PluginDescriptor )
        {
            PluginDescriptor pluginDescriptor = (PluginDescriptor) componentSetDescriptor;
           
            // TODO: see comment in getPluginDescriptor
            String key = Plugin.constructKey( pluginDescriptor.getGroupId(), pluginDescriptor.getArtifactId() );
           
            if ( !pluginsInProcess.contains( key ) )
            {
                pluginsInProcess.add( key );

                pluginDescriptors.put( key, pluginDescriptor );

                // TODO: throw an (not runtime) exception if there is a prefix overlap - means doing so elsewhere
                // we also need to deal with multiple versions somehow - currently, first wins
                if ( !pluginIdsByPrefix.containsKey( pluginDescriptor.getGoalPrefix() ) )
                {
                    pluginIdsByPrefix.put( pluginDescriptor.getGoalPrefix(), pluginDescriptor );
                }
            }
        }
    }
View Full Code Here

        {
            try
            {
                int pathSeparator = expression.indexOf( "/" );

                PluginDescriptor pluginDescriptor = mojoDescriptor.getPluginDescriptor();

                if ( pathSeparator > 0 )
                {
                    String pathExpression = expression.substring( 1, pathSeparator );
                    value = ReflectionValueExtractor.evaluate( pathExpression, pluginDescriptor );
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

   
    this.mojo.workingDir = this.workingDir.getCanonicalPath();
    this.mojo.root = FitNesseHelper.DEFAULT_ROOT;
    this.mojo.project = new MavenProject();
    this.mojo.project.setFile(new File(getClass().getResource("pom.xml").getPath()));
    this.mojo.pluginDescriptor = new PluginDescriptor();
    this.mojo.pluginManager = mock(BuildPluginManager.class);
    this.mojo.session = mock(MavenSession.class);
       
    this.logStream = new ByteArrayOutputStream();
    this.mojo.setLog(new DefaultLog(new PrintStreamLogger(
View Full Code Here

          throws DuplicateMojoDescriptorException, PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, InvalidPluginDescriptorException {
   
    DefaultArtifact artifact = new DefaultArtifact(groupId, artifactId, "DUMMY", "compile", type, "", null);
      MojoDescriptor mojoDescriptor = new MojoDescriptor();
    mojoDescriptor.setGoal(goal);
        PluginDescriptor pluginDescriptor = new PluginDescriptor();
    pluginDescriptor.addMojo(mojoDescriptor);
   
    Plugin plugin = new Plugin();
    plugin.setGroupId(groupId);
    plugin.setArtifactId(artifactId);
   
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.