From b77fefd242fda1751bf18ad3d2a1b6b0f1944177 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Fri, 16 Aug 2024 06:23:12 +1000 Subject: [PATCH] feat: add bom and build parent Fixes: #2375 --- .../cronjobs/testdata/java/cron/pom.xml | 123 +----------- .../leases/testdata/java/leases/pom.xml | 137 +------------- .../pubsub/testdata/java/publisher/pom.xml | 137 +------------- .../pubsub/testdata/java/subscriber/pom.xml | 137 +------------- buildengine/build_java.go | 40 +++- examples/kotlin/echo/pom.xml | 178 +----------------- .../echo/src/main/ftl-module-schema/time.pb | Bin 96 -> 92 bytes examples/kotlin/time/pom.xml | 178 +----------------- jvm-runtime/ftl-runtime/common/bom/pom.xml | 102 ++++++++++ .../ftl-runtime/common/build-parent/pom.xml | 124 ++++++++++++ .../ftl-runtime/common/deployment/pom.xml | 2 +- jvm-runtime/ftl-runtime/common/pom.xml | 8 +- .../ftl-runtime/common/runtime/pom.xml | 2 +- .../ftl-runtime/java/build-parent/pom.xml | 22 +++ jvm-runtime/ftl-runtime/java/pom.xml | 3 +- .../ftl-runtime/kotlin/build-parent/pom.xml | 68 +++++++ jvm-runtime/ftl-runtime/kotlin/pom.xml | 3 +- jvm-runtime/ftl-runtime/pom.xml | 2 +- .../ftl-runtime/test-framework/pom.xml | 2 +- jvm-runtime/testdata/java/javamodule/pom.xml | 137 +------------- .../xyz/block/ftl/java/test/TestInvokeGo.java | 19 +- 21 files changed, 408 insertions(+), 1016 deletions(-) create mode 100644 jvm-runtime/ftl-runtime/common/bom/pom.xml create mode 100644 jvm-runtime/ftl-runtime/common/build-parent/pom.xml create mode 100644 jvm-runtime/ftl-runtime/java/build-parent/pom.xml create mode 100644 jvm-runtime/ftl-runtime/kotlin/build-parent/pom.xml diff --git a/backend/controller/cronjobs/testdata/java/cron/pom.xml b/backend/controller/cronjobs/testdata/java/cron/pom.xml index 36689c121..452f82ee8 100644 --- a/backend/controller/cronjobs/testdata/java/cron/pom.xml +++ b/backend/controller/cronjobs/testdata/java/cron/pom.xml @@ -5,123 +5,10 @@ cron 1.0-SNAPSHOT - - 1.0-SNAPSHOT - 3.13.0 - 2.0.0 - 17 - UTF-8 - UTF-8 - quarkus-bom - io.quarkus.platform - 3.12.3 - true - 3.2.5 - - - - - - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} - pom - import - - - - - - - xyz.block.ftl - ftl-java-runtime - 1.0-SNAPSHOT - - - io.quarkus - quarkus-kotlin - - - io.quarkus - quarkus-jackson - - - io.quarkus - quarkus-rest-jackson - - - io.quarkus - quarkus-junit5 - test - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - - - io.rest-assured - kotlin-extensions - test - - - - - - - ${quarkus.platform.group-id} - quarkus-maven-plugin - ${quarkus.platform.version} - true - - - - build - generate-code - generate-code-tests - native-image-agent - - - - - - maven-compiler-plugin - ${compiler-plugin.version} - - - -parameters - - - - - maven-surefire-plugin - ${surefire-plugin.version} - - - org.jboss.logmanager.LogManager - ${maven.home} - - - - - maven-failsafe-plugin - ${surefire-plugin.version} - - - - integration-test - verify - - - - - - ${project.build.directory}/${project.build.finalName}-runner - org.jboss.logmanager.LogManager - ${maven.home} - - - - - + + xyz.block.ftl + ftl-build-parent-java + 1.0-SNAPSHOT + diff --git a/backend/controller/leases/testdata/java/leases/pom.xml b/backend/controller/leases/testdata/java/leases/pom.xml index 3432ab218..4a713b4c3 100644 --- a/backend/controller/leases/testdata/java/leases/pom.xml +++ b/backend/controller/leases/testdata/java/leases/pom.xml @@ -5,137 +5,10 @@ leases 1.0-SNAPSHOT - - 1.0-SNAPSHOT - 3.13.0 - 2.0.0 - 17 - UTF-8 - UTF-8 - quarkus-bom - io.quarkus.platform - 3.12.3 - true - 3.2.5 - + + xyz.block.ftl + ftl-build-parent-java + 1.0-SNAPSHOT + - - - - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} - pom - import - - - - - - - xyz.block.ftl - ftl-java-runtime - 1.0-SNAPSHOT - - - io.quarkus - quarkus-kotlin - - - io.quarkus - quarkus-jackson - - - io.quarkus - quarkus-rest-jackson - - - io.quarkus - quarkus-junit5 - test - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - - - io.rest-assured - kotlin-extensions - test - - - - - - - ${quarkus.platform.group-id} - quarkus-maven-plugin - ${quarkus.platform.version} - true - - - - build - generate-code - generate-code-tests - native-image-agent - - - - - - maven-compiler-plugin - ${compiler-plugin.version} - - - -parameters - - - - - maven-surefire-plugin - ${surefire-plugin.version} - - - org.jboss.logmanager.LogManager - ${maven.home} - - - - - maven-failsafe-plugin - ${surefire-plugin.version} - - - - integration-test - verify - - - - - - ${project.build.directory}/${project.build.finalName}-runner - org.jboss.logmanager.LogManager - ${maven.home} - - - - - - - - - native - - - native - - - - false - true - - - diff --git a/backend/controller/pubsub/testdata/java/publisher/pom.xml b/backend/controller/pubsub/testdata/java/publisher/pom.xml index ec33ab173..dc3796964 100644 --- a/backend/controller/pubsub/testdata/java/publisher/pom.xml +++ b/backend/controller/pubsub/testdata/java/publisher/pom.xml @@ -5,137 +5,10 @@ publisher 1.0-SNAPSHOT - - 1.0-SNAPSHOT - 3.13.0 - 2.0.0 - 17 - UTF-8 - UTF-8 - quarkus-bom - io.quarkus.platform - 3.12.3 - true - 3.2.5 - + + xyz.block.ftl + ftl-build-parent-java + 1.0-SNAPSHOT + - - - - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} - pom - import - - - - - - - xyz.block.ftl - ftl-java-runtime - 1.0-SNAPSHOT - - - io.quarkus - quarkus-kotlin - - - io.quarkus - quarkus-jackson - - - io.quarkus - quarkus-rest-jackson - - - io.quarkus - quarkus-junit5 - test - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - - - io.rest-assured - kotlin-extensions - test - - - - - - - ${quarkus.platform.group-id} - quarkus-maven-plugin - ${quarkus.platform.version} - true - - - - build - generate-code - generate-code-tests - native-image-agent - - - - - - maven-compiler-plugin - ${compiler-plugin.version} - - - -parameters - - - - - maven-surefire-plugin - ${surefire-plugin.version} - - - org.jboss.logmanager.LogManager - ${maven.home} - - - - - maven-failsafe-plugin - ${surefire-plugin.version} - - - - integration-test - verify - - - - - - ${project.build.directory}/${project.build.finalName}-runner - org.jboss.logmanager.LogManager - ${maven.home} - - - - - - - - - native - - - native - - - - false - true - - - diff --git a/backend/controller/pubsub/testdata/java/subscriber/pom.xml b/backend/controller/pubsub/testdata/java/subscriber/pom.xml index cd32d7c0c..1f1adda42 100644 --- a/backend/controller/pubsub/testdata/java/subscriber/pom.xml +++ b/backend/controller/pubsub/testdata/java/subscriber/pom.xml @@ -5,137 +5,10 @@ subscriber 1.0-SNAPSHOT - - 1.0-SNAPSHOT - 3.13.0 - 2.0.0 - 17 - UTF-8 - UTF-8 - quarkus-bom - io.quarkus.platform - 3.12.3 - true - 3.2.5 - + + xyz.block.ftl + ftl-build-parent-java + 1.0-SNAPSHOT + - - - - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} - pom - import - - - - - - - xyz.block.ftl - ftl-java-runtime - 1.0-SNAPSHOT - - - io.quarkus - quarkus-kotlin - - - io.quarkus - quarkus-jackson - - - io.quarkus - quarkus-rest-jackson - - - io.quarkus - quarkus-junit5 - test - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - - - io.rest-assured - kotlin-extensions - test - - - - - - - ${quarkus.platform.group-id} - quarkus-maven-plugin - ${quarkus.platform.version} - true - - - - build - generate-code - generate-code-tests - native-image-agent - - - - - - maven-compiler-plugin - ${compiler-plugin.version} - - - -parameters - - - - - maven-surefire-plugin - ${surefire-plugin.version} - - - org.jboss.logmanager.LogManager - ${maven.home} - - - - - maven-failsafe-plugin - ${surefire-plugin.version} - - - - integration-test - verify - - - - - - ${project.build.directory}/${project.build.finalName}-runner - org.jboss.logmanager.LogManager - ${maven.home} - - - - - - - - - native - - - native - - - - false - true - - - diff --git a/buildengine/build_java.go b/buildengine/build_java.go index b136ed5ac..4b4994b4a 100644 --- a/buildengine/build_java.go +++ b/buildengine/build_java.go @@ -15,7 +15,9 @@ import ( func buildJavaModule(ctx context.Context, module Module) error { logger := log.FromContext(ctx) if err := SetPOMProperties(ctx, module.Config.Dir); err != nil { - return fmt.Errorf("unable to update ftl.version in %s: %w", module.Config.Dir, err) + // This is not a critical error, things will probably work fine + // TBH updating the pom is maybe not the best idea anyway + logger.Warnf("unable to update ftl.version in %s: %s", module.Config.Dir, err.Error()) } logger.Infof("Using build command '%s'", module.Config.Build) err := exec.Command(ctx, log.Debug, module.Config.Dir, "bash", "-c", module.Config.Build).RunBuffered(ctx) @@ -44,6 +46,37 @@ func SetPOMProperties(ctx context.Context, baseDir string) error { return fmt.Errorf("unable to read %s: %w", pomFile, err) } root := tree.Root() + + parent := root.SelectElement("parent") + versionSet := false + if parent != nil { + // You can't use properties in the parent + // If they are using our parent then we want to update the version + group := parent.SelectElement("groupId") + artifact := parent.SelectElement("artifactId") + if group.Text() == "xyz.block.ftl" && (artifact.Text() == "ftl-build-parent-java" || artifact.Text() == "ftl-build-parent-kotlin") { + version := parent.SelectElement("version") + if version != nil { + version.SetText(ftlVersion) + versionSet = true + } + } + } + + err := updatePomProperties(root, pomFile, ftlVersion) + if err != nil && !versionSet { + // This is only a failure if we also did not update the parent + return err + } + + err = tree.WriteToFile(pomFile) + if err != nil { + return fmt.Errorf("unable to write %s: %w", pomFile, err) + } + return nil +} + +func updatePomProperties(root *etree.Element, pomFile string, ftlVersion string) error { properties := root.SelectElement("properties") if properties == nil { return fmt.Errorf("unable to find in %s", pomFile) @@ -53,10 +86,5 @@ func SetPOMProperties(ctx context.Context, baseDir string) error { return fmt.Errorf("unable to find / in %s", pomFile) } version.SetText(ftlVersion) - - err := tree.WriteToFile(pomFile) - if err != nil { - return fmt.Errorf("unable to write %s: %w", pomFile, err) - } return nil } diff --git a/examples/kotlin/echo/pom.xml b/examples/kotlin/echo/pom.xml index c22eb5f86..7c79558f3 100644 --- a/examples/kotlin/echo/pom.xml +++ b/examples/kotlin/echo/pom.xml @@ -5,178 +5,10 @@ echo 1.0-SNAPSHOT - - 1.0-SNAPSHOT - 3.13.0 - 2.0.0 - 17 - UTF-8 - UTF-8 - quarkus-bom - io.quarkus.platform - 3.12.3 - true - 3.2.5 - + + xyz.block.ftl + ftl-build-parent-kotlin + 1.0-SNAPSHOT + - - - - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} - pom - import - - - - - - - xyz.block.ftl - ftl-java-runtime - 1.0-SNAPSHOT - - - io.quarkus - quarkus-kotlin - - - io.quarkus - quarkus-jackson - - - io.quarkus - quarkus-rest-jackson - - - io.quarkus - quarkus-junit5 - test - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - - - io.rest-assured - kotlin-extensions - test - - - - - src/main/kotlin - src/test/kotlin - - - ${quarkus.platform.group-id} - quarkus-maven-plugin - ${quarkus.platform.version} - true - - - - build - generate-code - generate-code-tests - native-image-agent - - - - - - maven-compiler-plugin - ${compiler-plugin.version} - - - -parameters - - - - - maven-surefire-plugin - ${surefire-plugin.version} - - - org.jboss.logmanager.LogManager - ${maven.home} - - - - - maven-failsafe-plugin - ${surefire-plugin.version} - - - - integration-test - verify - - - - - - ${project.build.directory}/${project.build.finalName}-runner - org.jboss.logmanager.LogManager - ${maven.home} - - - - - org.jetbrains.kotlin - kotlin-maven-plugin - ${kotlin.version} - - - compile - - compile - - - - test-compile - - test-compile - - - - - - org.jetbrains.kotlin - kotlin-maven-allopen - ${kotlin.version} - - - - true - 17 - - all-open - - - - - - - - - - - - - - - native - - - native - - - - false - true - - - diff --git a/examples/kotlin/echo/src/main/ftl-module-schema/time.pb b/examples/kotlin/echo/src/main/ftl-module-schema/time.pb index 05389c8baa7a903a0b86d8cc45d842faa33668d4..210dd6c843a66a92ca2cdf10fe4640f35bf21f92 100644 GIT binary patch delta 29 kcmYd@5#VA_VkybYP1RE2QsQEeV4TP&&#WV)HPJu|08t<8 delta 34 pcmaz^;NxOYVkybYP1RE3Qs82kC?L;lBxEqrNQ=#ig^P)c0RVDk1*iZ3 diff --git a/examples/kotlin/time/pom.xml b/examples/kotlin/time/pom.xml index 90987014b..3d89a3e9a 100644 --- a/examples/kotlin/time/pom.xml +++ b/examples/kotlin/time/pom.xml @@ -5,178 +5,10 @@ time 1.0-SNAPSHOT - - 1.0-SNAPSHOT - 3.13.0 - 2.0.0 - 17 - UTF-8 - UTF-8 - quarkus-bom - io.quarkus.platform - 3.12.3 - true - 3.2.5 - + + xyz.block.ftl + ftl-build-parent-kotlin + 1.0-SNAPSHOT + - - - - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} - pom - import - - - - - - - xyz.block.ftl - ftl-java-runtime - 1.0-SNAPSHOT - - - io.quarkus - quarkus-kotlin - - - io.quarkus - quarkus-jackson - - - io.quarkus - quarkus-rest-jackson - - - io.quarkus - quarkus-junit5 - test - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - - - io.rest-assured - kotlin-extensions - test - - - - - src/main/kotlin - src/test/kotlin - - - ${quarkus.platform.group-id} - quarkus-maven-plugin - ${quarkus.platform.version} - true - - - - build - generate-code - generate-code-tests - native-image-agent - - - - - - maven-compiler-plugin - ${compiler-plugin.version} - - - -parameters - - - - - maven-surefire-plugin - ${surefire-plugin.version} - - - org.jboss.logmanager.LogManager - ${maven.home} - - - - - maven-failsafe-plugin - ${surefire-plugin.version} - - - - integration-test - verify - - - - - - ${project.build.directory}/${project.build.finalName}-runner - org.jboss.logmanager.LogManager - ${maven.home} - - - - - org.jetbrains.kotlin - kotlin-maven-plugin - ${kotlin.version} - - - compile - - compile - - - - test-compile - - test-compile - - - - - - org.jetbrains.kotlin - kotlin-maven-allopen - ${kotlin.version} - - - - true - 17 - - all-open - - - - - - - - - - - - - - - native - - - native - - - - false - true - - - diff --git a/jvm-runtime/ftl-runtime/common/bom/pom.xml b/jvm-runtime/ftl-runtime/common/bom/pom.xml new file mode 100644 index 000000000..d94fc84b7 --- /dev/null +++ b/jvm-runtime/ftl-runtime/common/bom/pom.xml @@ -0,0 +1,102 @@ + + + 4.0.0 + + + xyz.block.ftl + ftl-jvm-runtime-parent + 1.0-SNAPSHOT + + ftl-jvm-bom + Ftl JVM BOM + + + + + xyz.block.ftl + ftl-jvm-parent + ${project.version} + pom + import + + + xyz.block.ftl + ftl-jvm-runtime + ${project.version} + + + xyz.block.ftl + ftl-java-runtime + ${project.version} + + + xyz.block.ftl + ftl-kotlin-runtime + ${project.version} + + + + + + + + + ${quarkus.platform.group-id} + quarkus-maven-plugin + ${quarkus.platform.version} + true + + + + build + generate-code + generate-code-tests + native-image-agent + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + + -parameters + + + + + maven-surefire-plugin + ${surefire-plugin.version} + + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + maven-failsafe-plugin + ${surefire-plugin.version} + + + + integration-test + verify + + + + + + ${project.build.directory}/${project.build.finalName}-runner + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + diff --git a/jvm-runtime/ftl-runtime/common/build-parent/pom.xml b/jvm-runtime/ftl-runtime/common/build-parent/pom.xml new file mode 100644 index 000000000..8d4a1e565 --- /dev/null +++ b/jvm-runtime/ftl-runtime/common/build-parent/pom.xml @@ -0,0 +1,124 @@ + + + 4.0.0 + + xyz.block.ftl + ftl-jvm-runtime-parent + 1.0-SNAPSHOT + + ftl-build-parent + pom + Ftl JVM Build Parent POM + This pom.xml can be used as a parent pom to inherit all required configuration to build a FTL app. + + 1.0-SNAPSHOT + 3.13.0 + 2.0.0 + 17 + UTF-8 + UTF-8 + quarkus-bom + io.quarkus.platform + 3.12.3 + true + 3.2.5 + + + + + + xyz.block.ftl + ftl-jvm-bom + ${project.version} + pom + import + + + + + + + xyz.block.ftl + ftl-jvm-runtime + + + io.quarkus + quarkus-junit5 + test + + + + + + + ${quarkus.platform.group-id} + quarkus-maven-plugin + ${quarkus.platform.version} + true + + + + build + generate-code + generate-code-tests + native-image-agent + + + + + + maven-compiler-plugin + ${compiler-plugin.version} + + + -parameters + + + + + maven-surefire-plugin + ${surefire-plugin.version} + + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + maven-failsafe-plugin + ${surefire-plugin.version} + + + + integration-test + verify + + + + + + ${project.build.directory}/${project.build.finalName}-runner + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + + + + native + + + native + + + + false + true + + + + diff --git a/jvm-runtime/ftl-runtime/common/deployment/pom.xml b/jvm-runtime/ftl-runtime/common/deployment/pom.xml index 10b648e0c..5cf9f54ca 100644 --- a/jvm-runtime/ftl-runtime/common/deployment/pom.xml +++ b/jvm-runtime/ftl-runtime/common/deployment/pom.xml @@ -4,7 +4,7 @@ xyz.block.ftl - ftl-jvm-runtime-common-parent + ftl-jvm-runtime-parent 1.0-SNAPSHOT ftl-jvm-runtime-deployment diff --git a/jvm-runtime/ftl-runtime/common/pom.xml b/jvm-runtime/ftl-runtime/common/pom.xml index 599fee461..3aa2e02a3 100644 --- a/jvm-runtime/ftl-runtime/common/pom.xml +++ b/jvm-runtime/ftl-runtime/common/pom.xml @@ -3,18 +3,20 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - ftl-jvm-runtime-parent + ftl-jvm-parent xyz.block.ftl 1.0-SNAPSHOT ../pom.xml 4.0.0 - ftl-jvm-runtime-common-parent - FTL Java Runtime - Common Parent + ftl-jvm-runtime-parent + FTL Java Runtime - Parent pom deployment runtime + bom + build-parent diff --git a/jvm-runtime/ftl-runtime/common/runtime/pom.xml b/jvm-runtime/ftl-runtime/common/runtime/pom.xml index 5067ccff9..3ac8b0354 100644 --- a/jvm-runtime/ftl-runtime/common/runtime/pom.xml +++ b/jvm-runtime/ftl-runtime/common/runtime/pom.xml @@ -5,7 +5,7 @@ xyz.block.ftl - ftl-jvm-runtime-common-parent + ftl-jvm-runtime-parent 1.0-SNAPSHOT ftl-jvm-runtime diff --git a/jvm-runtime/ftl-runtime/java/build-parent/pom.xml b/jvm-runtime/ftl-runtime/java/build-parent/pom.xml new file mode 100644 index 000000000..b0cce8b80 --- /dev/null +++ b/jvm-runtime/ftl-runtime/java/build-parent/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + xyz.block.ftl + ftl-build-parent + 1.0-SNAPSHOT + ../../common/build-parent + + ftl-build-parent-java + pom + Ftl Kotlin Build Parent POM + This pom.xml can be used as a parent pom to inherit all required configuration to build a FTL Java app. + + + + xyz.block.ftl + ftl-java-runtime + + + + diff --git a/jvm-runtime/ftl-runtime/java/pom.xml b/jvm-runtime/ftl-runtime/java/pom.xml index b15084802..e03d255a3 100644 --- a/jvm-runtime/ftl-runtime/java/pom.xml +++ b/jvm-runtime/ftl-runtime/java/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - ftl-jvm-runtime-parent + ftl-jvm-parent xyz.block.ftl 1.0-SNAPSHOT ../pom.xml @@ -17,5 +17,6 @@ deployment runtime integration-tests + build-parent diff --git a/jvm-runtime/ftl-runtime/kotlin/build-parent/pom.xml b/jvm-runtime/ftl-runtime/kotlin/build-parent/pom.xml new file mode 100644 index 000000000..f8a6929d9 --- /dev/null +++ b/jvm-runtime/ftl-runtime/kotlin/build-parent/pom.xml @@ -0,0 +1,68 @@ + + + 4.0.0 + + xyz.block.ftl + ftl-build-parent + 1.0-SNAPSHOT + ../../common/build-parent + + ftl-build-parent-kotlin + pom + Ftl Kotlin Build Parent POM + This pom.xml can be used as a parent pom to inherit all required configuration to build a FTL Kotlin app. + + + + xyz.block.ftl + ftl-kotlin-runtime + + + + + src/main/kotlin + src/test/kotlin + + + org.jetbrains.kotlin + kotlin-maven-plugin + ${kotlin.version} + + + compile + + compile + + + + test-compile + + test-compile + + + + + + org.jetbrains.kotlin + kotlin-maven-allopen + ${kotlin.version} + + + + true + ${maven.compiler.release} + + all-open + + + + + + + + + + + + + diff --git a/jvm-runtime/ftl-runtime/kotlin/pom.xml b/jvm-runtime/ftl-runtime/kotlin/pom.xml index 6037b101d..57123f40d 100644 --- a/jvm-runtime/ftl-runtime/kotlin/pom.xml +++ b/jvm-runtime/ftl-runtime/kotlin/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> - ftl-jvm-runtime-parent + ftl-jvm-parent xyz.block.ftl 1.0-SNAPSHOT ../pom.xml @@ -16,5 +16,6 @@ deployment runtime + build-parent diff --git a/jvm-runtime/ftl-runtime/pom.xml b/jvm-runtime/ftl-runtime/pom.xml index 2344b2030..52b82ca84 100644 --- a/jvm-runtime/ftl-runtime/pom.xml +++ b/jvm-runtime/ftl-runtime/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 xyz.block.ftl - ftl-jvm-runtime-parent + ftl-jvm-parent 1.0-SNAPSHOT pom Ftl Java Runtime - Parent diff --git a/jvm-runtime/ftl-runtime/test-framework/pom.xml b/jvm-runtime/ftl-runtime/test-framework/pom.xml index 95f4eff8b..5a9f7becd 100644 --- a/jvm-runtime/ftl-runtime/test-framework/pom.xml +++ b/jvm-runtime/ftl-runtime/test-framework/pom.xml @@ -4,7 +4,7 @@ xyz.block.ftl - ftl-jvm-runtime-parent + ftl-jvm-parent 1.0-SNAPSHOT ftl-jvm-test-framework diff --git a/jvm-runtime/testdata/java/javamodule/pom.xml b/jvm-runtime/testdata/java/javamodule/pom.xml index 3b5b2263b..a8e23d687 100644 --- a/jvm-runtime/testdata/java/javamodule/pom.xml +++ b/jvm-runtime/testdata/java/javamodule/pom.xml @@ -5,137 +5,10 @@ javamodule 1.0-SNAPSHOT - - 1.0-SNAPSHOT - 3.13.0 - 2.0.0 - 17 - UTF-8 - UTF-8 - quarkus-bom - io.quarkus.platform - 3.12.3 - true - 3.2.5 - + + xyz.block.ftl + ftl-build-parent-java + 1.0-SNAPSHOT + - - - - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} - pom - import - - - - - - - xyz.block.ftl - ftl-java-runtime - 1.0-SNAPSHOT - - - io.quarkus - quarkus-kotlin - - - io.quarkus - quarkus-jackson - - - io.quarkus - quarkus-rest-jackson - - - io.quarkus - quarkus-junit5 - test - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - - - io.rest-assured - kotlin-extensions - test - - - - - - - ${quarkus.platform.group-id} - quarkus-maven-plugin - ${quarkus.platform.version} - true - - - - build - generate-code - generate-code-tests - native-image-agent - - - - - - maven-compiler-plugin - ${compiler-plugin.version} - - - -parameters - - - - - maven-surefire-plugin - ${surefire-plugin.version} - - - org.jboss.logmanager.LogManager - ${maven.home} - - - - - maven-failsafe-plugin - ${surefire-plugin.version} - - - - integration-test - verify - - - - - - ${project.build.directory}/${project.build.finalName}-runner - org.jboss.logmanager.LogManager - ${maven.home} - - - - - - - - - native - - - native - - - - false - true - - - diff --git a/jvm-runtime/testdata/java/javamodule/src/main/java/xyz/block/ftl/java/test/TestInvokeGo.java b/jvm-runtime/testdata/java/javamodule/src/main/java/xyz/block/ftl/java/test/TestInvokeGo.java index 2a6e3ad88..00529e476 100644 --- a/jvm-runtime/testdata/java/javamodule/src/main/java/xyz/block/ftl/java/test/TestInvokeGo.java +++ b/jvm-runtime/testdata/java/javamodule/src/main/java/xyz/block/ftl/java/test/TestInvokeGo.java @@ -1,5 +1,11 @@ package xyz.block.ftl.java.test; +import java.time.ZonedDateTime; +import java.util.List; +import java.util.Map; + +import org.jetbrains.annotations.NotNull; + import ftl.gomodule.BoolVerbClient; import ftl.gomodule.BytesVerbClient; import ftl.gomodule.EmptyVerbClient; @@ -26,14 +32,9 @@ import ftl.gomodule.TestObjectOptionalFieldsVerbClient; import ftl.gomodule.TestObjectVerbClient; import ftl.gomodule.TimeVerbClient; -import org.jetbrains.annotations.NotNull; import xyz.block.ftl.Export; import xyz.block.ftl.Verb; -import java.time.ZonedDateTime; -import java.util.List; -import java.util.Map; - public class TestInvokeGo { @Export @@ -116,13 +117,13 @@ public boolean boolVerb(boolean val, BoolVerbClient client) { @Export @Verb - public @NotNull TestObjectOptionalFields testObjectOptionalFieldsVerb(@NotNull TestObjectOptionalFields val, TestObjectOptionalFieldsVerbClient client) { + public @NotNull TestObjectOptionalFields testObjectOptionalFieldsVerb(@NotNull TestObjectOptionalFields val, + TestObjectOptionalFieldsVerbClient client) { return client.call(val); } // now the same again but with option return / input types - @Export @Verb public Long optionalIntVerb(Long val, OptionalIntVerbClient client) { @@ -179,9 +180,9 @@ public TestObject optionalTestObjectVerb(TestObject val, OptionalTestObjectVerbC @Export @Verb - public TestObjectOptionalFields optionalTestObjectOptionalFieldsVerb(TestObjectOptionalFields val, OptionalTestObjectOptionalFieldsVerbClient client) { + public TestObjectOptionalFields optionalTestObjectOptionalFieldsVerb(TestObjectOptionalFields val, + OptionalTestObjectOptionalFieldsVerbClient client) { return client.call(val); } - }