Intellij resources not in built artifact

前端 未结 2 919
你的背包
你的背包 2021-01-01 23:42

I\'m attempting to build a .jar that contains a non-standard images and fonts, which I have added to the resource folder in my project. I am able to load them into my projec

相关标签:
2条回答
  • 2021-01-02 00:16

    You can create your own artifacts in the project structure: enter image description here

    There you can add the directory contents of the resources folder. Press the green plus and navigate to your folder and add it. You can then click build-> build artifacts -> build. In my case the jar is created in ./out/artifacts folder.

    0 讨论(0)
  • 2021-01-02 00:16

    Intellij is treating folders marked as "resources" as additional classpath directories which could be discovered by it's own autocomplete or in your case run/debug feature. Try right click on this folder and choose "Mark Directory As">"Unmark as Resources Root" to verify this assumption. If it's stopped working, you need to provide more reliable path taking into consideration where this file is located inside your resulting jar-file.

    0 讨论(0)
提交回复
热议问题