FileUtil.write(StreamUtil.getStreamContents(is), file);
public void configureFieldsAndValues(ResourceAccessor fo) throws MojoExecutionException, MojoFailureException { // Load the properties file if there is one, but only for values that the user has not // already specified. if (propertyFile != null) { getLog().info("Parsing Liquibase Properties File"); getLog().info(" File: " + propertyFile); InputStream is; try { is = StreamUtil.singleInputStream(propertyFile, fo); } catch (IOException e) { throw new UnexpectedLiquibaseException(e); } if (is == null) { throw new MojoFailureException("Failed to resolve the properties file."); } parsePropertiesFile(is); getLog().info(MavenUtils.LOG_SEPARATOR); } }
private void outputChangeLogTableCreationScript(Liquibase liquibase, final Writer exportWriter) throws DatabaseException { Database database = liquibase.getDatabase(); Executor oldTemplate = ExecutorService.getInstance().getExecutor(database); LoggingExecutor executor = new LoggingExecutor(ExecutorService.getInstance().getExecutor(database), exportWriter, database); ExecutorService.getInstance().setExecutor(database, executor); executor.comment("*********************************************************************"); executor.comment("* Keycloak database creation script - apply this script to empty DB *"); executor.comment("*********************************************************************" + StreamUtil.getLineSeparator()); executor.execute(new CreateDatabaseChangeLogTableStatement()); // DatabaseChangeLogLockTable is created before this code is executed and recreated if it does not exist automatically // in org.keycloak.connections.jpa.updater.liquibase.lock.CustomLockService.init() called indirectly from // KeycloakApplication constructor (search for waitForLock() call). Hence it is not included in the creation script. executor.comment("*********************************************************************" + StreamUtil.getLineSeparator()); ExecutorService.getInstance().setExecutor(database, oldTemplate); }
log.debug(LogType.LOG, String.format("[id = %s] Generating root liquibase file...", id)); String template = StreamUtil.getStreamContents(is); // schema.template.xml