- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我是一名从 Eclipse 迁移到 IntelliJ 的用户。
我的大多数项目都在项目的根目录中包含一个资源文件夹,在本例中是一个模块:
上面目录下的fonts文件夹是代码用来加载渲染使用的字体的。问题在于,在 IntelliJ 中,编译目标是项目文件夹本身,因此未检测到字体。您可以通过手动编辑运行配置来解决这个问题,以便工作目录位于模块根目录中。
我的问题是,我能否以某种方式更改 IntelliJ,使每个项目默认具有此行为,而不必每次都手动执行?默认情况下,程序的目标工作目录始终是类所在模块的根文件夹。
提前致谢!
最佳答案
The problem is that in IntelliJ, the compilation target is the project folder itself
当 building项目/模块,IDE 将标记为 source/resource/generated source/test source 的文件夹中的所有文件/源包含到编译类路径中等类型。
另请注意,对于 Maven (Gradle) 项目,IDE 从 Maven pom.xml 文件中获取配置,包括编译器配置。默认情况下,Maven 不会处理(复制)源目录中的资源文件。您需要在 pom.xml 中对其进行显式配置,或者将资源文件移动到资源类型的文件夹中。
现在关于主要问题:
...manually editing the run configuration so that the working directory is in the module root.
My question is, can I somehow change IntelliJ to have this behavior by default for every project instead of having to manually do it every time?
关于java - 智能 : How to set default working directory?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56212815/
我是一名优秀的程序员,十分优秀!