Skip to content

Commit

Permalink
Fix for issue #340: change goals for GMavenPlus 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Sep 20, 2017
1 parent 8eab274 commit 486ece5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,37 @@
<pluginExecutionFilter>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<versionRange>[1.0,)</versionRange>
<versionRange>[1.0,1.6)</versionRange>
<goals>
<goal>addSources</goal>
<goal>addTestSources</goal>
<goal>generateStubs</goal>
<goal>compile</goal>
<goal>removeStubs</goal>
<goal>testGenerateStubs</goal>
<goal>testCompile</goal>
<goal>removeTestStubs</goal>
</goals>
</pluginExecutionFilter>
<action>
<configurator>
<id>org.codehaus.groovy.m2eclipse.configurator</id>
</configurator>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<versionRange>[1.6,)</versionRange>
<goals>
<goal>addSources</goal>
<goal>addTestSources</goal>
<goal>generateStubs</goal>
<goal>compile</goal>
<goal>removeStubs</goal>
<goal>generateTestStubs</goal>
<goal>compileTests</goal>
<goal>removeTestStubs</goal>
</goals>
</pluginExecutionFilter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package org.codehaus.groovy.m2eclipse;

import java.util.List;

import org.apache.maven.model.Dependency;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginExecution;
Expand Down Expand Up @@ -82,7 +84,8 @@ private static ProjectSourceType getSourceTypeInGMavenProject(Plugin plugin) {
ProjectSourceType result = NONE;
if (plugin != null && plugin.getExecutions() != null && !plugin.getExecutions().isEmpty()) {
for (PluginExecution execution : plugin.getExecutions()) {
if (execution.getGoals().contains("compile")) {
List<String> goals = execution.getGoals();
if (goals.contains("compile")) {
switch (result) {
case NONE:
result = MAIN;
Expand All @@ -92,7 +95,7 @@ private static ProjectSourceType getSourceTypeInGMavenProject(Plugin plugin) {
break;
}
}
if (execution.getGoals().contains("testCompile")) {
if (goals.contains("compileTests") || goals.contains("testCompile")) {
switch (result) {
case NONE:
result = TEST;
Expand Down

0 comments on commit 486ece5

Please sign in to comment.