use of com.github.alexcojocaru.mojo.elasticsearch.v2.step.PreStartClusterSequence in project elasticsearch-maven-plugin by alexcojocaru.
the class RunForkedMojo method execute.
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (skip) {
getLog().info("Skipping plugin execution");
return;
}
ClusterConfiguration clusterConfig = buildClusterConfiguration();
new PreStartClusterSequence().execute(clusterConfig);
for (InstanceConfiguration config : clusterConfig.getInstanceConfigurationList()) {
getLog().info(String.format("Using Elasticsearch [%d] configuration: %s", config.getId(), config));
try {
ForkedInstance instance = new ForkedInstance(config);
instance.configureInstance();
Thread thread = new Thread(instance);
thread.start();
new PostStartInstanceSequence().execute(config);
} catch (Exception e) {
throw new MojoExecutionException(e.getMessage(), e);
}
}
new PostStartClusterSequence().execute(clusterConfig);
}
Aggregations