intellij idea cannot resolve property under construction in mybatis-mapper.xml

  1. 红色警告信息:
  2. 如何解决:http://blog.canang.com.my/2016/06/03/intellij-idea-cannot-resolve-property-key/
  3. IntelliJ IDEA Cannot resolve property key

    IntelliJ offers a very intelligent experience by giving you such a relevant suggestion in every context. However, in some parts, you need to configure them.

    Our project / product are maven-based and we used spring framework. The spring configuration is in XML file. We discover that IntelliJ unable to refer to property or annotated beans that you declared under test/resources directory. Note that this is not happen to the configs file under src/resources. For example, you’ll see a warning on ${db.dev.url} which tells you the key cannot be resolved.

    Maven test folder structure

    Maven test folder structure

    Property cannot be resolved

    Property cannot be resolved

    Solution

    For quick fix, what you can do is to include all your spring configs under test directory in your IntelliJ project structure.

    1. Open project structure (CTRL + ALT + SHIFT + S) in on windows
    2. Under project settings, select Modules
    3. Select a module and add Spring
      IntelliJ project structure

      IntelliJ project structure

    4. Add new application context
    5. Select XML based configurations

      XML based configuration

      XML based configuration

    6. Locate your spring configuration files.
    7. Done

    Result

    Screenshot_7

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值