diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9989919..eeccbb4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: name: "Build with ${{ matrix.version }}" strategy: matrix: - version: [ 17 ] + version: [ 11 ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d345af4..42ecfee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: - name: Set up Java uses: actions/setup-java@v3 with: - java-version: '17' + java-version: '11' distribution: 'temurin' - name: Publish package env: diff --git a/.sdkmanrc b/.sdkmanrc index 1ddc532..45c23e0 100644 --- a/.sdkmanrc +++ b/.sdkmanrc @@ -1,2 +1,2 @@ -java=17.0.4-tem +java=11.0.19-tem maven=3.9.1 diff --git a/README.md b/README.md index 43a5fd0..63f5880 100644 --- a/README.md +++ b/README.md @@ -23,11 +23,11 @@ by using [Testcontainers](https://www.testcontainers.org/) and applying database UTF-8 - 17 - 17 + 11 + 11 1.18.3 - 0.0.2 - 3.18.3 + 0.0.3 + 3.16.20 42.6.0 diff --git a/examples/mariadb-flyway-example/pom.xml b/examples/mariadb-flyway-example/pom.xml index e4662b8..b684948 100644 --- a/examples/mariadb-flyway-example/pom.xml +++ b/examples/mariadb-flyway-example/pom.xml @@ -10,12 +10,12 @@ 1.0-SNAPSHOT - 17 - 17 + 11 + 11 UTF-8 1.18.3 - 0.0.2 - 3.18.3 + 0.0.3 + 3.16.20 3.1.2 diff --git a/examples/mysql-flyway-example/pom.xml b/examples/mysql-flyway-example/pom.xml index 5b52764..3018db1 100644 --- a/examples/mysql-flyway-example/pom.xml +++ b/examples/mysql-flyway-example/pom.xml @@ -10,12 +10,12 @@ 1.0-SNAPSHOT - 17 - 17 + 11 + 11 UTF-8 1.18.3 - 0.0.2 - 3.18.3 + 0.0.3 + 3.16.20 8.0.32 diff --git a/examples/postgres-flyway-example/pom.xml b/examples/postgres-flyway-example/pom.xml index 62142c3..fa8e579 100644 --- a/examples/postgres-flyway-example/pom.xml +++ b/examples/postgres-flyway-example/pom.xml @@ -10,13 +10,13 @@ 1.0-SNAPSHOT - 17 - 17 + 11 + 11 UTF-8 1.18.3 - 0.0.2 + 0.0.3 - 3.18.3 + 3.16.20 42.6.0 diff --git a/examples/postgres-liquibase-example/pom.xml b/examples/postgres-liquibase-example/pom.xml index a7e00b2..2c33099 100644 --- a/examples/postgres-liquibase-example/pom.xml +++ b/examples/postgres-liquibase-example/pom.xml @@ -10,12 +10,12 @@ 1.0-SNAPSHOT - 17 - 17 + 11 + 11 UTF-8 1.18.3 - 0.0.2 - 3.18.3 + 0.0.3 + 3.16.20 42.6.0 diff --git a/pom.xml b/pom.xml index b73583a..08bd755 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.testcontainers testcontainers-jooq-codegen-maven-plugin - 0.0.2 + 0.0.3 maven-plugin testcontainers-jooq-codegen-maven-plugin jOOQ code generator using Testcontainers @@ -46,7 +46,7 @@ UTF-8 UTF-8 - 17 + 11 2.36.0 3.9.0 3.8.1 @@ -61,7 +61,7 @@ 9.16.3 4.22.0 5.9.3 - 3.18.3 + 3.16.20 4.13.2 42.6.0 8.0.32 diff --git a/src/main/java/org/testcontainers/jooq/codegen/Plugin.java b/src/main/java/org/testcontainers/jooq/codegen/Plugin.java index 7b85bd0..09a7410 100644 --- a/src/main/java/org/testcontainers/jooq/codegen/Plugin.java +++ b/src/main/java/org/testcontainers/jooq/codegen/Plugin.java @@ -84,10 +84,8 @@ private void doExecute(URLClassLoader mavenClassloader, TargetDatasource targetD final var oFlyway = Optional.ofNullable(flyway); final var oLiquibase = Optional.ofNullable(liquibase); if (bothPresent(oFlyway, oLiquibase)) { - getLog().error( - """ - Incorrect configuration is provided.Plugin supports only one migration tool. - Please remain only flyway or liquibase."""); + getLog().error("Incorrect configuration is provided.Plugin supports only one migration tool.\n" + + "Please remain only flyway or liquibase."); throw new MojoExecutionException( "Both configurations for migration tool are provided, pick either flyway or liquibase"); } diff --git a/src/main/java/org/testcontainers/jooq/codegen/database/DatabaseProvider.java b/src/main/java/org/testcontainers/jooq/codegen/database/DatabaseProvider.java index afbb61c..8c89806 100644 --- a/src/main/java/org/testcontainers/jooq/codegen/database/DatabaseProvider.java +++ b/src/main/java/org/testcontainers/jooq/codegen/database/DatabaseProvider.java @@ -13,12 +13,20 @@ public class DatabaseProvider { public static JdbcDatabaseContainer getDatabaseContainer(DatabaseProps props) { DatabaseType dbType = props.getType(); String image = Optional.ofNullable(props.getContainerImage()).orElse(dbType.getDefaultImage()); - JdbcDatabaseContainer container = - switch (dbType) { - case POSTGRES -> new PostgreSQLContainer<>(image); - case MARIADB -> new MariaDBContainer<>(image); - case MYSQL -> new MySQLContainer<>(image); - }; + JdbcDatabaseContainer container; + switch (dbType) { + case POSTGRES: + container = new PostgreSQLContainer<>(image); + break; + case MARIADB: + container = new MariaDBContainer<>(image); + break; + case MYSQL: + container = new MySQLContainer<>(image); + break; + default: + throw new IllegalArgumentException(String.format("Unknown DatabaseType: %s.", dbType)); + } if (isNotEmpty(props.getUsername())) { container.withUsername(props.getUsername()); } diff --git a/src/main/java/org/testcontainers/jooq/codegen/jooq/JooqGenerator.java b/src/main/java/org/testcontainers/jooq/codegen/jooq/JooqGenerator.java index 0506844..0d4c444 100644 --- a/src/main/java/org/testcontainers/jooq/codegen/jooq/JooqGenerator.java +++ b/src/main/java/org/testcontainers/jooq/codegen/jooq/JooqGenerator.java @@ -64,13 +64,10 @@ private void checkGeneratorArguments(JooqProps jooq, Log log) throws MojoExecuti } log.error("Incorrect configuration of jOOQ code generation tool"); - log.error( - """ - The jOOQ-codegen-maven module's generator configuration is not set up correctly. - This can have a variety of reasons, among which: - - Your pom.xml's contains invalid XML according to %s - - There is a version or artifact mismatch between your pom.xml and your commandline""" - .formatted(XSD_CODEGEN)); + log.error(String.format("The jOOQ-codegen-maven module's generator configuration is not set up correctly.\n" + + "This can have a variety of reasons, among which:\n" + + "- Your pom.xml's contains invalid XML according to %s\n" + + "- There is a version or artifact mismatch between your pom.xml and your commandline\n", XSD_CODEGEN)); throw new MojoExecutionException( "Incorrect configuration of jOOQ code generation tool. See error above for details."); diff --git a/src/test/java/org/testcontainers/jooq/codegen/PluginTest.java b/src/test/java/org/testcontainers/jooq/codegen/PluginTest.java index 1231113..31545a3 100644 --- a/src/test/java/org/testcontainers/jooq/codegen/PluginTest.java +++ b/src/test/java/org/testcontainers/jooq/codegen/PluginTest.java @@ -76,7 +76,7 @@ public void testMariadbLiquibase() throws Exception { } private MavenProject getMavenProject(String dirName) throws Exception { - var baseDir = getTestFile("src/test/resources/pom/%s".formatted(dirName)); + var baseDir = getTestFile(String.format("src/test/resources/pom/%s", dirName)); var mavenProject = mojoRule.readMavenProject(baseDir); mojoRule.getContainer().addComponent(mavenProject, MavenProject.class, ""); return mavenProject; diff --git a/src/test/resources/pom/mariadb-liquibase/pom.xml b/src/test/resources/pom/mariadb-liquibase/pom.xml index 5fd9114..361182f 100644 --- a/src/test/resources/pom/mariadb-liquibase/pom.xml +++ b/src/test/resources/pom/mariadb-liquibase/pom.xml @@ -9,11 +9,11 @@ 0.0.1-SNAPSHOT - 17 + 11 1.18.3 - 0.0.2 + 0.0.3 - 3.18.3 + 3.16.20 42.6.0 diff --git a/src/test/resources/pom/mysql-flyway/pom.xml b/src/test/resources/pom/mysql-flyway/pom.xml index fc2af32..bdce265 100644 --- a/src/test/resources/pom/mysql-flyway/pom.xml +++ b/src/test/resources/pom/mysql-flyway/pom.xml @@ -9,11 +9,11 @@ 0.0.1-SNAPSHOT - 17 + 11 1.18.3 - 0.0.2 + 0.0.3 - 3.18.3 + 3.16.20 42.6.0 diff --git a/src/test/resources/pom/postgres-flyway/pom.xml b/src/test/resources/pom/postgres-flyway/pom.xml index eb54359..77f9828 100644 --- a/src/test/resources/pom/postgres-flyway/pom.xml +++ b/src/test/resources/pom/postgres-flyway/pom.xml @@ -9,10 +9,10 @@ 0.0.1-SNAPSHOT - 17 + 11 1.18.3 - 0.0.2 - 3.18.3 + 0.0.3 + 3.16.20 42.6.0 diff --git a/src/test/resources/pom/postgres-liquibase/pom.xml b/src/test/resources/pom/postgres-liquibase/pom.xml index 2657550..dc5662c 100644 --- a/src/test/resources/pom/postgres-liquibase/pom.xml +++ b/src/test/resources/pom/postgres-liquibase/pom.xml @@ -9,10 +9,10 @@ 0.0.1-SNAPSHOT - 17 + 11 1.18.3 - 0.0.2 - 3.18.3 + 0.0.3 + 3.16.20 42.6.0