Recently set up a multi module project in IntelliJ with the following structure:
/module1 /module2 /web-module /sql /lib /a few more folders
I set up module1+2 and web-module as modules in IntelliJ so those show up, but how do you make the sql and lib folder show up in the project panel? They should be included in VCS as well, but IntelliJ ignores them. How do you add folders outside modules to a project?
Screenshot of project and explorer view:
In the Project tool window ( Alt+1 ), right-click the node in which you want to create a new directory and select New | Directory. Alternatively, select the node, press Alt+Insert , and click Directory. Name the new directory and press Enter .
From the main menu, select File | Project Structure | Project Settings | Modules. Select the module for which you want to add a library and click Dependencies. button and select Library. In the dialog that opens, select a project or a global library that you want to add to the module.
add files to exclude... right click directory > mark directory as excluded... If you want to add or remove files from that directory reverse the process... cancel exclusion on the directory, get/put files...
For the newer versions of Intellij, press Ctrl + Alt + Shift + s to open project settings, then choose Modules, under Dependencies tab choose the green + and add the folder in which your . class file is located.
This is not a strict answer to the question, but it worked for me so I'm posting, perhaps someone will find this useful.
If you want to add an arbitrary folder to your project (even from some different location than your projects), just add it as a module. You needn't worry about the type so much e.g. I needed to add a folder with some SQL scripts, I added it as a Java module and it's nicely visible in IntelliJ even though it has no maven structure or Java sources.
This is how to do it:
Voilà! :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With