Closed otaviojava closed 5 months ago
@amoscatelli @dearrudam, do you know how to enable the dependency only during build time?
@otaviojava I am not sure I get this right.
First things first, I can't find jnosql-mapping-reflection among the dependency of, for example, jnosql-mongodb : https://mvnrepository.com/artifact/org.eclipse.jnosql.databases/jnosql-mongodb/1.1.0
Then why should I exclude it ?
Oh I see, here it is : https://mvnrepository.com/artifact/org.eclipse.jnosql.mapping/jnosql-mapping-core/1.1.0
Ok then next question is : What do you mean by only "during build time" ? Isn't this what the "provided" dependencies are for ? Also Quarkus drops, by treeshake, everything you don't actively use ...
Anyway I excluded the reflection and included the annotation processon but I am getting this exception :
Caused by: org.eclipse.jnosql.mapping.metadata.MetadataException: No implementation of ClassConverter found via ServiceLoader
at org.eclipse.jnosql.mapping.metadata.ClassConverter.lambda$load$0(ClassConverter.java:48)
at java.base/java.util.Optional.orElseThrow(Optional.java:403)
at org.eclipse.jnosql.mapping.metadata.ClassConverter.load(ClassConverter.java:47)
at org.eclipse.jnosql.mapping.core.spi.EntityMetadataExtension.<init>(EntityMetadataExtension.java:48)
at io.quarkiverse.jnosql.core.runtime.QuarkusEntityMetadataExtension.<init>(QuarkusEntityMetadataExtension.java:10)
at io.quarkiverse.jnosql.core.runtime.QuarkusEntityMetadataExtension_Bean.doCreate(Unknown Source)
at io.quarkiverse.jnosql.core.runtime.QuarkusEntityMetadataExtension_Bean.create(Unknown Source)
at io.quarkiverse.jnosql.core.runtime.QuarkusEntityMetadataExtension_Bean.create(Unknown Source)
at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:113)
at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:37)
at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:34)
at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:32)
at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:34)
at io.quarkiverse.jnosql.core.runtime.QuarkusEntityMetadataExtension_Observer_onStart_a4bf6a2f117149897853c96ef7c42e7f5a772f37.notify(Unknown Source)
at io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:346)
at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:328)
at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:82)
at io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:155)
at io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:106)
at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source)
at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source)
... 11 more
Anyway I can't see any generated class under 'target/generated-sources/annotations' ... that's strange. I get the feeling the annotation processor isn't triggered.
@otaviojava I can't remember what I have to do to make an Annotation Processor start in Quarkus, I need some more time
Oh I see, here it is : https://mvnrepository.com/artifact/org.eclipse.jnosql.mapping/jnosql-mapping-core/1.1.0
Ok then next question is : What do you mean by only "during build time" ? Isn't this what the "provided" dependencies are for ? Also Quarkus drops, by treeshake, everything you don't actively use ...
The goal is instead of using reflection use Java annotation processor.
Anyway I excluded the reflection and included the annotation processon but I am getting this exception :
Caused by: org.eclipse.jnosql.mapping.metadata.MetadataException: No implementation of ClassConverter found via ServiceLoader at org.eclipse.jnosql.mapping.metadata.ClassConverter.lambda$load$0(ClassConverter.java:48) at java.base/java.util.Optional.orElseThrow(Optional.java:403) at org.eclipse.jnosql.mapping.metadata.ClassConverter.load(ClassConverter.java:47) at org.eclipse.jnosql.mapping.core.spi.EntityMetadataExtension.<init>(EntityMetadataExtension.java:48) at io.quarkiverse.jnosql.core.runtime.QuarkusEntityMetadataExtension.<init>(QuarkusEntityMetadataExtension.java:10) at io.quarkiverse.jnosql.core.runtime.QuarkusEntityMetadataExtension_Bean.doCreate(Unknown Source) at io.quarkiverse.jnosql.core.runtime.QuarkusEntityMetadataExtension_Bean.create(Unknown Source) at io.quarkiverse.jnosql.core.runtime.QuarkusEntityMetadataExtension_Bean.create(Unknown Source) at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:113) at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:37) at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:34) at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:32) at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69) at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:34) at io.quarkiverse.jnosql.core.runtime.QuarkusEntityMetadataExtension_Observer_onStart_a4bf6a2f117149897853c96ef7c42e7f5a772f37.notify(Unknown Source) at io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:346) at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:328) at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:82) at io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:155) at io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:106) at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source) at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source) ... 11 more
Anyway I can't see any generated class under 'target/generated-sources/annotations' ... that's strange. I get the feeling the annotation processor isn't triggered.
@otaviojava I can't remember what I have to do to make an Annotation Processor start in Quarkus, I need some more time
Did you created a branch with this test? If yes, can you share?
Maybe is because the Java Annotation Processor is not available for the application.
@otaviojava https://github.com/quarkiverse/quarkus-jnosql/pull/96
This is going to fail :D
Nice, @amoscatelli how can we generate a new version?
I believe we can close this.
https://github.com/quarkiverse/quarkus-jnosql/releases/tag/3.3.0
Yes, thanks @amoscatelli
Description
Objective:
This issue aims to explore the integration of Eclipse JNoSQL Lite into Quarkus as a replacement for the current reflection-based metadata generator. Eclipse JNoSQL Lite leverages an annotation processor for metadata generation, which is anticipated to enhance performance by eliminating the need for reflection.
Background:
Currently, Quarkus uses a reflection-based approach to manage JNoSQL metadata. While effective, this method can be optimized by adopting Eclipse JNoSQL Lite, which uses compile-time annotation processing. This change is expected to yield performance improvements and better align with Quarkus's philosophy of reducing runtime overhead.
Proposed Changes:
Exclusion of Reflection-Based Metadata:
Modify the Quarkus JNoSQL configuration to exclude the traditional reflection-based metadata generator. It can be achieved by updating the project dependencies to exclude the
jnosql-mapping-reflection
module.Inclusion of Eclipse JNoSQL Lite:
Introduce the Eclipse JNoSQL Lite annotation processor to the build process as a provided dependency. It ensures the metadata is generated at compile time without adding additional runtime dependencies.
Expected Benefits: