in src/main/java/org/apache/maven/plugins/help/EvaluateMojo.java [224:245]
private PluginParameterExpressionEvaluator getEvaluator() throws MojoFailureException {
if (evaluator == null) {
MojoDescriptor mojoDescriptor;
try {
mojoDescriptor = mojoDescriptorCreator.getMojoDescriptor("help:evaluate", session, project);
} catch (Exception e) {
throw new MojoFailureException("Failure while evaluating.", e);
}
MojoExecution mojoExecution = new MojoExecution(mojoDescriptor);
MavenProject currentProject = session.getCurrentProject();
// Maven 3: PluginParameterExpressionEvaluator gets the current project from the session:
// synchronize in case another thread wants to fetch the real current project in between
synchronized (session) {
session.setCurrentProject(project);
evaluator = new PluginParameterExpressionEvaluator(session, mojoExecution);
session.setCurrentProject(currentProject);
}
}
return evaluator;
}