Search in sources :

Example 1 with InvalidMavenPublicationException

use of org.gradle.api.publish.maven.InvalidMavenPublicationException in project gradle by gradle.

the class ValidatingMavenPublisher method parsePomFileIntoMavenModel.

private Model parsePomFileIntoMavenModel(MavenNormalizedPublication publication) {
    File pomFile = publication.getPomArtifact().getFile();
    try {
        Model model = readModelFromPom(pomFile);
        model.setPomFile(pomFile);
        return model;
    } catch (XmlPullParserException parseException) {
        throw new InvalidMavenPublicationException(publication.getName(), "POM file is invalid. Check any modifications you have made to the POM file.", parseException);
    } catch (IOException ex) {
        throw new UncheckedIOException(ex);
    }
}
Also used : InvalidMavenPublicationException(org.gradle.api.publish.maven.InvalidMavenPublicationException) Model(org.apache.maven.model.Model) XmlPullParserException(org.codehaus.plexus.util.xml.pull.XmlPullParserException) UncheckedIOException(org.gradle.api.UncheckedIOException) IOException(java.io.IOException) UncheckedIOException(org.gradle.api.UncheckedIOException) File(java.io.File)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 Model (org.apache.maven.model.Model)1 XmlPullParserException (org.codehaus.plexus.util.xml.pull.XmlPullParserException)1 UncheckedIOException (org.gradle.api.UncheckedIOException)1 InvalidMavenPublicationException (org.gradle.api.publish.maven.InvalidMavenPublicationException)1