Search in sources :

Example 1 with ArchetypeDescriptorXpp3Reader

use of org.apache.maven.archetype.metadata.io.xpp3.ArchetypeDescriptorXpp3Reader in project maven-archetype by apache.

the class DefaultArchetypeArtifactManager method loadFileSetArchetypeDescriptor.

private org.apache.maven.archetype.metadata.ArchetypeDescriptor loadFileSetArchetypeDescriptor(ZipFile zipFile) throws IOException, XmlPullParserException {
    Reader reader = null;
    try {
        reader = getArchetypeDescriptorReader(zipFile);
        if (reader == null) {
            return null;
        }
        ArchetypeDescriptorXpp3Reader archetypeReader = new ArchetypeDescriptorXpp3Reader();
        return archetypeReader.read(reader, false);
    } catch (IOException e) {
        throw e;
    } catch (XmlPullParserException e) {
        throw e;
    } finally {
        IOUtil.close(reader);
    }
}
Also used : ArchetypeDescriptorXpp3Reader(org.apache.maven.archetype.metadata.io.xpp3.ArchetypeDescriptorXpp3Reader) ArchetypeDescriptorXpp3Reader(org.apache.maven.archetype.metadata.io.xpp3.ArchetypeDescriptorXpp3Reader) Reader(java.io.Reader) XmlPullParserException(org.codehaus.plexus.util.xml.pull.XmlPullParserException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 Reader (java.io.Reader)1 ArchetypeDescriptorXpp3Reader (org.apache.maven.archetype.metadata.io.xpp3.ArchetypeDescriptorXpp3Reader)1 XmlPullParserException (org.codehaus.plexus.util.xml.pull.XmlPullParserException)1