@Override
public Map<String, List<MojoExecution>> calculateLifecycleMappings(MavenSession session,
MavenProject project,
Lifecycle lifecycle,
String lifecyclePhase)
throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException {
List<MojoExecution> mojoExecutions = new ArrayList<MojoExecution>();
for (Plugin plugin : project.getBuild().getPlugins()) {
for (PluginExecution execution : plugin.getExecutions()) {
for (String goal : execution.getGoals()) {
MojoExecution mojoExecution = new MojoExecution(plugin, goal, execution.getId());
mojoExecution.setLifecyclePhase(execution.getPhase());
mojoExecutions.add(mojoExecution);
}
}
}
return Collections.singletonMap("post", mojoExecutions);
}