简体   繁体   中英

How to import a gradle project into Intellij without it creating .iml files

I have a 'pure' gradle project containing build.gradle, settings.gradle and a src folder. Nothing else.

I want to open this in IntelliJ but I don't want IntelliJ to add its own module files. I want the project to remain 'pure' gradle so that it can be built and run from the commandline later. I have managed to do this properly with other projects, but with the current project I'm trying to import/open, every time I open it, IntelliJ creates a Project.iml file.

I'm sure I can live with the .iml file being there, but I don't want it, and I'd like to understand what is going on.

I have "Delegate IDE build/run actions to gradle" switched on in preferences. I have tried to both "Import" and "Open" the project from IntelliJ's wizard. I have removed the .idea folder each time I try this. I've tried different setting in the Import/Open wizards. IntelliJ always creates the .iml. Worse, if I try to remove that file it screws up the view of the project structure in the Project pane.

When importing a Gradle build.gradle file in IntelliJ IDEA there is a setting called Store generated project files externally :

EXT

If you enable it, you will not have to exclude IntelliJ IDEA generated project files from the version control . Generated files will be stored under idea.system.path instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM