What is the easiest way to create a multimodule pr...
# announcements
t
What is the easiest way to create a multimodule project in IntelliJ with all the necessary submodules and subdirectories (src, main, test, kotlin, java, resources)? If I use the convoluted module settings it will take me a whole day to do something that should take 10 seconds at most.
m
You can clone an existing project and remove everything you don't need. For an exemple https://github.com/Kotlin/mpp-example. Not 10s but it's the closest I found.
c
I usually just create a simple project, then write whatever I need in build.gradle.kts and then re-import with "Create directories for empty content roots automatically" enabled.
m
If you're just looking at a jvm project (not multiplatform), the 'new project' wizzard gave me good results
t
I already have a single module project and now I want to split it into multiple modules
m
You might have to tweak a bit your gradle files. I would move the existing module to a subdirectory of the new multi-module project, create top-level build.gradle and settings.gradle (or .kts if you prefer) and start from there
1
c
Then just edit your build.gradle.kts and refresh
t
Indeed it seems to be the easiest to write the settings.gradle, reimport and then create all the folders + build.gradle files manually. At least I don't have to fiddle around with the stupid module settings