mybatisGenerator <properties> resource does not exist 解决方案

配置 properties,一直提示找不到该文件资源。

提供一个完整示例: MyBatisGenerator-Tool

解决思路 1: 这里引入的是项目的资源,所以需要把 config.properties 加入 localpath,没成功

解决思路 2: 直接使用 path,使用绝对地址引入资源。见下方,已成功。

解决思路 3: “I add the properties file to POM as resource, and it works” 把配置文件作为资源文件导入 pom(maven)。应该能行,但我是 gradle没测试

解决思路 4: 由 3 想到,能不能把资源文件引入 gradle,暴露出来,直接使用呢?因为不太了解 gradle 语法,没测试成功。但是在网上找到了通过 Gradle 来执行 Ant Task,实现配置的方法。也就是现在用的方法。

还是使用 path 解决比较方便…解决思路 4 在配置文件中配置了,还需要在 gradle 配置,太麻烦了…

    <!-- 无法执行 <properties resource="config.properties"/>-->
    <!-- 可以执行 <properties url="file:///home/A/code/skill/src/main/resources/config.yml" />-->
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当出现"class path resource [wxpay.properties] cannot be opened because it does not exist"的错误时,这意味着程序无法找到所需要的wxpay.properties文件。 这个错误可能由以下原因引起: 1. 文件路径错误:请确保wxpay.properties文件位于正确的路径下。检查classpath是否包含了该文件的位置。 2. 文件名错误:请确保wxpay.properties文件的拼写和大小写都是正确的。文件名大小写敏感,所以请确保文件名完全匹配。 3. 文件丢失:如果wxpay.properties文件确实存在于应用程序的classpath中,那么可能是文件被意外删除或移动了。请检查文件是否存在或者是否被正确地放置在正确的位置。 解决这个问题的方法是: 1. 检查文件路径:确保wxpay.properties文件位于正确的路径下,并且该路径已经在classpath中正确配置。 2. 检查文件名:仔细检查文件名的拼写和大小写是否正确。 3. 恢复文件:如果文件确实存在但是被删除或移动了,请将wxpay.properties文件恢复到正确的位置。 请根据具体情况选择适合的解决方法来解决这个错误。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [class path resource [wxpay.properties] cannot be opened because it does not exist](https://blog.csdn.net/m0_48134027/article/details/124499986)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [【启动报错class patch resource xxx.properties cannot be opened because it does not exist】](https://blog.csdn.net/qq_32894331/article/details/123544186)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值