Skip to content

Commit 8128786

Browse files
authored
Fixed errors in how the execute goal was hiding parameters for the base class
And made sure that exec is run in the context of the project, which can be different in case of a multi-module pom
1 parent 2a19f70 commit 8128786

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

src/main/java/org/rascalmpl/maven/AbstractRascalMojo.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ protected Process runMain(boolean verbose, String moreClasspath, List<File> srcs
380380
.collect(Collectors.joining(" ")));
381381

382382
ProcessBuilder p = new ProcessBuilder(command);
383+
p.directory(proejct.getBasedir());
383384

384385
if (inheritIO) {
385386
// everything merges with the current process' streams

src/main/java/org/rascalmpl/maven/ExecuteRascalMojo.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414

1515
import org.apache.maven.plugins.annotations.LifecyclePhase;
1616
import org.apache.maven.plugins.annotations.Mojo;
17-
import org.apache.maven.plugins.annotations.Parameter;
1817
import org.apache.maven.plugins.annotations.ResolutionScope;
19-
import org.apache.maven.project.MavenProject;
2018

2119
/**
2220
* Maven Goal for running local Rascal programs during the maven generate-source phase.
@@ -27,18 +25,7 @@
2725
@Mojo(name="exec", defaultPhase = LifecyclePhase.NONE, requiresDependencyCollection = ResolutionScope.COMPILE_PLUS_RUNTIME, requiresDependencyResolution = ResolutionScope.COMPILE_PLUS_RUNTIME)
2826
public class ExecuteRascalMojo extends AbstractRascalMojo
2927
{
30-
@Parameter(defaultValue="${project}", readonly=true, required=true)
31-
private MavenProject project;
32-
33-
@Parameter(property = "mainModule", required=true)
34-
private String mainModule = "Main";
35-
3628
public ExecuteRascalMojo() {
3729
super("org.rascalmpl.shell.RascalShell", "exec");
3830
}
39-
40-
@Override
41-
protected void setExtraParameters() {
42-
extraParameters.put("mainModule", mainModule);
43-
}
4431
}

0 commit comments

Comments
 (0)