diff --git a/dependencies/pom.xml b/dependencies/pom.xml index 2ba880b0445..b69f812c4bd 100644 --- a/dependencies/pom.xml +++ b/dependencies/pom.xml @@ -72,7 +72,7 @@ 1.5.18 2.15.2 2.0.1 - 2.0.0 + 2.1.0 3.0.0 4.0.0 2.0.0 @@ -106,9 +106,10 @@ 2.6.2 2.10 1.6.6 - 3.8.7 - 3.4.3 - 4.8.0 + 4.2.2 + 4.2.0 + 4.4.1 + 5.4.0 3.0.1 4.0 2.0 @@ -1001,14 +1002,6 @@ micronaut-core ${version.lib.micronaut} - - javax.annotation - javax.annotation-api - - - javax.inject - javax.inject - com.github.spotbugs spotbugs-annotations @@ -1019,6 +1012,11 @@ + + io.micronaut + micronaut-core-processor + ${version.lib.micronaut} + io.micronaut micronaut-aop @@ -1086,20 +1084,19 @@ ${version.lib.activemq} - io.micronaut + io.micronaut.validation micronaut-validation - ${version.lib.micronaut} + ${version.lib.micronaut.validation} + + + io.micronaut.validation + micronaut-validation-processor + ${version.lib.micronaut.validation} io.micronaut micronaut-runtime ${version.lib.micronaut} - - - javax.validation - validation-api - - io.micronaut.sql diff --git a/integrations/micronaut/cdi-processor/pom.xml b/integrations/micronaut/cdi-processor/pom.xml index 90e7a9d7df6..88b124c3889 100644 --- a/integrations/micronaut/cdi-processor/pom.xml +++ b/integrations/micronaut/cdi-processor/pom.xml @@ -34,22 +34,32 @@ io.micronaut micronaut-inject-java + provided io.micronaut micronaut-inject + provided io.micronaut micronaut-core + provided + + + io.micronaut + micronaut-core-processor + provided jakarta.inject jakarta.inject-api + provided jakarta.annotation jakarta.annotation-api + provided @@ -62,6 +72,14 @@ -proc:none + + + io.helidon.build-tools + helidon-services-plugin + + false + + diff --git a/integrations/micronaut/cdi-processor/src/main/java/module-info.java b/integrations/micronaut/cdi-processor/src/main/java/module-info.java deleted file mode 100644 index 7a7178f924c..00000000000 --- a/integrations/micronaut/cdi-processor/src/main/java/module-info.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2020, 2021 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. - */ - -/** - * Micronaut integration with CDI - annotation processor for Micronaut. - */ -module io.helidon.integrations.micronaut.cdi.processor { - requires io.micronaut.core; - requires io.micronaut.inject; - requires jakarta.inject; - - provides io.micronaut.inject.annotation.AnnotationTransformer with - io.helidon.integrations.micronaut.cdi.processor.ApplicationScopedTransformer, - io.helidon.integrations.micronaut.cdi.processor.RequestScopedTransformer, - io.helidon.integrations.micronaut.cdi.processor.DependentTransformer; -} diff --git a/integrations/micronaut/cdi-processor/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationTransformer b/integrations/micronaut/cdi-processor/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationTransformer new file mode 100644 index 00000000000..cfa8a61dd4b --- /dev/null +++ b/integrations/micronaut/cdi-processor/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationTransformer @@ -0,0 +1,19 @@ +# +# Copyright (c) 2024 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. +# + +io.helidon.integrations.micronaut.cdi.processor.ApplicationScopedTransformer +io.helidon.integrations.micronaut.cdi.processor.RequestScopedTransformer +io.helidon.integrations.micronaut.cdi.processor.DependentTransformer \ No newline at end of file diff --git a/integrations/micronaut/cdi/pom.xml b/integrations/micronaut/cdi/pom.xml index 1ea0e6953e3..6b09a03f92f 100644 --- a/integrations/micronaut/cdi/pom.xml +++ b/integrations/micronaut/cdi/pom.xml @@ -35,10 +35,6 @@ jakarta.enterprise jakarta.enterprise.cdi-api - - io.micronaut - micronaut-inject-java - io.micronaut micronaut-inject @@ -116,9 +112,14 @@ io.micronaut - micronaut-validation + micronaut-core-processor ${version.lib.micronaut} + + io.micronaut.validation + micronaut-validation-processor + ${version.lib.micronaut.validation} + io.micronaut.data micronaut-data-processor diff --git a/integrations/micronaut/cdi/src/main/java/io/helidon/integrations/micronaut/cdi/CdiExecutableMethod.java b/integrations/micronaut/cdi/src/main/java/io/helidon/integrations/micronaut/cdi/CdiExecutableMethod.java index 7f9a702c5f8..1c6f8fc73c5 100644 --- a/integrations/micronaut/cdi/src/main/java/io/helidon/integrations/micronaut/cdi/CdiExecutableMethod.java +++ b/integrations/micronaut/cdi/src/main/java/io/helidon/integrations/micronaut/cdi/CdiExecutableMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021 Oracle and/or its affiliates. + * Copyright (c) 2020, 2024 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. @@ -18,7 +18,6 @@ import java.lang.annotation.Annotation; import java.lang.annotation.Documented; -import java.lang.annotation.Repeatable; import java.lang.annotation.Retention; import java.lang.annotation.Target; import java.lang.reflect.Array; @@ -208,11 +207,6 @@ private static void processAnnotations(Map, Annotati Map, Annotation> stereotypeMap, Map> annotationsByStereotype) { for (var entry : declaredAnnotations.entrySet()) { - if (stereotypeMap.containsKey(Repeatable.class)) { - // I need to ignore this (used only when there is just one repetition) - // this gets processed as part of the Repeatable container - continue; - } String annotName = entry.getKey().getName(); miAnnotations.put(annotName, annotationValues(entry.getValue())); Set stereotypes = getStereotypes(entry.getValue()); diff --git a/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestBothBean.java b/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestBothBean.java index 6f6227ada22..0f4780e9c85 100644 --- a/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestBothBean.java +++ b/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestBothBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021 Oracle and/or its affiliates. + * Copyright (c) 2020, 2024 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. @@ -21,8 +21,28 @@ @ApplicationScoped @MicronautBeanDef public class TestBothBean implements TestBean { + @Override public String name() { return "BothBean"; } + + @CdiIntercepted + @Override + public String cdiAnnotated() { + return TestBean.super.cdiAnnotated(); + } + + @MicroIntercepted + @Override + public String µAnnotated() { + return TestBean.super.µAnnotated(); + } + + @CdiIntercepted + @MicroIntercepted + @Override + public String bothAnnotated() { + return TestBean.super.bothAnnotated(); + } } diff --git a/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestCdiBean.java b/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestCdiBean.java index de472b8517f..a3b906123ef 100644 --- a/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestCdiBean.java +++ b/integrations/micronaut/cdi/src/test/java/io/helidon/integrations/micronaut/cdi/TestCdiBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021 Oracle and/or its affiliates. + * Copyright (c) 2020, 2024 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. @@ -21,6 +21,25 @@ @ApplicationScoped public class TestCdiBean implements TestBean { + @CdiIntercepted + @Override + public String cdiAnnotated() { + return TestBean.super.cdiAnnotated(); + } + + @MicroIntercepted + @Override + public String µAnnotated() { + return TestBean.super.µAnnotated(); + } + + @CdiIntercepted + @MicroIntercepted + @Override + public String bothAnnotated() { + return TestBean.super.bothAnnotated(); + } + @Override public String name() { return "CdiBean"; diff --git a/integrations/micronaut/data/pom.xml b/integrations/micronaut/data/pom.xml index 7bff2d8cb2c..bb569b785b5 100644 --- a/integrations/micronaut/data/pom.xml +++ b/integrations/micronaut/data/pom.xml @@ -46,7 +46,6 @@ jakarta.validation jakarta.validation-api - 2.0.2 test @@ -59,6 +58,11 @@ micronaut-runtime test + + io.micronaut.validation + micronaut-validation + test + jakarta.persistence jakarta.persistence-api @@ -151,9 +155,14 @@ io.micronaut - micronaut-validation + micronaut-core-processor ${version.lib.micronaut} + + io.micronaut.validation + micronaut-validation-processor + ${version.lib.micronaut.validation} + io.micronaut.data micronaut-data-processor diff --git a/integrations/micronaut/data/src/test/java/io/helidon/integrations/micronaut/cdi/data/MicronautDataCdiExtensionTest.java b/integrations/micronaut/data/src/test/java/io/helidon/integrations/micronaut/cdi/data/MicronautDataCdiExtensionTest.java index f18f9405c57..34ad5fc0044 100644 --- a/integrations/micronaut/data/src/test/java/io/helidon/integrations/micronaut/cdi/data/MicronautDataCdiExtensionTest.java +++ b/integrations/micronaut/data/src/test/java/io/helidon/integrations/micronaut/cdi/data/MicronautDataCdiExtensionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2022 Oracle and/or its affiliates. + * Copyright (c) 2020, 2024 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. @@ -27,14 +27,12 @@ import io.helidon.microprofile.tests.junit5.Configuration; import io.helidon.microprofile.tests.junit5.HelidonTest; -import javax.validation.ConstraintViolationException; -import javax.validation.constraints.Pattern; - import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import jakarta.transaction.Transactional; +import jakarta.validation.ConstraintViolationException; +import jakarta.validation.constraints.Pattern; import org.eclipse.microprofile.config.inject.ConfigProperty; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static io.helidon.config.testing.OptionalMatcher.present;