use of liquibase.parser.ChangeLogParser in project liquibase by liquibase.
the class RegisterChangelogCommandStep method parseChangeLogFile.
private DatabaseChangeLog parseChangeLogFile(String changeLogFile) throws LiquibaseException {
ResourceAccessor resourceAccessor = Scope.getCurrentScope().getResourceAccessor();
ChangeLogParser parser = ChangeLogParserFactory.getInstance().getParser(changeLogFile, resourceAccessor);
ChangeLogParameters changeLogParameters = new ChangeLogParameters();
return parser.parse(changeLogFile, changeLogParameters, resourceAccessor);
}
use of liquibase.parser.ChangeLogParser in project keycloak by keycloak.
the class QuarkusLiquibaseConnectionProvider method baseLiquibaseInitialization.
protected void baseLiquibaseInitialization(KeycloakSession session) {
resourceAccessor = new ClassLoaderResourceAccessor(getClass().getClassLoader());
// disables XML validation
for (ChangeLogParser parser : ChangeLogParserFactory.getInstance().getParsers()) {
if (parser instanceof XMLChangeLogSAXParser) {
Method getSaxParserFactory = null;
try {
getSaxParserFactory = XMLChangeLogSAXParser.class.getDeclaredMethod("getSaxParserFactory");
getSaxParserFactory.setAccessible(true);
SAXParserFactory saxParserFactory = (SAXParserFactory) getSaxParserFactory.invoke(parser);
saxParserFactory.setValidating(false);
saxParserFactory.setSchema(null);
} catch (Exception e) {
logger.warnf("Failed to disable liquibase XML validations");
} finally {
if (getSaxParserFactory != null) {
getSaxParserFactory.setAccessible(false);
}
}
}
}
}
Aggregations