Package org.apache.maven.plugin.tools.model

Examples of org.apache.maven.plugin.tools.model.PluginMetadataParser


                                                                       PluginToolsRequest request )
        throws ExtractionException, InvalidPluginDescriptorException
    {
        List<MojoDescriptor> descriptors = new ArrayList<MojoDescriptor>();

        PluginMetadataParser parser = new PluginMetadataParser();

        for ( Map.Entry<String, Set<File>> entry : metadataFilesKeyedByBasedir.entrySet() )
        {
            String basedir = entry.getKey();
            Set<File> metadataFiles = entry.getValue();

            for ( File metadataFile : metadataFiles )
            {
                String basename = metadataFile.getName();
                basename = basename.substring( 0, basename.length() - METADATA_FILE_EXTENSION.length() );

                File scriptFile = new File( metadataFile.getParentFile(), basename + SCRIPT_FILE_EXTENSION );

                if ( !scriptFile.exists() )
                {
                    throw new InvalidPluginDescriptorException(
                        "Found orphaned plugin metadata file: " + metadataFile );
                }

                String relativePath = scriptFile.getPath().substring( basedir.length() ).replace( '\\', '/' );
               
                if ( relativePath.startsWith( "/" ) )
                {
                    relativePath = relativePath.substring( 1 );
                }

                try
                {
                    Set<MojoDescriptor> mojoDescriptors = parser.parseMojoDescriptors( metadataFile );

                    for ( MojoDescriptor descriptor : mojoDescriptors )
                    {
                        @SuppressWarnings( "unchecked" )
                        Map<String, ?> paramMap = descriptor.getParameterMap();
View Full Code Here


    protected List extractMojoDescriptorsFromMetadata( Map metadataFilesKeyedByBasedir, PluginDescriptor pluginDescriptor )
        throws ExtractionException, InvalidPluginDescriptorException
    {
        List descriptors = new ArrayList();

        PluginMetadataParser parser = new PluginMetadataParser();

        for ( Iterator mapIterator = metadataFilesKeyedByBasedir.entrySet().iterator(); mapIterator.hasNext(); )
        {
            Map.Entry entry = (Map.Entry) mapIterator.next();

            String basedir = (String) entry.getKey();
            Set metadataFiles = (Set) entry.getValue();

            for ( Iterator it = metadataFiles.iterator(); it.hasNext(); )
            {
                File metadataFile = (File) it.next();

                String basename = metadataFile.getName();
                basename = basename.substring( 0, basename.length() - METADATA_FILE_EXTENSION.length() );

                File scriptFile = new File( metadataFile.getParentFile(), basename + SCRIPT_FILE_EXTENSION );

                if ( !scriptFile.exists() )
                {
                    throw new InvalidPluginDescriptorException( "Found orphaned plugin metadata file: "
                        + metadataFile );
                }

                String relativePath = null;

                if ( basedir.endsWith( "/" ) )
                {
                    basedir = basedir.substring( 0, basedir.length() - 2 );
                }

                relativePath = scriptFile.getPath().substring( basedir.length() );

                relativePath = relativePath.replace( '\\', '/' );

                try
                {
                    Set mojoDescriptors = parser.parseMojoDescriptors( metadataFile );

                    for ( Iterator discoveredMojoIterator = mojoDescriptors.iterator(); discoveredMojoIterator
                        .hasNext(); )
                    {
                        MojoDescriptor descriptor = (MojoDescriptor) discoveredMojoIterator.next();
View Full Code Here

                                                       PluginToolsRequest request )
        throws ExtractionException, InvalidPluginDescriptorException
    {
        List<MojoDescriptor> descriptors = new ArrayList<MojoDescriptor>();

        PluginMetadataParser parser = new PluginMetadataParser();

        for ( Map.Entry<String, Set<File>> entry : metadataFilesKeyedByBasedir.entrySet() )
        {
            String basedir = (String) entry.getKey();
            Set<File> metadataFiles = entry.getValue();

            for ( File metadataFile : metadataFiles )
            {
                String basename = metadataFile.getName();
                basename = basename.substring( 0, basename.length() - METADATA_FILE_EXTENSION.length() );

                File scriptFile = new File( metadataFile.getParentFile(), basename + SCRIPT_FILE_EXTENSION );

                if ( !scriptFile.exists() )
                {
                    throw new InvalidPluginDescriptorException(
                        "Found orphaned plugin metadata file: " + metadataFile );
                }

                String relativePath = null;

                relativePath = scriptFile.getPath().substring( basedir.length() );
                relativePath = relativePath.replace( '\\', '/' );
               
                if ( relativePath.startsWith( "/" ) )
                {
                    relativePath = relativePath.substring( 1 );
                }

                try
                {
                    Set<MojoDescriptor> mojoDescriptors = parser.parseMojoDescriptors( metadataFile );

                    for ( MojoDescriptor descriptor : mojoDescriptors )
                    {
                        @SuppressWarnings( "unchecked" )
                        Map<String, ?> paramMap = descriptor.getParameterMap();
View Full Code Here

TOP

Related Classes of org.apache.maven.plugin.tools.model.PluginMetadataParser

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.