Permalink
Browse files

fix for MAVEN-222 “mvn dependency exclusions are ignored”

  • Loading branch information...
1 parent 6c10485 commit 7d6dc808dd6dcf33ac46f1a49258a252ff91fe59 @graemerocher graemerocher committed Jan 17, 2014
Showing with 11 additions and 21 deletions.
  1. +2 −2 pom.xml
  2. +9 −19 src/main/java/org/grails/maven/plugin/AbstractGrailsMojo.java
View
@@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.grails</groupId>
<artifactId>grails-maven-plugin</artifactId>
- <version>2.3.4</version>
+ <version>2.3.5</version>
<packaging>maven-plugin</packaging>
<name>Maven plugin for GRAILS applications</name>
@@ -49,7 +49,7 @@
<!-- Dependencies -->
<groovy.version>2.1.9</groovy.version>
- <grails.version>2.3.4</grails.version>
+ <grails.version>2.3.5</grails.version>
<grails-bootstrap.version>${grails.version}</grails-bootstrap.version>
<grails-core.version>${grails.version}</grails-core.version>
<grails-scripts.version>${grails.version}</grails-scripts.version>
@@ -323,32 +323,22 @@ protected void runGrails(final String targetName, String args) throws MojoExecut
final String targetDir = this.project.getBuild().getDirectory();
ForkedGrailsRuntime.ExecutionContext ec = new ForkedGrailsRuntime.ExecutionContext();
ec.setBuildDependencies(resolveGrailsExecutionPathJars(true));
- List<File> providedDependencies = resolveArtifacts(getProvidedArtifacts(project));
- List<File> compileDependencies = resolveArtifacts(getCompileArtifacts(project));
+ List<File> providedDependencies = resolveArtifacts(getProvidedArtifacts(project));
+ List<File> compileDependencies = getCompileFiles();
+ Set<File> testDependencies = new HashSet<File>();
+ Set<File> runtimeDependencies = new HashSet<File>( getRuntimeFiles() );
+ runtimeDependencies.addAll(compileDependencies);
- Set<File> runtimeDependencies = new HashSet<File>( resolveArtifacts(getRuntimeArtifacts(project)) );
- runtimeDependencies.addAll( compileDependencies );
- try {
- runtimeDependencies.addAll( getDependencyFiles( project.getRuntimeClasspathElements() ) );
- } catch (DependencyResolutionRequiredException e) {
- throw new MojoExecutionException("Failed to create runtime classpath for Grails execution.", e);
- }
-
- Set<File> testDependencies = new HashSet<File>( resolveArtifacts(getTestArtifacts(project)) );
testDependencies.addAll( providedDependencies );
testDependencies.addAll( compileDependencies );
testDependencies.addAll( runtimeDependencies );
- testDependencies.addAll( testDependencies );
- try {
- testDependencies.addAll( getDependencyFiles( project.getTestClasspathElements() ) );
- } catch (DependencyResolutionRequiredException e) {
- throw new MojoExecutionException("Failed to create test classpath for Grails execution.", e);
- }
+ testDependencies.addAll( getTestFiles() );
ec.setProvidedDependencies(providedDependencies);
+ ec.setRuntimeDependencies(new ArrayList<File>(runtimeDependencies));
ec.setCompileDependencies(compileDependencies);
- ec.setTestDependencies( new ArrayList<File>(testDependencies) );
- ec.setRuntimeDependencies( new ArrayList<File>(runtimeDependencies) );
+ ec.setTestDependencies(new ArrayList<File>(testDependencies));
+
ec.setGrailsWorkDir(new File(grailsWorkDir));
ec.setProjectWorkDir(new File(targetDir));
ec.setClassesDir(new File(targetDir, "classes"));

0 comments on commit 7d6dc80

Please sign in to comment.