From a909bffde7976f9e329c46db39ad787a310c2c56 Mon Sep 17 00:00:00 2001 From: Julien Giovaresco Date: Mon, 17 Jul 2023 10:54:13 +0200 Subject: [PATCH] feat(node-notifier): supports both javax and jakarta Inject annotation Upgrading gravitee-plugin to 2.0.0 brings an updated gravitee-node-api which does not declare javax.inject dependencies anynore. This prevented the compilation of the gravitee-node-notifier module. This commit adds the javax.inject dependency to fix the compilation. It also supports the new annotation comming from Jakarta. --- gravitee-node-notifier/pom.xml | 15 +++++++++++++++ .../plugin/impl/NotifierPluginFactoryImpl.java | 2 +- pom.xml | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/gravitee-node-notifier/pom.xml b/gravitee-node-notifier/pom.xml index e85b71143..35a5322bd 100644 --- a/gravitee-node-notifier/pom.xml +++ b/gravitee-node-notifier/pom.xml @@ -29,12 +29,27 @@ gravitee-node-notifier Gravitee.io - Node - Notifier + + 1 + 2.0.1 + + io.gravitee.node gravitee-node-api ${project.version} + + javax.inject + javax.inject + ${javax-inject.version} + + + jakarta.inject + jakarta.inject-api + ${jakarta-inject.version} + io.gravitee.plugin diff --git a/gravitee-node-notifier/src/main/java/io/gravitee/node/notifier/plugin/impl/NotifierPluginFactoryImpl.java b/gravitee-node-notifier/src/main/java/io/gravitee/node/notifier/plugin/impl/NotifierPluginFactoryImpl.java index ad7ad4e35..1d71bef36 100644 --- a/gravitee-node-notifier/src/main/java/io/gravitee/node/notifier/plugin/impl/NotifierPluginFactoryImpl.java +++ b/gravitee-node-notifier/src/main/java/io/gravitee/node/notifier/plugin/impl/NotifierPluginFactoryImpl.java @@ -168,7 +168,7 @@ private Constructor lookingForConstructor(Class lookingForInjectableFields(Class resourceClass) { - return ReflectionUtils.getAllFields(resourceClass, withAnnotation(Inject.class)); + return ReflectionUtils.getAllFields(resourceClass, withAnnotations(Inject.class, jakarta.inject.Inject.class)); } public static Predicate withParametersAssignableFrom(final Class... types) { diff --git a/pom.xml b/pom.xml index 58d533c7b..61e23ef34 100644 --- a/pom.xml +++ b/pom.xml @@ -265,7 +265,7 @@ 6.0.1 2.1.1 - 2.0.0-alpha.3 + 2.0.0 1.25.0 1.0.0 2.0.3