Where is the ‘best practice’ place to put @Configuration beans in one’s Spring project? It seems wrong putting config under /src/main/java, but otherwise the classes won’t get compiled.
How do others approach this problem?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It seems that the only solution, if you want to decouple the configuration from the logic, is to add additional source folder to the Maven config:
It seems that this solution will achieve what you want.
src/main/configurationwill be added to the compilation plugin and will end up intarget/classeswhile, in the project source tree, those will be placed somewhere else.