Repeatable not found when using Spring 4 PropertySource

java, spring

Solution

I think that the problem is that in Spring 4, they use `@Repeatable` annotation, which has only been introduced in Java 8.

Therefore, if you're not using Java 8 you'll continue to see this problem, at least until this issue will be fixed.

BTW, this is also preventing the usage of `@Scheduled` annotation in older JDKs than Java 8. I hope it will be fixed soon.

Problem

we are using Spring 4.0.1.RELEASE in combination with jdk6 (this is fixed). Of course we have done the config in Java with usage of the `@PropertySource` annotation. This leads to an annoying warning message(s) when we compile the project with gradle: org\springframework\context\annotation\PropertySource.class(org\springframework\context\annotation:PropertySource.class): warning: Cannot find annotat ion method 'value()' in type 'java.lang.annotation.Repeatable': class file for java.lang.annotation.Repeatable not found This is caused by the usage of not (in jdk6) existing Repeatable class and I am glad that it's just a warning. I love the clean output of gradle and this is just annoying because it may obfuscate other "real" warnings (like checkstyle...). Maybe anyone faced the same problem and got a (not so much hack) solution for this situation. I just want to see a clean output again.

Original source