Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
126 views
in Technique[技术] by (71.8m points)

java - Repeatable not found when using Spring 4 PropertySource

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:

orgspringframeworkcontextannotationPropertySource.class(orgspringframeworkcontextannotation: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.

question from:https://stackoverflow.com/questions/21598016/repeatable-not-found-when-using-spring-4-propertysource

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...