prosseek
prosseek

Reputation: 190679

Adding files to a project (not to a module) with IntelliJ

I create a IntelliJ project "project" in a directory ~/intellij/project. I need to make this project contains a multiple modules, and the project can contain its own files.

~/intellij/project/module1/...
~/intellij/project/module2/...
~/intellij/project/README.md

What I tried was to create a project, and this generates a project1 module. I created module1 from Project Settings. As in the picture, the module1 is in the project1.

enter image description here

Then, I removed the project1 module.

Now, I tried to add README.md in the project (not in the module), but I don't seem to find a way to do it. How to add files to the project not to the module in IntelliJ?

Upvotes: 1

Views: 1231

Answers (1)

Ivaylo D. Ivanov
Ivaylo D. Ivanov

Reputation: 3859

You can not put files in the project itself, only in modules. So to achieve this, create a module with content root pointing to the project location (~/intellij/project) and in the project tree delete the auto-created "src" folder.

I'm attaching a screenshot in which you can see the result - a file "testfile" residing in the project folder "C:\Work\Projects\test" with two modules "C:\Work\Projects\test\m1" and "C:\Work\Projects\test\m2"

enter image description here

Upvotes: 3

Related Questions