Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.x: Fix Micronaut integration in Helidon 3.x? #7206 #8227

Open
wants to merge 5 commits into
base: helidon-3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 17 additions & 20 deletions dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<version.lib.hystrix>1.5.18</version.lib.hystrix>
<version.lib.jackson>2.15.2</version.lib.jackson>
<version.lib.jakarta.activation-api>2.0.1</version.lib.jakarta.activation-api>
<version.lib.jakarta.annotation-api>2.0.0</version.lib.jakarta.annotation-api>
<version.lib.jakarta.annotation-api>2.1.0</version.lib.jakarta.annotation-api>
<version.lib.jakarta.cdi-api>3.0.0</version.lib.jakarta.cdi-api>
<version.lib.jakarta.el-api>4.0.0</version.lib.jakarta.el-api>
<version.lib.jakarta.inject>2.0.0</version.lib.jakarta.inject>
Expand Down Expand Up @@ -106,9 +106,10 @@
<version.lib.mariadb-java-client>2.6.2</version.lib.mariadb-java-client>
<version.lib.maven-wagon>2.10</version.lib.maven-wagon>
<version.lib.micrometer>1.6.6</version.lib.micrometer>
<version.lib.micronaut>3.8.7</version.lib.micronaut>
<version.lib.micronaut.data>3.4.3</version.lib.micronaut.data>
<version.lib.micronaut.sql>4.8.0</version.lib.micronaut.sql>
<version.lib.micronaut>4.2.2</version.lib.micronaut>
<version.lib.micronaut.validation>4.2.0</version.lib.micronaut.validation>
<version.lib.micronaut.data>4.4.1</version.lib.micronaut.data>
<version.lib.micronaut.sql>5.4.0</version.lib.micronaut.sql>
<version.lib.microprofile-config>3.0.1</version.lib.microprofile-config>
<version.lib.microprofile-fault-tolerance-api>4.0</version.lib.microprofile-fault-tolerance-api>
<version.lib.microprofile-graphql>2.0</version.lib.microprofile-graphql>
Expand Down Expand Up @@ -1001,14 +1002,6 @@
<artifactId>micronaut-core</artifactId>
<version>${version.lib.micronaut}</version>
<exclusions>
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</exclusion>
<exclusion>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
Expand All @@ -1019,6 +1012,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-core-processor</artifactId>
<version>${version.lib.micronaut}</version>
</dependency>
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-aop</artifactId>
Expand Down Expand Up @@ -1086,20 +1084,19 @@
<version>${version.lib.activemq}</version>
</dependency>
<dependency>
<groupId>io.micronaut</groupId>
<groupId>io.micronaut.validation</groupId>
<artifactId>micronaut-validation</artifactId>
<version>${version.lib.micronaut}</version>
<version>${version.lib.micronaut.validation}</version>
</dependency>
<dependency>
<groupId>io.micronaut.validation</groupId>
<artifactId>micronaut-validation-processor</artifactId>
<version>${version.lib.micronaut.validation}</version>
</dependency>
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-runtime</artifactId>
<version>${version.lib.micronaut}</version>
<exclusions>
<exclusion>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.micronaut.sql</groupId>
Expand Down
18 changes: 18 additions & 0 deletions integrations/micronaut/cdi-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,32 @@
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-inject-java</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-inject</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-core-processor</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

Expand All @@ -62,6 +72,14 @@
<compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>
<!-- https://github.com/micronaut-projects/micronaut-core/issues/10299 -->
<plugin>
<groupId>io.helidon.build-tools</groupId>
<artifactId>helidon-services-plugin</artifactId>
<configuration>
<failOnMissingModuleInfo>false</failOnMissingModuleInfo>
</configuration>
</plugin>
</plugins>
</build>
</project>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
11 changes: 6 additions & 5 deletions integrations/micronaut/cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
</dependency>
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-inject-java</artifactId>
</dependency>
<dependency>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-inject</artifactId>
Expand Down Expand Up @@ -116,9 +112,14 @@
</path>
<path>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-validation</artifactId>
<artifactId>micronaut-core-processor</artifactId>
<version>${version.lib.micronaut}</version>
</path>
<path>
<groupId>io.micronaut.validation</groupId>
<artifactId>micronaut-validation-processor</artifactId>
<version>${version.lib.micronaut.validation}</version>
</path>
<path>
<groupId>io.micronaut.data</groupId>
<artifactId>micronaut-data-processor</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand Down Expand Up @@ -208,11 +207,6 @@ private static void processAnnotations(Map<Class<? extends Annotation>, Annotati
Map<Class<? extends Annotation>, Annotation> stereotypeMap,
Map<String, Set<String>> 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<Annotation> stereotypes = getStereotypes(entry.getValue());
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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();
}
}
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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";
Expand Down
13 changes: 11 additions & 2 deletions integrations/micronaut/data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>2.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -59,6 +58,11 @@
<artifactId>micronaut-runtime</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.micronaut.validation</groupId>
<artifactId>micronaut-validation</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
Expand Down Expand Up @@ -151,9 +155,14 @@
</path>
<path>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-validation</artifactId>
<artifactId>micronaut-core-processor</artifactId>
<version>${version.lib.micronaut}</version>
</path>
<path>
<groupId>io.micronaut.validation</groupId>
<artifactId>micronaut-validation-processor</artifactId>
<version>${version.lib.micronaut.validation}</version>
</path>
<path>
<groupId>io.micronaut.data</groupId>
<artifactId>micronaut-data-processor</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
Expand Down
Loading