How to split spring contexts in intelliJ IDEA

I had a problem setting up IntelliJ IDEA for developing spring and maven applications.

The application has two separate spring configurations for production and testing purposes. In the spring facet details in IDEA, I created two different sets of files, but when setting up one of the contexts, IDEA shows the options for both at the end of the code. How can I handle this?

thanks

Alexander

+4
source share
2 answers

The only option is to create two different sets of files from spring config. If beans are defined in both sets of files, it will associate beans with both sets of files. Obviously, I don’t think that it (or any IDE) is able to resolve if it should use basic / test filesets based on your code. We hope that they will improve the resolution of the sprint (set of files) based on the code code (source / test). But it will be difficult for the IDE, as the main business logic gets into the main context during the flow.

+1
source

IDEA 2016.2 has a checkbox: check test files: enter image description here

After checking for IDEA stops complaining, these test files are not included in Spring Facet. Try playing with him.

0
source

All Articles