-
Notifications
You must be signed in to change notification settings - Fork 25
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
AutoRequires doesn't work when using mvn compiler plugin. #272
Comments
huh, cause we can test that now with the extra blackbox-aspect module we have and I thought I had that configuration temporarily last night as I wanted to test how that went with java modules (module-info) and it all seemed good (I was checking that we didn't break modules when our autoProvides includes classes that were not strictly in the module-info exports ... and that was all fine. [the generated module, aspect implementation can all be internal to the module / not publically accessible to any other modules]. |
Side note, when using java modules (module-info) we need to specify annotation processors via maven-compiler-plugin ... we can't just have them as provided scope dependencies. |
blackbox-aspect module does not use the AP in the mvn compiler plugin |
I temporarily modified both blackbox-aspect and blackbox-test-inject to use mvn compiler plugin to specify the AP ... but I ALSO at the same time changed them to use module-info. I did that temporary to test out the module-info exports. We could and probably should change both blackbox-aspect and blackbox-test-inject to use mvn compiler plugin to specify the AP permanently. I believe what we are saying here is that doesn't work and will reproduce this issue, so I'll try that. |
Our fix for this with maven is to include a new <plugin>
<groupId>io.avaje</groupId>
<artifactId>avaje-inject-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>provides</goal>
</goals>
</execution>
</executions>
</plugin> What this does is generate 2 files in
These are the components and plugins provides by all the other modules that exist in the classpath. |
Great work from @SentryMan to provide the maven plugin and work that issue through. Cheers!! |
It seems when you use inject with the compiler plugin, the
ExternalProvider
Serviceloader can't detect other modules.The text was updated successfully, but these errors were encountered: