Source Directories Not Being Created In New Project

If I create a new project using gradle from IDEA the directory structure (src/main/java etc) is not created.
However, if I do gradle init --type java-library everything is.

There are a few more comments in  the files too.

6 comments
Comment actions Permalink

Check idea.log for errors (https://intellij-support.jetbrains.com/entries/23352446).

Make sure this option is enabled:

http://i.imgur.com/E9urg2u.png

After the import completes, empty folders are created and configured as sources/test sources (tested with 14.1.4):

http://i.imgur.com/XgrL3oJ.png

4
Comment actions Permalink

Thank you, but how do you change it if you didn't set it initially when the project was created?

1
Comment actions Permalink

Or you can find the same configuration value under settings -> gradle (if you are using gradle), which solved my problem.

 

3
Comment actions Permalink

In fact the answer by @Tom Stachura is far more correct. I had the same issue (i.e. created the Kotlin project using the Wizard but forgot to click the option and tried to retro-fit it) and I followed his suggestion and if you look you will see that once the setting to "Create directories for empty content..." is set, Gradle build will run and it will create sub modules as follows...I never got to grips with the module concept so I rather Gradle does that and sorts out the project structure and dependencies:

For any newbies, you get to the option on Windows with: Ctl-Alt-s

You will then see the option here:

3
Comment actions Permalink

The solution is given by @Tom Stachura works like a charm! Since I am a newbie I had a tough time to find out what went wrong. Anyways, now it works. Thanks again!

0

Please sign in to leave a comment.