use of org.apache.maven.model.PluginExecution in project tests by datanucleus.
the class MultiConfigTestRunnerMojo method getExistingConfiguration.
private Xpp3Dom getExistingConfiguration(String executionId) {
Map<String, PluginExecution> executionsMap = surefirePlugin().getExecutionsAsMap();
PluginExecution pluginExecution = executionsMap.get(executionId);
if (pluginExecution == null) {
throw new RuntimeException("Invalid execution id specified: " + executionId + ". Valid values are: " + executionsMap.keySet());
} else {
return (Xpp3Dom) pluginExecution.getConfiguration();
}
}
use of org.apache.maven.model.PluginExecution in project component-runtime by Talend.
the class TalendLifecycleExtension method afterProjectsRead.
@Override
public void afterProjectsRead(final MavenSession session) {
final Optional<Plugin> plugin = session.getCurrentProject().getBuild().getPlugins().stream().filter(p -> "${project.groupId}".equals(p.getGroupId()) && "${project.artifactId}".equals(p.getArtifactId())).findFirst();
final List<PluginExecution> executions;
if (plugin.isPresent()) {
executions = plugin.get().getExecutions();
} else {
final Plugin def = new Plugin();
def.setGroupId("${project.groupId}");
def.setArtifactId("${project.artifactId}");
def.setVersion("${project.version}");
session.getCurrentProject().getBuild().getPlugins().add(def);
executions = def.getExecutions();
}
if (isExecutionMissing(executions, "validate")) {
final PluginExecution validate = new PluginExecution();
validate.setId("talend-validate");
validate.addGoal("validate");
validate.setPhase("process-classes");
executions.add(validate);
}
if (isExecutionMissing(executions, "dependencies")) {
final PluginExecution dependencies = new PluginExecution();
dependencies.setId("talend-dependencies");
dependencies.addGoal("dependencies");
dependencies.setPhase("process-classes");
executions.add(dependencies);
}
if (isExecutionMissing(executions, "asciidoc")) {
final PluginExecution documentation = new PluginExecution();
documentation.setId("talend-dependencies");
documentation.addGoal("asciidoc");
documentation.setPhase("process-classes");
executions.add(documentation);
}
}
Aggregations