Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ under the License.
<parent>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugins</artifactId>
<version>47</version>
<version>48</version>
<relativePath />
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.io.File;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;
Expand Down Expand Up @@ -64,6 +65,9 @@ public class EvalMojo extends AbstractMojo {
@Parameter(defaultValue = "${project}", readonly = true)
private MavenProject project;

@Parameter(defaultValue = "${mojoExecution}", readonly = true)
MojoExecution mojoExecution;

@Override
public void execute() throws MojoExecutionException, MojoFailureException {
try {
Expand All @@ -72,6 +76,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
Bindings bindings = new SimpleBindings();
bindings.put("project", project);
bindings.put("log", getLog());
bindings.put("mojoExecution", mojoExecution);

Object result = execute.eval(bindings, getLog());

Expand Down
3 changes: 2 additions & 1 deletion src/site/markdown/script-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ under the License.
The following variables are available in the script context

* `org.apache.maven.project.MavenProject project`
* `org.apache.maven.plugin.logging.Log log`
* `org.apache.maven.plugin.logging.Log log`
* `org.apache.maven.plugin.MojoExecution mojoExecution`