To make my question clear, I will make up a concrete example.
Suppose that I have a directory named web that contains a file name index.html.
Now suppose that I want to configure IntelliJ, when it builds my module, to also build a jar file which contains the entire web directory. That is, in the final jar, I want to see a directory entry inside it named web which in turn contains index.html.
I am aware that in File --> Project Structure --> Artifacts --> Output Layout that I can click on the + button and select Directory Content. That almost works--it does add index.html to the final jar. Unfortunately, as the name of the option Directory Content suggests, only the content of web is added to the final jar, but not web itself.
Is there any way in IntelliJ to tell Artifacts --> Output Layout to add an entire directory, not just its contents?
I can only see nastly workarounds, like
- chose Directory Content and select the parent directory of web. That would work, it would inlcude web as I desire, but it will also include everything else inside that parent directory too (in my case, there is a bunch of other stuff besides web there). I am part of a team, and do not have the luxury to rearrange stuff...
- do some custom manual postprocessing to add web (e.g. execute a bash script, or maybe figure out how to use IntelliJ's Post-processing Ant task)
I hope that I am missing something obvious...