Also detect @jakarta.inject.Inject
annotations
#377
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, you are only looking for
javax.inject.Inject
annotations. However, in Play, we are switching to Guice 7, which eventually only supportsjakarta.inject
: https://github.com/google/guice/wiki/Guice700#jee-jakarta-transitionOur samples repo contains a project that is using macwire, but now that we drop
javax.inject
, that project does not work anymore: https://github.com/playframework/play-samples/tree/main/scala/macwire-di (actually this is the PR that makes it fail: playframework/play-samples#799 - which will be updated to just disable that sample for now until this PR here makes it into your next release).Looking at your code, all it needs is that the
isInjectAnnotation
method also considers the jakarta annotion.I can confirm, after testing locally, this fix makes the sample's tests work again, on both Scala 2 and 3.
Would be great if you could cut a new release with this fix. Thanks!