Search in sources :

Example 1 with XmlPullParserException

use of org.eclipse.ceylon.aether.codehaus.plexus.util.xml.pull.XmlPullParserException in project ceylon by eclipse.

the class AetherResolverImpl method getDependencies.

@Override
public DependencyDescriptor getDependencies(File pomXml, String name, String version) throws IOException {
    MavenXpp3Reader reader = new MavenXpp3Reader();
    Model model;
    try (FileReader fileReader = new FileReader(pomXml)) {
        model = reader.read(fileReader);
    } catch (XmlPullParserException e) {
        throw new IOException(e);
    }
    return new ModelDependencyDescriptor(model);
}
Also used : Model(org.eclipse.ceylon.aether.apache.maven.model.Model) MavenXpp3Reader(org.eclipse.ceylon.aether.apache.maven.model.io.xpp3.MavenXpp3Reader) FileReader(java.io.FileReader) XmlPullParserException(org.eclipse.ceylon.aether.codehaus.plexus.util.xml.pull.XmlPullParserException) IOException(java.io.IOException)

Example 2 with XmlPullParserException

use of org.eclipse.ceylon.aether.codehaus.plexus.util.xml.pull.XmlPullParserException in project ceylon by eclipse.

the class AetherResolverImpl method getDependencies.

@Override
public DependencyDescriptor getDependencies(InputStream pomXml, String name, String version) throws IOException {
    MavenXpp3Reader reader = new MavenXpp3Reader();
    Model model;
    try {
        model = reader.read(pomXml);
    } catch (XmlPullParserException e) {
        throw new IOException(e);
    }
    return new ModelDependencyDescriptor(model);
}
Also used : Model(org.eclipse.ceylon.aether.apache.maven.model.Model) MavenXpp3Reader(org.eclipse.ceylon.aether.apache.maven.model.io.xpp3.MavenXpp3Reader) XmlPullParserException(org.eclipse.ceylon.aether.codehaus.plexus.util.xml.pull.XmlPullParserException) IOException(java.io.IOException)

Example 3 with XmlPullParserException

use of org.eclipse.ceylon.aether.codehaus.plexus.util.xml.pull.XmlPullParserException in project ceylon by eclipse.

the class AetherResolverImpl method findExtension.

private String findExtension(File pomFile) {
    if (pomFile != null && pomFile.exists()) {
        MavenXpp3Reader reader = new MavenXpp3Reader();
        Model model;
        try (FileReader fileReader = new FileReader(pomFile)) {
            model = reader.read(fileReader);
            return model.getPackaging();
        } catch (XmlPullParserException | IOException e) {
            return null;
        }
    }
    ;
    return null;
}
Also used : Model(org.eclipse.ceylon.aether.apache.maven.model.Model) MavenXpp3Reader(org.eclipse.ceylon.aether.apache.maven.model.io.xpp3.MavenXpp3Reader) FileReader(java.io.FileReader) XmlPullParserException(org.eclipse.ceylon.aether.codehaus.plexus.util.xml.pull.XmlPullParserException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)3 Model (org.eclipse.ceylon.aether.apache.maven.model.Model)3 MavenXpp3Reader (org.eclipse.ceylon.aether.apache.maven.model.io.xpp3.MavenXpp3Reader)3 XmlPullParserException (org.eclipse.ceylon.aether.codehaus.plexus.util.xml.pull.XmlPullParserException)3 FileReader (java.io.FileReader)2