public void run() { liquigraph.runMigrations(configuration); } }
@Override public final void execute() throws MojoExecutionException, MojoFailureException { String directory = project.getBuild().getDirectory(); try { Configuration configuration = withExecutionMode(new ConfigurationBuilder() .withClassLoader(ProjectClassLoader.getClassLoader(project)) .withExecutionContexts(executionContexts(executionContexts)) .withMasterChangelogLocation(changelog) .withUsername(username) .withPassword(password) .withUri(jdbcUri)) .build(); getLog().info("Generating Cypher output file in directory: " + directory); new Liquigraph().runMigrations(configuration); } catch (Exception e) { throw new MojoExecutionException(e.getMessage(), e); } }
@Override public void afterPropertiesSet() { final Configuration configuration = new ConfigurationBuilder() .withDataSource(dataSource) .withChangelogLoader(changelogLoader) .withMasterChangelogLocation(changeLog) .withExecutionContexts(asList(executionContexts)) .withRunMode() .build(); new Liquigraph().runMigrations(configuration); } }
public static void main(String[] args) { LiquigraphCli cli = new LiquigraphCli(); JCommander commander = new JCommander(cli, args); commander.setProgramName("liquigraph"); if (cli.help) { commander.usage(); return; } if (cli.version) { printVersion(); return; } ConfigurationBuilder builder = new ConfigurationBuilder() .withMasterChangelogLocation(fileName(cli.changelog)) .withUri(cli.graphDbUri) .withUsername(cli.username) .withPassword(cli.password) .withExecutionContexts(executionContexts(cli.executionContexts)) .withClassLoader(classloader(parentFolder(cli.changelog), cli.dryRunOutputDirectory)); String outputDirectory = cli.dryRunOutputDirectory; if (outputDirectory != null) { builder.withDryRunMode(Paths.get(outputDirectory)); } else { builder.withRunMode(); } new Liquigraph().runMigrations( builder.build() ); }