public static void ensureSingleNarDependencyExists()

in src/main/java/org/apache/nifi/utils/NarDependencyUtils.java [56:75]


    public static void ensureSingleNarDependencyExists(MavenProject project) throws MojoExecutionException {
        // find the nar dependency
        boolean found = false;
        for (final Artifact artifact : project.getDependencyArtifacts()) {
            if (NAR.equals(artifact.getType())) {
                // ensure the project doesn't have two nar dependencies
                if (found) {
                    throw new MojoExecutionException("Project can only have one NAR dependency.");
                }

                // record the nar dependency
                found = true;
            }
        }

        // ensure there is a nar dependency
        if (!found) {
            throw new MojoExecutionException("Project does not have any NAR dependencies.");
        }
    }