private File getArtifactFile()

in src/main/java/org/apache/maven/plugins/help/EvaluateMojo.java [453:467]


    private File getArtifactFile(String artifactId) throws MojoExecutionException, RepositoryException {
        List<Dependency> dependencies = getHelpPluginPom().getDependencies();
        for (Dependency dependency : dependencies) {
            if ("org.apache.maven".equals(dependency.getGroupId())) {
                if (artifactId.equals(dependency.getArtifactId())) {
                    Artifact mavenArtifact = new DefaultArtifact(
                            dependency.getGroupId(), dependency.getArtifactId(), "jar", dependency.getVersion());

                    return resolveArtifact(mavenArtifact).getArtifact().getFile();
                }
            }
        }

        throw new MojoExecutionException("Unable to find the 'org.apache.maven:" + artifactId + "' artifact");
    }