diff --git a/pom.xml b/pom.xml
index cda191c4..71627ccd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
no.priv.bang.pom
bang-authservice-client-pom
- 2.0.0
+ 2.0.2
no.priv.bang.ukelonn
ukelonn
diff --git a/ukelonn.backend/pom.xml b/ukelonn.backend/pom.xml
index 8d13a30f..ae987071 100644
--- a/ukelonn.backend/pom.xml
+++ b/ukelonn.backend/pom.xml
@@ -1,7 +1,7 @@
-
+
@@ -54,6 +54,11 @@
authservice.definitions
provided
+
+ no.priv.bang.karaf
+ karaf.liquibase.runner
+ test
+
no.priv.bang.authservice
authservice.db.liquibase
diff --git a/ukelonn.db.liquibase.production/pom.xml b/ukelonn.db.liquibase.production/pom.xml
index 2f6fddfc..a63cb3bd 100644
--- a/ukelonn.db.liquibase.production/pom.xml
+++ b/ukelonn.db.liquibase.production/pom.xml
@@ -1,7 +1,7 @@
-
+
@@ -59,6 +59,11 @@
org.osgi.service.component.annotations
provided
+
+ no.priv.bang.karaf
+ karaf.liquibase.runner
+ provided
+
no.priv.bang.authservice
authservice.db.liquibase
diff --git a/ukelonn.db.liquibase.production/src/main/java/no/priv/bang/ukelonn/db/liquibase/production/ProductionLiquibaseRunner.java b/ukelonn.db.liquibase.production/src/main/java/no/priv/bang/ukelonn/db/liquibase/production/ProductionLiquibaseRunner.java
index caf7b847..5be70190 100644
--- a/ukelonn.db.liquibase.production/src/main/java/no/priv/bang/ukelonn/db/liquibase/production/ProductionLiquibaseRunner.java
+++ b/ukelonn.db.liquibase.production/src/main/java/no/priv/bang/ukelonn/db/liquibase/production/ProductionLiquibaseRunner.java
@@ -15,8 +15,6 @@
*/
package no.priv.bang.ukelonn.db.liquibase.production;
-import static liquibase.command.core.helpers.DbUrlConnectionArgumentsCommandStep.DATABASE_ARG;
-
import java.sql.SQLException;
import java.util.Map;
@@ -30,15 +28,7 @@
import org.osgi.service.log.Logger;
import liquibase.Scope;
-import liquibase.Scope.ScopedRunner;
import liquibase.ThreadLocalScopeManager;
-import liquibase.changelog.ChangeLogParameters;
-import liquibase.command.CommandScope;
-import liquibase.command.core.UpdateCommandStep;
-import liquibase.command.core.helpers.DatabaseChangelogCommandStep;
-import liquibase.database.DatabaseFactory;
-import liquibase.database.jvm.JdbcConnection;
-import liquibase.resource.ClassLoaderResourceAccessor;
import no.priv.bang.ukelonn.db.liquibase.UkelonnLiquibase;
@Component(immediate=true, property = "name=ukelonndb")
@@ -64,27 +54,16 @@ public void prepare(DataSource datasource) throws SQLException {
try {
var liquibase = createUkelonnLiquibase();
liquibase.createInitialSchema(datasource);
- insertInitialDataInDatabase(datasource);
+ insertInitialDataInDatabase(datasource, liquibase);
liquibase.updateSchema(datasource);
} catch (Exception e) {
logger.error("Failed to create ukelonn database schema in the PostgreSQL ukelonn database", e);
}
}
- boolean insertInitialDataInDatabase(DataSource datasource) {
+ boolean insertInitialDataInDatabase(DataSource datasource, UkelonnLiquibase liquibase) {
try(var connect = datasource.getConnection()) {
- try (var database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(connect))) {
- Map scopeObjects = Map.of(
- Scope.Attr.database.name(), database,
- Scope.Attr.resourceAccessor.name(), new ClassLoaderResourceAccessor(getClass().getClassLoader()));
-
- Scope.child(scopeObjects, (ScopedRunner>) () -> new CommandScope("update")
- .addArgumentValue(DATABASE_ARG, database)
- .addArgumentValue(UpdateCommandStep.CHANGELOG_FILE_ARG, initialDataResourceName())
- .addArgumentValue(DatabaseChangelogCommandStep.CHANGELOG_PARAMETERS, new ChangeLogParameters(database))
- .execute());
- }
-
+ liquibase.applyLiquibaseChangelist(connect, initialDataResourceName(), getClass().getClassLoader());
return true;
} catch (Exception e) {
logger.error("Failed to fill ukelonn PostgreSQL database with initial data.", e);
@@ -95,11 +74,11 @@ boolean insertInitialDataInDatabase(DataSource datasource) {
UkelonnLiquibase createUkelonnLiquibase() {
if (ukelonnLiquibaseFactory == null) {
ukelonnLiquibaseFactory = new UkelonnLiquibaseFactory() { // NOSONAR
- @Override
- public UkelonnLiquibase create() {
- return new UkelonnLiquibase();
- }
- };
+ @Override
+ public UkelonnLiquibase create() {
+ return new UkelonnLiquibase();
+ }
+ };
}
return ukelonnLiquibaseFactory.create();
diff --git a/ukelonn.db.liquibase.production/src/test/java/no/priv/bang/ukelonn/db/liquibase/production/ProductionLiquibaseRunnerTest.java b/ukelonn.db.liquibase.production/src/test/java/no/priv/bang/ukelonn/db/liquibase/production/ProductionLiquibaseRunnerTest.java
index c236c586..2997aad6 100644
--- a/ukelonn.db.liquibase.production/src/test/java/no/priv/bang/ukelonn/db/liquibase/production/ProductionLiquibaseRunnerTest.java
+++ b/ukelonn.db.liquibase.production/src/test/java/no/priv/bang/ukelonn/db/liquibase/production/ProductionLiquibaseRunnerTest.java
@@ -29,6 +29,8 @@
import org.osgi.service.jdbc.DataSourceFactory;
import no.priv.bang.osgi.service.mocks.logservice.MockLogService;
+import no.priv.bang.ukelonn.db.liquibase.UkelonnLiquibase;
+
import static no.priv.bang.ukelonn.db.liquibase.production.ProductionLiquibaseRunner.*;
class ProductionLiquibaseRunnerTest {
@@ -72,12 +74,13 @@ void testPrepareWhenSQLExceptionIsThrown() throws Exception {
@Test
void testInsertInitialDataInDatabaseFailToCreateLiquibase() throws Exception {
var runner = new ProductionLiquibaseRunner();
+ var liquibase = new UkelonnLiquibase();
var logservice = new MockLogService();
runner.setLogService(logservice);
runner.activate(Collections.emptyMap());
var datasource = mock(DataSource.class);
when(datasource.getConnection()).thenThrow(SQLException.class);
- var successfullyinserteddata = runner.insertInitialDataInDatabase(datasource );
+ var successfullyinserteddata = runner.insertInitialDataInDatabase(datasource, liquibase);
assertFalse(successfullyinserteddata);
}
diff --git a/ukelonn.db.liquibase.test/pom.xml b/ukelonn.db.liquibase.test/pom.xml
index 02fdd714..cb5d228c 100644
--- a/ukelonn.db.liquibase.test/pom.xml
+++ b/ukelonn.db.liquibase.test/pom.xml
@@ -1,7 +1,7 @@
-
+
@@ -42,6 +42,11 @@
${project.version}
provided
+
+ no.priv.bang.karaf
+ karaf.liquibase.runner
+ provided
+
no.priv.bang.authservice
authservice.db.liquibase
diff --git a/ukelonn.db.liquibase.test/src/main/java/no/priv/bang/ukelonn/db/liquibase/test/TestLiquibaseRunner.java b/ukelonn.db.liquibase.test/src/main/java/no/priv/bang/ukelonn/db/liquibase/test/TestLiquibaseRunner.java
index 9afc2de7..9c110598 100644
--- a/ukelonn.db.liquibase.test/src/main/java/no/priv/bang/ukelonn/db/liquibase/test/TestLiquibaseRunner.java
+++ b/ukelonn.db.liquibase.test/src/main/java/no/priv/bang/ukelonn/db/liquibase/test/TestLiquibaseRunner.java
@@ -15,8 +15,6 @@
*/
package no.priv.bang.ukelonn.db.liquibase.test;
-import static liquibase.command.core.helpers.DbUrlConnectionArgumentsCommandStep.DATABASE_ARG;
-
import java.sql.SQLException;
import java.util.Collections;
import java.util.List;
@@ -33,14 +31,9 @@
import liquibase.Liquibase;
import liquibase.Scope;
-import liquibase.Scope.ScopedRunner;
import liquibase.ThreadLocalScopeManager;
import liquibase.changelog.ChangeLogHistoryServiceFactory;
-import liquibase.changelog.ChangeLogParameters;
import liquibase.changelog.RanChangeSet;
-import liquibase.command.CommandScope;
-import liquibase.command.core.UpdateCommandStep;
-import liquibase.command.core.helpers.DatabaseChangelogCommandStep;
import liquibase.database.DatabaseFactory;
import liquibase.database.jvm.JdbcConnection;
import liquibase.exception.DatabaseException;
@@ -69,27 +62,16 @@ public void prepare(DataSource datasource) throws SQLException {
var liquibase = new UkelonnLiquibase();
try {
liquibase.createInitialSchema(datasource);
- insertMockData(datasource);
+ insertMockData(datasource, liquibase);
liquibase.updateSchema(datasource);
} catch (Exception e) {
logger.error("Failed to create derby test database schema", e);
}
}
- public boolean insertMockData(DataSource datasource) {
+ public boolean insertMockData(DataSource datasource, UkelonnLiquibase liquibase) {
try(var connect = datasource.getConnection()) {
- try (var database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(connect))) {
- Map scopeObjects = Map.of(
- Scope.Attr.database.name(), database,
- Scope.Attr.resourceAccessor.name(), new ClassLoaderResourceAccessor(getClass().getClassLoader()));
-
- Scope.child(scopeObjects, (ScopedRunner>) () -> new CommandScope("update")
- .addArgumentValue(DATABASE_ARG, database)
- .addArgumentValue(UpdateCommandStep.CHANGELOG_FILE_ARG, dummyDataResourceName())
- .addArgumentValue(DatabaseChangelogCommandStep.CHANGELOG_PARAMETERS, new ChangeLogParameters(database))
- .execute());
- }
-
+ liquibase.applyLiquibaseChangelist(connect, dummyDataResourceName(), getClass().getClassLoader());
return true;
} catch (Exception e) {
logger.error("Failed to fill derby test database with data.", e);
diff --git a/ukelonn.db.liquibase.test/src/test/java/no/priv/bang/ukelonn/db/liquibase/test/TestLiquibaseRunnerTest.java b/ukelonn.db.liquibase.test/src/test/java/no/priv/bang/ukelonn/db/liquibase/test/TestLiquibaseRunnerTest.java
index 16ad7e6e..bbe86585 100644
--- a/ukelonn.db.liquibase.test/src/test/java/no/priv/bang/ukelonn/db/liquibase/test/TestLiquibaseRunnerTest.java
+++ b/ukelonn.db.liquibase.test/src/test/java/no/priv/bang/ukelonn/db/liquibase/test/TestLiquibaseRunnerTest.java
@@ -23,7 +23,6 @@
import java.sql.SQLException;
import java.util.Base64;
import java.util.Collections;
-import java.util.Map;
import java.util.Properties;
import javax.sql.DataSource;
@@ -40,22 +39,11 @@
import org.junit.jupiter.api.Test;
import org.ops4j.pax.jdbc.derby.impl.DerbyDataSourceFactory;
import org.osgi.service.jdbc.DataSourceFactory;
-import liquibase.Scope;
-import liquibase.Scope.ScopedRunner;
-import liquibase.changelog.ChangeLogParameters;
-import liquibase.command.CommandScope;
-import liquibase.command.core.UpdateCommandStep;
-import liquibase.command.core.helpers.DatabaseChangelogCommandStep;
-import liquibase.database.DatabaseFactory;
-import liquibase.database.jvm.JdbcConnection;
import liquibase.exception.DatabaseException;
import liquibase.exception.LiquibaseException;
-import liquibase.resource.ClassLoaderResourceAccessor;
import no.priv.bang.osgi.service.mocks.logservice.MockLogService;
-import no.priv.bang.ukelonn.UkelonnException;
import no.priv.bang.ukelonn.db.liquibase.UkelonnLiquibase;
-import static liquibase.command.core.helpers.DbUrlConnectionArgumentsCommandStep.DATABASE_ARG;
import static no.priv.bang.ukelonn.db.liquibase.test.TestLiquibaseRunner.*;
class TestLiquibaseRunnerTest {
@@ -236,11 +224,12 @@ void testInsert() throws SQLException {
@Test
void testFailToInsertMockData() throws SQLException {
var runner = new TestLiquibaseRunner();
+ var liquibase = new UkelonnLiquibase();
runner.setLogService(new MockLogService());
var datasource = mock(DataSource.class);
when(datasource.getConnection()).thenThrow(SQLException.class);
- var result = runner.insertMockData(datasource);
+ var result = runner.insertMockData(datasource, liquibase);
assertFalse(result);
}
@@ -397,7 +386,7 @@ void testCreateHashedPasswords() {
*/
@Disabled("Not an actual unit test. This test is a convenient way to populate a derby network server running on localhost, with the ukelonn schema and test data, using liquibase.")
@Test
- void addUkelonnSchemaAndDataToDerbyServer() throws SQLException, LiquibaseException { // NOSONAR This isn't an actual test, see the comments
+ void addUkelonnSchemaAndDataToDerbyServer() throws Exception { // NOSONAR This isn't an actual test, see the comments
var createUkelonnDatabase = true;
var dataSource = new ClientConnectionPoolDataSource();
dataSource.setServerName("localhost");
@@ -411,21 +400,7 @@ void addUkelonnSchemaAndDataToDerbyServer() throws SQLException, LiquibaseExcept
liquibase.createInitialSchema(dataSource);
try(var connect = dataSource.getConnection()) {
- try (var database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(connect))) {
- Map scopeObjects = Map.of(
- Scope.Attr.database.name(), database,
- Scope.Attr.resourceAccessor.name(), new ClassLoaderResourceAccessor(getClass().getClassLoader()));
-
- Scope.child(scopeObjects, (ScopedRunner>) () -> new CommandScope("update")
- .addArgumentValue(DATABASE_ARG, database)
- .addArgumentValue(UpdateCommandStep.CHANGELOG_FILE_ARG, "sql/data/db-changelog.xml")
- .addArgumentValue(DatabaseChangelogCommandStep.CHANGELOG_PARAMETERS, new ChangeLogParameters(database))
- .execute());
- } catch (LiquibaseException e) {
- throw e;
- } catch (Exception e) {
- throw new UkelonnException("Failed to close resource when inserting data");
- }
+ liquibase.applyLiquibaseChangelist(connect, "sql/data/db-changelog.xml", getClass().getClassLoader());
}
liquibase.updateSchema(dataSource);
diff --git a/ukelonn.db.liquibase/pom.xml b/ukelonn.db.liquibase/pom.xml
index c5b711f4..2f901752 100644
--- a/ukelonn.db.liquibase/pom.xml
+++ b/ukelonn.db.liquibase/pom.xml
@@ -1,7 +1,7 @@
-
+
@@ -65,6 +65,17 @@
xml
features
+
+ no.priv.bang.karaf
+ karaf.liquibase.runner
+ xml
+ features
+
+
+ no.priv.bang.karaf
+ karaf.liquibase.runner
+ provided
+
no.priv.bang.authservice
authservice.db.liquibase
@@ -140,36 +151,6 @@
maven-bundle-plugin
-
- osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)",
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.serializer.ChangeLogSerializer)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.parser.NamespaceDetails)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.database.Database)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.change.Change)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.database.DatabaseConnection)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.precondition.Precondition)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.serializer.SnapshotSerializer)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.configuration.AutoloadedConfigurations)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.diff.DiffGenerator)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.lockservice.LockService)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.changelog.ChangeLogHistoryService)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.datatype.LiquibaseDataType)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.configuration.ConfigurationValueProvider)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.logging.LogService)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.snapshot.SnapshotGenerator)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.parser.ChangeLogParser)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.servicelocator.ServiceLocator)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.diff.compare.DatabaseObjectComparator)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.command.LiquibaseCommand)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.license.LicenseService)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.diff.output.changelog.ChangeGenerator)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.executor.Executor)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.structure.DatabaseObject)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.parser.SnapshotParser)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.hub.HubService)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.command.CommandStep)"; cardinality:=multiple,
- osgi.serviceloader; filter:="(osgi.serviceloader=liquibase.sqlgenerator.SqlGenerator)"; cardinality:=multiple
-
/=target/classes/,
/www.liquibase.org/=target/dependency/www.liquibase.org/
diff --git a/ukelonn.db.liquibase/src/main/java/no/priv/bang/ukelonn/db/liquibase/UkelonnLiquibase.java b/ukelonn.db.liquibase/src/main/java/no/priv/bang/ukelonn/db/liquibase/UkelonnLiquibase.java
index 5921c8cc..3c21f5d2 100644
--- a/ukelonn.db.liquibase/src/main/java/no/priv/bang/ukelonn/db/liquibase/UkelonnLiquibase.java
+++ b/ukelonn.db.liquibase/src/main/java/no/priv/bang/ukelonn/db/liquibase/UkelonnLiquibase.java
@@ -15,44 +15,23 @@
*/
package no.priv.bang.ukelonn.db.liquibase;
-import static liquibase.command.core.helpers.DbUrlConnectionArgumentsCommandStep.DATABASE_ARG;
-
-import java.util.Map;
-
+import java.sql.Connection;
import javax.sql.DataSource;
-import liquibase.Scope;
-import liquibase.Scope.ScopedRunner;
-import liquibase.changelog.ChangeLogParameters;
-import liquibase.command.CommandScope;
-import liquibase.command.core.UpdateCommandStep;
-import liquibase.command.core.helpers.DatabaseChangelogCommandStep;
-import liquibase.database.DatabaseFactory;
-import liquibase.database.jvm.JdbcConnection;
+import liquibase.exception.DatabaseException;
import liquibase.exception.LiquibaseException;
-import liquibase.resource.ClassLoaderResourceAccessor;
import no.priv.bang.authservice.db.liquibase.AuthserviceLiquibase;
import no.priv.bang.authservice.definitions.AuthserviceException;
+import no.priv.bang.karaf.liquibase.runner.LiquibaseClassPathChangeLogRunner;
import no.priv.bang.ukelonn.UkelonnException;
-public class UkelonnLiquibase {
+public class UkelonnLiquibase extends LiquibaseClassPathChangeLogRunner {
- private static final String UPDATE = "update";
static final String ERROR_CLOSING_RESOURCE_WHEN_UPDATING_UKELONN_SCHEMA = "Error closing resource when updating ukelonn schema";
public void createInitialSchema(DataSource datasource) throws LiquibaseException {
try (var connect = datasource.getConnection()) {
- try (var database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(connect))) {
- Map scopeObjects = Map.of(
- Scope.Attr.database.name(), database,
- Scope.Attr.resourceAccessor.name(), new ClassLoaderResourceAccessor(getClass().getClassLoader()));
-
- Scope.child(scopeObjects, (ScopedRunner>) () -> new CommandScope(UPDATE)
- .addArgumentValue(DATABASE_ARG, database)
- .addArgumentValue(UpdateCommandStep.CHANGELOG_FILE_ARG, "ukelonn-db-changelog/db-changelog-1.0.0.xml")
- .addArgumentValue(DatabaseChangelogCommandStep.CHANGELOG_PARAMETERS, new ChangeLogParameters(database))
- .execute());
- }
+ applyLiquibaseChangelist(connect, "ukelonn-db-changelog/db-changelog-1.0.0.xml");
} catch (LiquibaseException e) {
throw e;
} catch (Exception e1) {
@@ -62,17 +41,7 @@ public void createInitialSchema(DataSource datasource) throws LiquibaseException
public void updateSchema(DataSource datasource) throws LiquibaseException {
try (var connect = datasource.getConnection()) {
- try (var database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(connect))) {
- Map scopeObjects = Map.of(
- Scope.Attr.database.name(), database,
- Scope.Attr.resourceAccessor.name(), new ClassLoaderResourceAccessor(getClass().getClassLoader()));
-
- Scope.child(scopeObjects, (ScopedRunner>) () -> new CommandScope(UPDATE)
- .addArgumentValue(DATABASE_ARG, database)
- .addArgumentValue(UpdateCommandStep.CHANGELOG_FILE_ARG, "ukelonn-db-changelog/db-changelog-1.0.1.xml")
- .addArgumentValue(DatabaseChangelogCommandStep.CHANGELOG_PARAMETERS, new ChangeLogParameters(database))
- .execute());
- }
+ applyLiquibaseChangelist(connect, "ukelonn-db-changelog/db-changelog-1.0.1.xml");
} catch (LiquibaseException e) {
throw e;
} catch (Exception e1) {
@@ -89,17 +58,7 @@ public void updateSchema(DataSource datasource) throws LiquibaseException {
}
try (var connect = datasource.getConnection()) {
- try (var database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(connect))) {
- Map scopeObjects = Map.of(
- Scope.Attr.database.name(), database,
- Scope.Attr.resourceAccessor.name(), new ClassLoaderResourceAccessor(getClass().getClassLoader()));
-
- Scope.child(scopeObjects, (ScopedRunner>) () -> new CommandScope(UPDATE)
- .addArgumentValue(DATABASE_ARG, database)
- .addArgumentValue(UpdateCommandStep.CHANGELOG_FILE_ARG, "ukelonn-db-changelog/db-changelog.xml")
- .addArgumentValue(DatabaseChangelogCommandStep.CHANGELOG_PARAMETERS, new ChangeLogParameters(database))
- .execute());
- }
+ applyLiquibaseChangelist(connect, "ukelonn-db-changelog/db-changelog.xml");
} catch (LiquibaseException e) {
throw e;
} catch (Exception e1) {
@@ -107,4 +66,8 @@ public void updateSchema(DataSource datasource) throws LiquibaseException {
}
}
+ private void applyLiquibaseChangelist(Connection connect, String liquibaseChangeLogClassPathResource) throws Exception, DatabaseException {
+ applyLiquibaseChangelist(connect, liquibaseChangeLogClassPathResource, getClass().getClassLoader());
+ }
+
}
diff --git a/ukelonn.web.security/pom.xml b/ukelonn.web.security/pom.xml
index db40ef3e..56c90971 100644
--- a/ukelonn.web.security/pom.xml
+++ b/ukelonn.web.security/pom.xml
@@ -1,7 +1,7 @@
-
+
@@ -47,6 +47,11 @@
authservice.definitions
test
+
+ no.priv.bang.karaf
+ karaf.liquibase.runner
+ test
+
no.priv.bang.authservice
authservice.db.liquibase