Thanks for taking this constructive. I would recommend to start with clarifying the problem statement. You wrote
I'd like to publish it somehow
which is IMHO very ambigous. Do you want to publish it as Open Source on Github? Just inside your team to another team member? Inside your own project as a library which can be reused by another project? Specificially and exclusively for usage inside IntelliJ (and if yes, why)?
Then, your question seems to be about some specific configuration options for IntelliJ. As you may have noted when studying the help pages, this site is not the place for asking about the usage of specific tools - please have a look into this older meta question.
The latter part can be asked on Stackoverflow, but make sure it becomes more clear what you are after.
Finally, asking something by using words like "which is the best option for ..." triggers automatically a reflex for many community members to downvote and close the question, since that is perceived as an invitation to an open-ended discussion. This site does not want to be a discussion site, and there is seldom a "best" option for something in software engineering, it is always a balancing of tradeoffs.
Note these are the points I found at a first glance, others may have other points which they would like to see improved.