Where do I place the freemarker_implicit file so that other modules can use it?
已回答
I'm trying to include a freemarker_implicit.ftl in my project as per the instructions here However, it seems that if I place the file in src/main/resources, templates in src/test/resources don't see the variables defined in the file. The same happens if I make a JAR and add it as a dependency of another project - the other project's templates don't see the variables in the freemarker_implicit file. I tried the following locations:
- src/main/resources
- src/main/resources/META-INF
- src/main/resources/META-INF/resources
Can anyone provide guidance on this? Thanks.
请先登录再写评论。
Does the alt+enter (option+enter) menu help? Please try to put the cursor on the unresolved variable and press the shortcut.
Yes, this gives me the option to define the variable (either in the same file or in an external file) but it does not detect that this variable is already defined in the freemarker_implicit file I have elsewhere. For example, if I create a freemarker_implicit.ftl in my main module and define variables there, when I try to use those variables in other modules (which depend on the main module), IntelliJ tells me that the variables are undefined.
Is it that these *_implicit files can only be used in the module in which they are defined?
Feel free to watch the YouTrack item in order to be notified once it has updates. See [this article](https://intellij-support.jetbrains.com/hc/articles/207241135) if you are not familiar with YouTrack.