Empty module

Answered

Hey all

While it's possible to create an empty project, it's not possible to create an empty module.  For example, I would like to create a module to develop Terraform templates, but I can't do that.

The way I do it now is to create a Java module and then remove the src folder.  But that seems a bit of a weird way to handle this use case.  

4
13 comments

Static Web module has no source roots.

0

Serge Baranov

There is no "Static Web" module in idea 2020.x

 

Could you please make it possible to add empty modules?

0

There is "Empty project" module type in 2020.2: https://i.imgur.com/ZQP9lOp.png

0

Konstantin Annikov I'm sorry but I don't have it here:

https://files.unir.se/f/3cf27118afcc4e21a17d/

 

```

IntelliJ IDEA 2020.2.3 (Ultimate Edition)
Build #IU-202.7660.26, built on October 6, 2020
Runtime version: 11.0.8+10-b944.34 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7

```

What's more - Idea always seems to be creating ".iml" file instead of prefering '.idea' directory...

 

0

Wojtek  you can use the JavaScript module type.

0

OK, but it would be nice to have dedicated "Empty module" (that would default to `.idea` directory configuration)...

0

Empty project creates a new project with no modules at all, you would still need to have at least one module added to work with files and define the content roots.

I have Empty Project choice in New Project wizard which creates a new project with no modules.

0

The thing is I aiming at Empty **MODULE** (I can get empty project)? Why? Idea dosn't support all possible project types.

 

In my case - I have "docker compose" project (this is overstating by a big margin) but I do have compose file + some Dockerimg and associated files. Idea doesn't provide dedicated module type for it so it would be sane to provide just "empty/generic" project for those type of things. And it's impossible to add those sorces as dedicated module without defining module type.

0

Wojtek

I can suggest you to create your own project/module template and use it to create a custom set of files as a module. 

More information in docs: https://www.jetbrains.com/help/idea/saving-project-as-template.html 

0

Thanks for the hint about custom tempate and the link (voted)

0

In IntelliJ 2020.2, empty template doesn't work for me. After creating a new empty module, I'm getting this error:

"Error adding module to project: java.IOException: Directory is invalid /path/to/content/root/root0/"

I tried creating root0 myself by hand, but then it looks for "root1" and so on.

Steps to reproduce:

1. Create an empty project in IntelliJ.

2. Tools > Save Project as Template

3. Open another project, then create a new module from that template.

 

 

0

Please sign in to leave a comment.