Maybe it could be nice to mention explicitly in documentation that Spring FWK 6.x doesn't support JSpecify.

When looking at : https://docs.spring.io/spring-framework/reference/6.2/core/beans/annotation-config/autowired.html

It says that

You can also use a @Nullable annotation (of any kind in any package — for example, javax.annotation.Nullable from JSR-305) or just leverage Kotlin built-in null-safety support:

But, according to the few tests I made, @org.jspecify.annotations.Nullable can't be used in Spring FWK 6 to mark a non required dependency.

Comment From: sbrannen

Indeed, Spring Framework 7.0 will support JSpecify's null-safety annotations.

We'll consider adding something to the docs.

Comment From: jhoeller

Technically, you can use any parameter-level @Nullable annotation at this point. Type-use annotations such as from JSpecify are not detected yet, that's coming in 7.0.

Comment From: ghusta

OK thanks ! Indeed, I didn't notice this little subtlety in the annotation's target type.