use of org.eclipse.aether.util.filter.ExclusionsDependencyFilter in project grails-maven by grails.
the class AbstractGrailsMojo method resolveBuildDependencies.
protected List<File> resolveBuildDependencies() throws MojoExecutionException {
try {
/*
* Get the Grails dependencies from the plugin's POM file first.
*/
final MavenProject pluginProject = getPluginProject();
/*
* Add the plugin's dependencies and the project using the plugin's dependencies to the list
* of unresolved dependencies. This is done so they can all be resolved at the same time so
* that we get the benefit of Maven's conflict resolution.
*/
Set<File> jars = new HashSet<File>();
// calculate the Grails version to use from the dependency or grailsVersion setting
String grailsVersion = establishGrailsVersion();
String groovyVersion = establishGroovyVersion();
if (grailsVersion != null) {
String scriptsId = "org.grails:grails-scripts:" + grailsVersion;
String bootstrapId = "org.grails:grails-bootstrap:" + grailsVersion;
String groovyId = "org.codehaus.groovy:groovy-all:" + groovyVersion;
jars.addAll(resolveArtifactIds(Arrays.asList(scriptsId, bootstrapId, groovyId)));
}
jars.addAll(resolveArtifacts(pluginProject, COMPILE_PLUS_RUNTIME_SCOPE, new ExclusionsDependencyFilter(Arrays.asList("org.grails:grails-bootstrap", "org.codehaus.groovy:groovy-all", "org.codehaus.groovy:groovy"))));
findAndAddToolsJar(jars);
addExtraClassPathEntries(jars);
return new ArrayList<File>(jars);
} catch (final Exception e) {
throw new MojoExecutionException("Failed to create classpath for Grails execution.", e);
}
}
Aggregations