-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
the unnamed module reads package io.micronaut.inject.annotation from both io.micronaut.core_processor and io.micronaut.inject #10299
Comments
|
I am back to this after holidays. We are doing it in 2 steps. We have one maven module that generates a jar with all the annotation transformers. And then, this jar is set in the compiler. To illustrate it better, we have: Step 1: Step 2:
As you can see, the first step needs to generate the transformers-artifact jar to be used later by the compiler. The problem is that currently we cannot do the step 1 because of the previous error. |
What's the point of using modules for the annotation processer? |
It should not be mandatory, but then, why does |
Have what? |
I mean, Micronaut core-processor has a module named |
It looks like something added by Gradle; I don't think it supposted to activate the module system or something. I'm not sure what do you mean by |
That is another way to define the module name, without adding a module-info.java. For the consumers of core-processor lib, we need to add in our module-info.java the next: There is more information about that here https://openjdk.org/projects/jigsaw/spec/sotms/#automatic-modules . It is a bit complex, but this sentence defines it: There are three options in my opinion:
|
|
After removing the module, I am passing that issue but I found a new one when I invoke the next javac with:
It seems that Is that an issue in Micronaut?, if yes, could you also double check the other processor implementations?:
It looks that the processor implementations are loaded with a ServiceLocator, and that requires public constructors. |
It does have a public constructor. |
That command comes from Maven with the debug enabled. It is just a javac with annotation processor. I removed the module-path from that command and added it into the class-path and I get a different error:
I will try to get more details of the error. |
Why can you use the maven? Googling you can find the cause of your error https://stackoverflow.com/questions/36248959/bad-service-configuration-file-or-exception-thrown-while-constructing-processor |
The issue was related to a wrong dependency micronaut-validation, that has changed in version 4. Now I don't have that compilation issue, although I have my own implementation of io.micronaut.inject.annotation.NamedAnnotationTransformer that is not working for some reason. I will find it out. Coming back to my original request, it would be nice if you can solve the issue related to have 2 different module names with same package names: #10299 (comment) For the time being I will not include a module-info to bypass the issue. |
Expected Behavior
The modules
io.micronaut.core_processor
andio.micronaut.inject
contains the same packageio.micronaut.inject.annotation
.I guess the correct fix is that either there should not be in module-path both modules, or they should have different package names. For example in
io.micronaut.core_processor
the package could beio.micronaut.core_processor.annotation
Actual Behaviour
When both modules are in module-path, there is the next error:
Steps To Reproduce
Create one module-info.java having:
With the next java class for example:
Environment Information
Example Application
No response
Version
4.2.2
The text was updated successfully, but these errors were encountered: