protected Model getSupplement()

in src/main/java/org/apache/maven/plugin/resources/remote/AbstractProcessRemoteResourcesMojo.java [1012:1037]


    protected Model getSupplement(Xpp3Dom supplementModelXml) throws MojoExecutionException {
        MavenXpp3Reader modelReader = new MavenXpp3Reader();
        Model model = null;

        try {
            model = modelReader.read(new StringReader(supplementModelXml.toString()));
            String groupId = model.getGroupId();
            String artifactId = model.getArtifactId();

            if (groupId == null || groupId.trim().equals("")) {
                throw new MojoExecutionException(
                        "Supplemental project XML " + "requires that a <groupId> element be present.");
            }

            if (artifactId == null || artifactId.trim().equals("")) {
                throw new MojoExecutionException(
                        "Supplemental project XML " + "requires that a <artifactId> element be present.");
            }
        } catch (IOException e) {
            getLog().warn("Unable to read supplemental XML: " + e.getMessage(), e);
        } catch (XmlPullParserException e) {
            getLog().warn("Unable to parse supplemental XML: " + e.getMessage(), e);
        }

        return model;
    }