From 2789aa8bb54416c3706f3fcc7fffe166e8e149f7 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 | 105 +----------- .../leases/testdata/java/leases/pom.xml | 119 +------------ .../pubsub/testdata/java/publisher/pom.xml | 119 +------------ .../pubsub/testdata/java/subscriber/pom.xml | 119 +------------ buildengine/build_java.go | 40 ++++- examples/kotlin/echo/pom.xml | 162 +----------------- examples/kotlin/time/pom.xml | 162 +----------------- 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 +- jvm-runtime/ftl-runtime/java/pom.xml | 2 +- jvm-runtime/ftl-runtime/kotlin/pom.xml | 2 +- jvm-runtime/ftl-runtime/pom.xml | 2 +- .../ftl-runtime/test-framework/pom.xml | 2 +- jvm-runtime/testdata/java/javamodule/pom.xml | 119 +------------ .../xyz/block/ftl/java/test/TestInvokeGo.java | 19 +- 18 files changed, 339 insertions(+), 871 deletions(-) create mode 100644 jvm-runtime/ftl-runtime/common/bom/pom.xml create mode 100644 jvm-runtime/ftl-runtime/common/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 36689c1211..b966fa8c7a 100644 --- a/backend/controller/cronjobs/testdata/java/cron/pom.xml +++ b/backend/controller/cronjobs/testdata/java/cron/pom.xml @@ -5,26 +5,18 @@ 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 - + + xyz.block.ftl + ftl-build-parent + 1.0-SNAPSHOT + - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} + xyz.block.ftl + ftl-jvm-bom + ${project.version} pom import @@ -35,93 +27,12 @@ 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} - - - - - - diff --git a/backend/controller/leases/testdata/java/leases/pom.xml b/backend/controller/leases/testdata/java/leases/pom.xml index 3432ab218a..438057a1cc 100644 --- a/backend/controller/leases/testdata/java/leases/pom.xml +++ b/backend/controller/leases/testdata/java/leases/pom.xml @@ -5,26 +5,18 @@ 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 + 1.0-SNAPSHOT + - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} + xyz.block.ftl + ftl-jvm-bom + ${project.version} pom import @@ -35,107 +27,12 @@ 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 ec33ab1730..06957a4dae 100644 --- a/backend/controller/pubsub/testdata/java/publisher/pom.xml +++ b/backend/controller/pubsub/testdata/java/publisher/pom.xml @@ -5,26 +5,18 @@ 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 + 1.0-SNAPSHOT + - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} + xyz.block.ftl + ftl-jvm-bom + ${project.version} pom import @@ -35,107 +27,12 @@ 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 cd32d7c0c2..7ad06656ac 100644 --- a/backend/controller/pubsub/testdata/java/subscriber/pom.xml +++ b/backend/controller/pubsub/testdata/java/subscriber/pom.xml @@ -5,26 +5,18 @@ 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 + 1.0-SNAPSHOT + - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} + xyz.block.ftl + ftl-jvm-bom + ${project.version} pom import @@ -35,107 +27,12 @@ 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 b136ed5ac0..dc37ef4d07 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: %w", module.Config.Dir, err) } 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" { + 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 c22eb5f864..ef9d16a086 100644 --- a/examples/kotlin/echo/pom.xml +++ b/examples/kotlin/echo/pom.xml @@ -5,26 +5,18 @@ 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 + 1.0-SNAPSHOT + - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} + xyz.block.ftl + ftl-jvm-bom + ${project.version} pom import @@ -34,149 +26,13 @@ xyz.block.ftl - ftl-java-runtime - 1.0-SNAPSHOT - - - io.quarkus - quarkus-kotlin - - - io.quarkus - quarkus-jackson - - - io.quarkus - quarkus-rest-jackson + ftl-kotlin-runtime 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/time/pom.xml b/examples/kotlin/time/pom.xml index 90987014b6..51b13e6665 100644 --- a/examples/kotlin/time/pom.xml +++ b/examples/kotlin/time/pom.xml @@ -5,26 +5,18 @@ 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 + 1.0-SNAPSHOT + - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} + xyz.block.ftl + ftl-jvm-bom + ${project.version} pom import @@ -34,149 +26,13 @@ xyz.block.ftl - ftl-java-runtime - 1.0-SNAPSHOT - - - io.quarkus - quarkus-kotlin - - - io.quarkus - quarkus-jackson - - - io.quarkus - quarkus-rest-jackson + ftl-kotlin-runtime 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 0000000000..d94fc84b72 --- /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 0000000000..5060c577ba --- /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-java-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 10b648e0c9..5cf9f54ca1 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 599fee4617..3aa2e02a32 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 5067ccff95..3ac8b03549 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/pom.xml b/jvm-runtime/ftl-runtime/java/pom.xml index b15084802d..dd8312eea6 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 diff --git a/jvm-runtime/ftl-runtime/kotlin/pom.xml b/jvm-runtime/ftl-runtime/kotlin/pom.xml index 6037b101de..8540fef06c 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 diff --git a/jvm-runtime/ftl-runtime/pom.xml b/jvm-runtime/ftl-runtime/pom.xml index 2344b20309..52b82ca84a 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 95f4eff8be..5a9f7becdf 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 3b5b2263b8..66889d8635 100644 --- a/jvm-runtime/testdata/java/javamodule/pom.xml +++ b/jvm-runtime/testdata/java/javamodule/pom.xml @@ -5,26 +5,18 @@ 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 + 1.0-SNAPSHOT + - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} + xyz.block.ftl + ftl-jvm-bom + ${project.version} pom import @@ -35,107 +27,12 @@ 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 2a6e3ad884..00529e4768 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); } - }