diff --git a/applications/pom.xml b/applications/pom.xml index fe94fc51a28..11f735c69a9 100644 --- a/applications/pom.xml +++ b/applications/pom.xml @@ -47,8 +47,8 @@ 3.1.2 1.6.0 3.0.0-M5 - 3.0.0-RC2 - 3.0.0-RC2 + 3.0.0-RC3 + 3.0.0-RC3 3.0.2 1.5.0.Final 0.5.1 diff --git a/archetypes/helidon/filters.properties b/archetypes/helidon/filters.properties new file mode 100644 index 00000000000..e28316a0176 --- /dev/null +++ b/archetypes/helidon/filters.properties @@ -0,0 +1,123 @@ +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# This file contains permutation input filters, the property names are not used only the values. +# +# The number of computed permutations can be very large and quickly become un-manageable. +# The build will output warnings when the number of computed permutations for a node is > 150000. +# Filters are used to restrain the computed permutations. +# +# Filters are taken into account when they evaluate successfully. If a variable is unresolved, the result is ignored. +# A filter that needs to restrain a specific combination should only reference variables in the scope of the target node. + +# never combine multipart with other media options +multipart=${media} == 'multipart' || !(${media} contains 'multipart') + +# group metrics, tracing and health together +observability=!(${metrics} || ${tracing} || ${health}) || \ + (${metrics} && ${tracing} && ${health}) + +# force health.builtin=true +health=!${health} || (${health.builtin}) + +# force metrics.builtin=true +metrics=!${metrics} || (${metrics.builtin}) + +# force metrics.provider='microprofile' when tracing=true +tracing=!${tracing} || (${tracing} && ${metrics.provider} == 'microprofile') + +# group extra options +extra=${extra} == [] || ${extra} == ['cors', 'webclient', 'fault-tolerance'] + +# group docker, k8s and v8o +packaging=!(${docker} || ${k8s} || ${v8o}) || (${docker} && ${k8s} && ${v8o}) + +# force docker.native-image=true and docker.jlink-image=true when docker=true +docker=!${docker} || (${docker.native-image} && ${docker.jlink-image}) + +# force single option for security.atn +security-atn=\ + ${security.atn} == ['oidc'] || \ + ${security.atn} == ['jwt'] || \ + ${security.atn} == ['google'] || \ + ${security.atn} == ['http-signature'] + +# only combine security.atz with security.atn=oidc +security-atz=\ + ${security.atz} == [] || \ + (${security.atz} == 'abac' && ${security.atn} == 'oidc') + +# do not combine media and security +security-media=\ + ${app-type} != 'custom' || (${app-type} == 'custom' && \ + (${security} && ${media} == []) || !${security}) + +# do not combine metrics and media +metrics-media=\ + ${app-type} != 'custom' || (${app-type} == 'custom' && \ + (${metrics} && ${media} == []) || !${metrics}) + +# do not combine metrics and security +security-metrics=\ + ${app-type} != 'custom' || (${app-type} == 'custom' && \ + (${metrics} && !${security}) || !${metrics}) + +# do not combine docker and media +docker-media=\ + ${app-type} != 'custom' || (${app-type} == 'custom' && \ + (${docker} && ${media} == []) || !${docker}) + +# do not combine docker and security +docker-security=\ + ${app-type} != 'custom' || (${app-type} == 'custom' && \ + (${docker} && !${security}) || !${docker}) + +# do not combine docker and tracing +docker-tracing=\ + ${app-type} != 'custom' || (${app-type} == 'custom' && \ + (${docker} && !${tracing}) || !${docker}) + +# do not combine docker and extra +docker-extra=\ + ${app-type} != 'custom' || (${app-type} == 'custom' && \ + (${docker} && ${extra} != []) || !${docker}) + +# do not combine security and extra +extra-security=\ + ${app-type} != 'custom' || (${app-type} == 'custom' && \ + (!${security} && ${extra} != []) || (${security} && ${extra} == [])) + +# do not combine custom and db +custom-db=\ + ${app-type} != 'custom' || (${app-type} == 'custom' && \ + !${db}) + +# do not combine media.json-lib=jackson when db.auto-ddl=true +ddl-media=\ + ${app-type} != 'database' || (${app-type} == 'database' && \ + (${db.auto-ddl} && ${media.json-lib} == 'jackson') || \ + (!${db.auto-ddl} && ${media.json-lib} != 'jackson')) + +# do not combine media.json-lib=jackson when db.cp=hikaricp +hikaricp-media=\ + ${app-type} != 'database' || (${app-type} == 'database' && \ + (${db.cp} == 'hikaricp' && ${media.json-lib} == 'jackson') || \ + (${db.cp} != 'hikaricp' && ${media.json-lib} != 'jackson')) + +# do not combine app-type=database when health=true +db-health=\ + ${app-type} != 'database' || (${app-type} == 'database' && \ + !${health}) diff --git a/archetypes/helidon/pom.xml b/archetypes/helidon/pom.xml index 93408973f3f..579e57b7b44 100644 --- a/archetypes/helidon/pom.xml +++ b/archetypes/helidon/pom.xml @@ -54,51 +54,7 @@ - - - - - - ${media} == 'multipart' || !(${media} contains 'multipart') - - !(${metrics} || ${tracing} || ${health}) || (${metrics} && ${tracing} && ${health}) - - !${health} || (${health.builtin}) - - !${metrics} || (${metrics.builtin}) - - !${tracing} || (${tracing} && ${metrics.provider} == 'microprofile') - - ${extra} == [] || (${extra} contains 'cors' && ${extra} contains 'webclient' && ${extra} contains 'fault-tolerance') - - !(${docker} || ${k8s} || ${v8o}) || (${docker} && ${k8s} && ${v8o}) - - !${docker} || (${docker.native-image} && ${docker.jlink-image}) - - ${security.atn} == 'oidc' || ${security.atn} == 'jwt' || ${security.atn} == 'google' || ${security.atn} == 'http-signature' - - (${security.atz} == 'abac' && ${security.atn} == 'oidc') || ${security.atz} == 'none' - - (${app-type} == 'custom' && ${security} == 'true' && ${media} == 'none') || ${security} == 'false' || ${app-type} != 'custom' - - (${app-type} == 'custom' && ${metrics} == 'true' && ${media} == 'none') || ${metrics} == 'false' || ${app-type} != 'custom' - - (${app-type} == 'custom' && ${metrics} == 'true' && ${security} == 'false') || ${metrics} == 'false' || ${app-type} != 'custom' - - (${app-type} == 'custom' && ${docker} == 'true' && ${media} == 'none') || ${docker} == 'false' || ${app-type} != 'custom' - - (${app-type} == 'custom' && ${docker} == 'true' && ${security} == 'false') || ${docker} == 'false' || ${app-type} != 'custom' - - (${app-type} == 'custom' && ${docker} == 'true' && ${tracing} == 'false') || ${docker} == 'false' || ${app-type} != 'custom' - - (${app-type} == 'custom' && ${db} == 'false') || ${app-type} != 'custom' - - (${app-type} == 'database' && ${db.auto-ddl} == 'true') && ${media.json-lib} == 'jackson' || (${db.auto-ddl} == 'false' && ${media.json-lib} != 'jackson') || ${app-type} != 'database' - - (${app-type} == 'database' && ${db.cp} == 'hikaricp') && ${media.json-lib} == 'jackson' || (${db.cp} != 'hikaricp' && ${media.json-lib} != 'jackson' ) || ${app-type} != 'database' - - (${app-type} == 'database' && ${health} == 'false') || ${app-type} != 'database' - + filters.properties diff --git a/archetypes/helidon/src/main/archetype/common/extra.xml b/archetypes/helidon/src/main/archetype/common/extra.xml index 1f16cdde5e1..edf47467171 100644 --- a/archetypes/helidon/src/main/archetype/common/extra.xml +++ b/archetypes/helidon/src/main/archetype/common/extra.xml @@ -23,7 +23,7 @@ - @@ -59,25 +65,36 @@ - + com.fasterxml.jackson.core jackson-databind - + + org.glassfish.jersey.media + jersey-media-json-jackson + runtime + + io.helidon.media helidon-media-jackson - + io.helidon.media.jackson.JacksonSupport - + io.helidon.media.jackson.JacksonSupport - + + io.helidon.media.jackson.JacksonSupport + + - + + + + @@ -87,25 +104,36 @@ - + jakarta.json.bind jakarta.json.bind-api - + + org.glassfish.jersey.media + jersey-media-json-binding + runtime + + io.helidon.media helidon-media-jsonb - + io.helidon.media.jsonb.JsonbSupport - + io.helidon.media.jsonb.JsonbSupport - + + io.helidon.media.jsonb.JsonbSupport + + - + + + + @@ -118,38 +146,38 @@ - + org.glassfish.jersey.media jersey-media-multipart - + io.helidon.media helidon-media-multipart - + io.helidon.media helidon-media-jsonp - + io.helidon.media.jsonp.JsonpSupport - + io.helidon.media.jsonp.JsonpSupport - + io.helidon.media.multipart.MultiPartSupport - + - + - + - + @@ -163,6 +191,10 @@ + true + false + true + false ${media.json-lib} true diff --git a/archetypes/helidon/src/main/archetype/common/observability.xml b/archetypes/helidon/src/main/archetype/common/observability.xml index c1803e26907..2c3512ab7d7 100644 --- a/archetypes/helidon/src/main/archetype/common/observability.xml +++ b/archetypes/helidon/src/main/archetype/common/observability.xml @@ -56,15 +56,15 @@ curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics ]]> - + org.eclipse.microprofile.metrics microprofile-metrics-api - + io.helidon.microprofile.metrics helidon-microprofile-metrics - + io.helidon.metrics helidon-metrics @@ -328,7 +328,7 @@ allRequests_total 0.0 - + io.helidon.metrics helidon-metrics @@ -396,15 +396,15 @@ curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics - + io.helidon.microprofile.health helidon-microprofile-health - + io.helidon.health helidon-health - + io.helidon.health helidon-health-checks @@ -479,7 +479,7 @@ curl -s -X GET http://localhost:8080/health - + io.helidon.tracing helidon-tracing-jaeger @@ -542,7 +542,7 @@ tracing: - + io.helidon.tracing helidon-tracing-zipkin diff --git a/archetypes/helidon/src/main/archetype/mp/custom/custom-mp.xml b/archetypes/helidon/src/main/archetype/mp/custom/custom-mp.xml index d7982d0318c..ce5c780c0a0 100644 --- a/archetypes/helidon/src/main/archetype/mp/custom/custom-mp.xml +++ b/archetypes/helidon/src/main/archetype/mp/custom/custom-mp.xml @@ -78,19 +78,10 @@ ]]> - + io.helidon.microprofile.bundles helidon-microprofile-core - - org.glassfish.jersey.media - jersey-media-json-binding - runtime - - - io.helidon.webclient - helidon-webclient - diff --git a/archetypes/helidon/src/main/archetype/mp/custom/database.xml b/archetypes/helidon/src/main/archetype/mp/custom/database.xml index 67190a76383..8085030f32c 100644 --- a/archetypes/helidon/src/main/archetype/mp/custom/database.xml +++ b/archetypes/helidon/src/main/archetype/mp/custom/database.xml @@ -445,7 +445,6 @@ docker run --rm --name xe -p 1521:1521 -p 8888:8080 -e ORACLE_PWD=oracle wnamele org.hibernate.validator hibernate-validator - 7.0.2.Final runtime diff --git a/archetypes/helidon/src/main/archetype/mp/database/files/src/main/java/__pkg__/Pokemon.java.mustache b/archetypes/helidon/src/main/archetype/mp/database/files/src/main/java/__pkg__/Pokemon.java.mustache index 3c7085ccad9..a1f0dbdaa89 100644 --- a/archetypes/helidon/src/main/archetype/mp/database/files/src/main/java/__pkg__/Pokemon.java.mustache +++ b/archetypes/helidon/src/main/archetype/mp/database/files/src/main/java/__pkg__/Pokemon.java.mustache @@ -1,6 +1,7 @@ package {{package}}; +{{#media-json-jackson}}import com.fasterxml.jackson.annotation.JsonIgnore;{{/media-json-jackson}} import jakarta.persistence.Access; import jakarta.persistence.AccessType; import jakarta.persistence.Basic; @@ -61,6 +62,7 @@ public class Pokemon { this.name = name; } +{{#media-json-jackson}} @JsonIgnore{{/media-json-jackson}} @ManyToOne public PokemonType getPokemonType() { return pokemonType; diff --git a/archetypes/helidon/src/main/archetype/mp/quickstart/quickstart-mp.xml b/archetypes/helidon/src/main/archetype/mp/quickstart/quickstart-mp.xml index 158b5d76deb..e93a66efd93 100644 --- a/archetypes/helidon/src/main/archetype/mp/quickstart/quickstart-mp.xml +++ b/archetypes/helidon/src/main/archetype/mp/quickstart/quickstart-mp.xml @@ -95,8 +95,8 @@ - io.helidon.microprofile.bundles - helidon-microprofile + io.helidon.microprofile.openapi + helidon-microprofile-openapi diff --git a/archetypes/helidon/src/main/archetype/se/custom/files/src/main/java/__pkg__/Message.java.json.mustache b/archetypes/helidon/src/main/archetype/se/custom/files/src/main/java/__pkg__/Message.java.json.mustache index 16571f6ab8c..4efa0bbde8a 100644 --- a/archetypes/helidon/src/main/archetype/se/custom/files/src/main/java/__pkg__/Message.java.json.mustache +++ b/archetypes/helidon/src/main/archetype/se/custom/files/src/main/java/__pkg__/Message.java.json.mustache @@ -1,6 +1,11 @@ package {{package}}; +{{#media-json-jackson}} +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +{{/media-json-jackson}} + public class Message { private String message; @@ -22,7 +27,10 @@ public class Message { this.greeting = greeting; } +{{#media-json-jackson}} + @JsonInclude(Include.NON_NULL) +{{/media-json-jackson}} public String getGreeting() { return this.greeting; } -} \ No newline at end of file +} diff --git a/archetypes/helidon/src/main/archetype/se/custom/files/src/main/java/__pkg__/WebClientMain.java.mustache b/archetypes/helidon/src/main/archetype/se/custom/files/src/main/java/__pkg__/WebClientMain.java.mustache index ed5c9dc2029..fbc70455091 100644 --- a/archetypes/helidon/src/main/archetype/se/custom/files/src/main/java/__pkg__/WebClientMain.java.mustache +++ b/archetypes/helidon/src/main/archetype/se/custom/files/src/main/java/__pkg__/WebClientMain.java.mustache @@ -3,7 +3,9 @@ package {{package}}; import io.helidon.common.reactive.Single; import io.helidon.config.Config; import io.helidon.config.ConfigValue; -import io.helidon.media.jsonp.JsonpSupport; +{{#WebClient-media-imports}} +import {{.}}; +{{/WebClient-media-imports}} import io.helidon.webclient.WebClient; public class WebClientMain { @@ -34,7 +36,9 @@ public class WebClientMain { WebClient webClient = WebClient.builder() .baseUri(url) .config(config.get("client")) - .addMediaSupport(JsonpSupport.create()) +{{#WebClient-builder}} + {{.}} +{{/WebClient-builder}} .build(); performGetMethod(webClient).await(); diff --git a/archetypes/helidon/src/main/archetype/se/custom/files/src/test/java/__pkg__/WebClientMainTest.java.mustache b/archetypes/helidon/src/main/archetype/se/custom/files/src/test/java/__pkg__/WebClientMainTest.java.mustache index d94286c7e1f..b814b3e92ed 100644 --- a/archetypes/helidon/src/main/archetype/se/custom/files/src/test/java/__pkg__/WebClientMainTest.java.mustache +++ b/archetypes/helidon/src/main/archetype/se/custom/files/src/test/java/__pkg__/WebClientMainTest.java.mustache @@ -36,7 +36,12 @@ public class WebClientMainTest { @Test public void getSimpleGreetTest() throws Exception { WebClientMain.performGetMethod(webClient) +{{#media-json}} .thenAccept(it -> assertThat(it, is("{\"message\":\"Hello World!\"}"))) +{{/media-json}} +{{^media-json}} + .thenAccept(it -> assertThat(it, is("Hello World!"))) +{{/media-json}} .await(); } diff --git a/dependencies/pom.xml b/dependencies/pom.xml index 465906f898d..c779978f2c7 100644 --- a/dependencies/pom.xml +++ b/dependencies/pom.xml @@ -886,6 +886,11 @@ hibernate-validator-cdi ${version.lib.hibernate-validator} + + org.hibernate.validator + hibernate-validator + ${version.lib.hibernate-validator} + org.jboss.narayana.jta narayana-jta-jakarta diff --git a/examples/quickstarts/helidon-standalone-quickstart-mp/pom.xml b/examples/quickstarts/helidon-standalone-quickstart-mp/pom.xml index 76d7ca05368..a6ecd25955a 100644 --- a/examples/quickstarts/helidon-standalone-quickstart-mp/pom.xml +++ b/examples/quickstarts/helidon-standalone-quickstart-mp/pom.xml @@ -41,8 +41,8 @@ 2.7.5.1 1.6.0 3.0.0-M5 - 3.0.0-M3 - 3.0.0-M3 + 3.0.0-RC3 + 3.0.0-RC3 1.0.6 3.0.2 1.5.0.Final diff --git a/examples/quickstarts/helidon-standalone-quickstart-se/pom.xml b/examples/quickstarts/helidon-standalone-quickstart-se/pom.xml index ea7012bb3fb..3968a2d5d6f 100644 --- a/examples/quickstarts/helidon-standalone-quickstart-se/pom.xml +++ b/examples/quickstarts/helidon-standalone-quickstart-se/pom.xml @@ -40,8 +40,8 @@ 3.0.0 1.6.0 3.0.0-M5 - 3.0.0-M3 - 3.0.0-M3 + 3.0.0-RC3 + 3.0.0-RC3 3.0.2 1.5.0.Final 0.5.1 diff --git a/pom.xml b/pom.xml index e93c5a898c6..4af78727d36 100644 --- a/pom.xml +++ b/pom.xml @@ -99,7 +99,7 @@ 1.6.0 3.0.0-M5 2.3 - 3.0.0-RC2 + 3.0.0-RC3 ${version.lib.hibernate} 0.8.5 1.1.0 @@ -123,7 +123,7 @@ 1.4 2.14.0 - 3.0.0-RC2 + 3.0.0-RC3 https://jakarta.ee/specifications/restful-ws/3.0/apidocs/