How to separate spring contexts in intelliJ IDEA

I have a problem configuring IntelliJ IDEA for developing spring and maven powered application.

App has two separate spring configurations for production and test purposes. In spring facet props in IDEA I created two different file sets but when configuring one of contexts IDEA shows variants for both ones in code completion. How can I deal with this?

Thanks

Aleksander


The only option is to create two different filesets of spring config. If the beans are defined in both the filesets, it would links the beans to both filesets. Obviously I don't think it (or any IDE) is capable of resolving if it has to use main/test filesets based on your code path. Hope they would enhance the sprint context(fileset) resolution based on the code path (source/test). But it would be difficult for the IDE as the main business logic falls in both main/test context during the flow.


IDEA 2016.2 has checkbox: Check test files: 在这里输入图像描述

After check on IDEA stop complain, that test files not included in Spring Facet. Try to play with it.

链接地址: http://www.djcxy.com/p/67716.html

上一篇: 如何在包含注释的Map中设置Enum键

下一篇: 如何在intelliJ IDEA中分离spring上下文