@Mojo(name = "server")
public class ServerMojo extends AbstractAnalysisMojo {
@Override
protected void aggregate(MavenProject baseProject, Set<MavenProject> projects, Store store) throws MojoExecutionException, MojoFailureException {
Server server = new ServerImpl((EmbeddedGraphStore) store);
server.start();
getLog().info("Running server for module " + baseProject.getGroupId() + ":" + baseProject.getArtifactId() + ":" + baseProject.getVersion());
getLog().info("Press <Enter> to finish.");
try {
System.in.read();
} catch (IOException e) {
throw new MojoExecutionException("Cannot read from System.in.", e);
} finally {
server.stop();
}
}