private File getHarnessNbm()

in nbm-maven-plugin/src/main/java/org/apache/netbeans/nbm/CreateClusterAppMojo.java [825:853]


    private File getHarnessNbm() throws MojoExecutionException {
        @SuppressWarnings("unchecked")
        Set<Artifact> artifacts = project.getArtifacts();
        String version = null;
        for (Artifact a : artifacts) {
            if ((groupIdPrefix + ".modules").equals(a.getGroupId()) && "org-netbeans-bootstrap".equals(a.getArtifactId())) {
                //base version in non-snapshot should equals version, in snapshots to X-SNAPSHOT, not timestamp
                version = a.getBaseVersion();
                break;
            }
        }
        if (version == null) {
            throw new MojoExecutionException(
                    "We could not find org-netbeans-bootstrap among the modules in the application. "
                    + "Launchers could not be found.");
        }
        Artifact nbmArt = artifactFactory.createArtifact(
                groupIdPrefix + ".modules",
                "org-netbeans-modules-apisupport-harness",
                version,
                "compile",
                "nbm-file");
        try {
            artifactResolver.resolve(nbmArt, project.getRemoteArtifactRepositories(), session.getLocalRepository());
        } catch (ArtifactResolutionException | ArtifactNotFoundException ex) {
            throw new MojoExecutionException("Failed to retrieve the nbm file from repository", ex);
        }
        return nbmArt.getFile();
    }