Search in sources :

Example 1 with MigrationJob

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;
    }
}
Also used : DefaultMigrationReport(com.mulesoft.tools.migration.report.DefaultMigrationReport) Stopwatch(com.google.common.base.Stopwatch) MigrationJob(com.mulesoft.tools.migration.engine.MigrationJob) ConsoleOptionsException(com.mulesoft.tools.migration.exception.ConsoleOptionsException)

Aggregations

Stopwatch (com.google.common.base.Stopwatch)1 MigrationJob (com.mulesoft.tools.migration.engine.MigrationJob)1 ConsoleOptionsException (com.mulesoft.tools.migration.exception.ConsoleOptionsException)1 DefaultMigrationReport (com.mulesoft.tools.migration.report.DefaultMigrationReport)1