This works fine:
/** The project. */
@Parameter(required = true, readonly = true, defaultValue =
"${mojoExecution}")
private MojoExecution mojoExecution;
@Override
public String getGoalName() {
return this.mojoExecution.getMojoDescriptor().getGoal();
}
I would like to dynamically determine the currently executing goal from a
MOJO.
I attempted this using reflection but the new annotations are not available
at runtime.
All other solutions I have seen appear to require access to the executing
MOJO's groupId and artifactId.
Anyone have a solution?