Open ben-manes opened 7 years ago
I did a quick check. The dependency provides the javax.enterprise.util.Nonbinding
annotation, which is used in the following JCache annotations: CacheRemove, CacheResult, CacheRemoveAll, CacheDefaults, CachePut, CacheRemove.
For example:
public @interface CacheDefaults {
/**
* The default name of the cache for the annotated class
* <p>
* If not specified defaults to:
* package.name.ClassName.methodName(package.ParameterType,package.ParameterType)
* <p>
* Applicable for {@link CacheResult}, {@link CachePut}, {@link CacheRemove},
* and {@link CacheRemoveAll}
*/
@Nonbinding String cacheName() default "";
. . .
I don't think we can drop @Nonbinding
to get rid of the dependency, especially in an MR which needs to be 100% API compatible.
Yes, that is the annotation causing the required dependency. I am unfamiliar with CDI, so to me the comment implied that the annotation may not be necessary anymore. However, we would need someone who uses CDI to clarify.
The description is here: http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#performing_typesafe_resolution
I am unfamiliar with CDI, so to me comment implied that the annotation may not be necessary anymore. However, we would need someone who uses CDI to clarify.
Me too. However, it obviously has some intended semantic. We cannot change here any more after the JCache Spec was released.
Tagged with 2.0 for now. Any comments whether we can rid of the dependency, at least for Version 2, are much appreciated.
I think the comment was alluding to adding bean-discovery-mode
, set to none
in the jar's beans.xml
.
Possible other solution:
Split the API jar into two jars and separate the annotations. I just tagged this with milestone 1.2, maybe its worth to talk about another MR.
Unlike Java, Scala fully resolves all annotations and requires them to be on the classpath when loading a class. This means that Scala JCache users in a non-CDI environment, such as Guice, must include the
provided
scoped dependency. The pom.xml states that this dependency could be removed with CDI 1.1, which was released 4 years ago. This quirk of Scala surprised a user and, if the comment is accurate, it would be nice to remove the requirement.