Package org.apache.maven.archetype.old.descriptor

Examples of org.apache.maven.archetype.old.descriptor.ArchetypeDescriptorBuilder


        // ----------------------------------------------------------------------
        // Load the descriptor
        // ----------------------------------------------------------------------

        ArchetypeDescriptorBuilder builder = new ArchetypeDescriptorBuilder();

        ArchetypeDescriptor descriptor;

        URLClassLoader archetypeJarLoader;

        InputStream is = null;

        try
        {
            URL[] urls = new URL[1];

            urls[0] = archetypeFile.toURL();

            archetypeJarLoader = new URLClassLoader( urls );

            is = getStream( ARCHETYPE_DESCRIPTOR, archetypeJarLoader );

            if ( is == null )
            {
                is = getStream( ARCHETYPE_OLD_DESCRIPTOR, archetypeJarLoader );
            }

            if ( is == null )
            {
                throw new ArchetypeDescriptorException( "The " + ARCHETYPE_DESCRIPTOR + " descriptor cannot be found." );
            }

            descriptor = builder.build( new XmlStreamReader( is ) );
        }
        catch ( IOException e )
        {
            throw new ArchetypeDescriptorException( "Error reading the " + ARCHETYPE_DESCRIPTOR + " descriptor.", e );
        }
View Full Code Here


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

            ArchetypeDescriptorBuilder builder = new ArchetypeDescriptorBuilder();
            return builder.build( reader );
        }
        catch ( IOException ex )
        {
            throw ex;
        }
View Full Code Here

TOP

Related Classes of org.apache.maven.archetype.old.descriptor.ArchetypeDescriptorBuilder

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.