use of com.mulesoft.tools.migration.engine.MigrationJob in project mule-migration-assistant by mulesoft.
the class MigrationRunner method run.
public static int run(String[] args) throws Exception {
Stopwatch stopwatch = Stopwatch.createStarted();
Optional<MigrationRunner> migrationRunner = buildRunner(args);
if (!migrationRunner.isPresent()) {
return -1;
}
MigrationJob job = migrationRunner.get().buildMigrationJob();
try {
DefaultMigrationReport report = new DefaultMigrationReport();
log("Executing migrator " + job.getRunnerVersion() + "...");
job.execute(report);
printMigrationSummary(job.getReportPath().resolve(REPORT_HOME).toAbsolutePath().toString(), stopwatch.stop().elapsed(MILLISECONDS), report);
return 0;
} catch (Exception ex) {
printMigrationError(ex, stopwatch.stop().elapsed(MILLISECONDS));
return -1;
}
}
Aggregations