diff --git a/packages/kogito-db-migrator-tool/env/index.js b/packages/kogito-db-migrator-tool/env/index.js index 8938b690b7f..fa7de21dad9 100644 --- a/packages/kogito-db-migrator-tool/env/index.js +++ b/packages/kogito-db-migrator-tool/env/index.js @@ -19,7 +19,7 @@ const { varsWithName, composeEnv } = require("@kie-tools-scripts/build-env"); -module.exports = composeEnv([require("@kie-tools/root-env/env")], { +module.exports = composeEnv([require("@kie-tools/root-env/env"), require("@kie-tools/maven-base/env")], { vars: varsWithName({}), get env() { return { diff --git a/packages/kogito-db-migrator-tool/install.js b/packages/kogito-db-migrator-tool/install.js index 26b71a097ba..281ee1f9f2a 100644 --- a/packages/kogito-db-migrator-tool/install.js +++ b/packages/kogito-db-migrator-tool/install.js @@ -21,12 +21,7 @@ const { setupMavenConfigFile, buildTailFromPackageJsonDependencies } = require(" setupMavenConfigFile( ` - --batch-mode - -Dstyle.color=always - -Drevision=${env.devDeploymentQuarkusApp.version} - -Dversion.quarkus=${env.versions.quarkus} - -Dversion.org.kie.kogito=${env.versions.kogito} + -Drevision=${env.kogitoDBMigratorTool.version} -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()} -`, - { ignoreDefault: true } // Can't have special configuration that only works inside this repo. +` ); diff --git a/packages/kogito-db-migrator-tool/package.json b/packages/kogito-db-migrator-tool/package.json index f1cb0ccdc16..7ca5e31839b 100644 --- a/packages/kogito-db-migrator-tool/package.json +++ b/packages/kogito-db-migrator-tool/package.json @@ -17,6 +17,7 @@ "build:prod": "pnpm pre-build && run-script-os", "build:prod:darwin:linux": "mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures)", "build:prod:win32": "pnpm powershell \"mvn clean install `-DskipTests=$(build-env tests.run --not) `-Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures)\"", + "install": "node install.js", "pre-build": "mvn dependency:unpack" }, "dependencies": { diff --git a/packages/kogito-db-migrator-tool/pom.xml b/packages/kogito-db-migrator-tool/pom.xml index 4948189277d..92cdeaaa5ea 100644 --- a/packages/kogito-db-migrator-tool/pom.xml +++ b/packages/kogito-db-migrator-tool/pom.xml @@ -31,7 +31,7 @@ 4.0.0 org.kie.kogito - sonataflow-db-migrator + kogito-db-migrator-tool @@ -61,11 +61,6 @@ mockito-core test - - com.github.stefanbirkner - system-rules - test - diff --git a/packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/DBMigratorTest.java b/packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/DBMigratorTest.java index 8fe45292b79..abb0516f364 100644 --- a/packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/DBMigratorTest.java +++ b/packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/DBMigratorTest.java @@ -20,8 +20,6 @@ package org.kie.kogito.postgresql.migrator; import io.quarkus.test.Mock; -import org.junit.Rule; -import org.junit.contrib.java.lang.system.ExpectedSystemExit; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -33,8 +31,6 @@ import static org.mockito.Mockito.times; class DBMigratorTest { - @Rule - final ExpectedSystemExit exitRule = ExpectedSystemExit.none(); @Mock MigrationService migrationService; @@ -55,7 +51,6 @@ void testMigratorWithNoMigrations() throws Exception { dbMigrator.migrateDataIndex = false; dbMigrator.migrateJobsService = false; - exitRule.expectSystemExitWithStatus(0); dbMigrator.run(); verify(dbConnectionChecker, times(0)).checkDataIndexDBConnection(); verify(dbConnectionChecker, times(0)).checkJobsServiceDBConnection(); @@ -70,7 +65,6 @@ void testMigratorWithAllMigrations() throws Exception { dbMigrator.dbConnectionChecker = dbConnectionChecker; dbMigrator.service = migrationService; - exitRule.expectSystemExitWithStatus(0); dbMigrator.run(); verify(dbConnectionChecker, times(1)).checkDataIndexDBConnection(); verify(dbConnectionChecker, times(1)).checkJobsServiceDBConnection(); @@ -87,7 +81,6 @@ void testDataIndexMigrationWithException() throws Exception { doThrow(new SQLException()).when(dbConnectionChecker).checkDataIndexDBConnection(); - exitRule.expectSystemExitWithStatus(-1); dbMigrator.run(); verify(migrationService, times(0)).migrateDataIndex(); verify(migrationService, times(0)).migrateJobsService(); @@ -102,7 +95,6 @@ void testJobsServiceWithException() throws Exception { doThrow(new SQLException()).when(dbConnectionChecker).checkJobsServiceDBConnection(); - exitRule.expectSystemExitWithStatus(-2); dbMigrator.run(); verify(migrationService, times(0)).migrateDataIndex(); verify(migrationService, times(0)).migrateJobsService(); diff --git a/packages/maven-base/pom.xml b/packages/maven-base/pom.xml index 9bc328fc232..b428d372ea8 100644 --- a/packages/maven-base/pom.xml +++ b/packages/maven-base/pom.xml @@ -141,7 +141,6 @@ 0.4 0.23.0 0.8.12 - 1.19.0 @@ -265,12 +264,6 @@ ${version.org.mockito} test - - com.github.stefanbirkner - system-rules - ${version.com.github.stefanbirkner.systemrules} - test -