Share Run Configuration with code
Answered
Hi,
is there a best practice on how to share the run/debug configuration between developers using a code versioning system (git/svn).
What do I have to do, so that I share only the run configs but not other settings on the project?
And would it be possible to share some but not all of the run/debug configuations?
Please sign in to leave a comment.
There is a share checkbox in Run/Debug configuration to make it available to other team members:
The location of file would depend on 2 factors, whether the configuration is local to the user or shared with the other developers and if you are using the file based (legacy) or the directory based project format.
File based project, local configuration: .iws file
Directory based project, local configuration: workspace.xml file under .idea directory
File based project, shared configuration: .ipr file
Directory based project, shared configuration: .xml file under runConfigurations subdirectory of .idea directory
https://www.jetbrains.com/help/idea/run-debug-configurations-dialog.html
Have been sitting here reading, guessing, and trying things for hours with no luck.... It would be nice to have an .idea directory checked into git at the root of the project and put runConfigurations .xml's into source control. Our run configuration is fairly involved and we want this to immediately be available to the developer once they "import" a new project from Maven into the .idea directory.
However, when we "Import Project" from a Maven pom.xml, it notices the .idea directory and wipes everything out, even though files underneath it are under source control.
It appears this discussion has been going on for many many years but it seems the need still exists based upon current posts all over the place... (And no solution has ever been implemented)
Putting runConfigurations in a separate directory and then asking developers to manually copy into the .idea directory after the import and then bouncing IntelliJ is, well, a hack..
Can't we just have an option in the Import Maven project wizard that notices runConfigurations and asks if you want to keep them? This would be optimal.
@Mike Michalowicz
You can add a whole .idea directory to git and once the project is pulled, just open (instead of import) it on a new computer. Would this scenario work for your use-case?
And how could I share the same run configuration when I have multiple projects (or branches of the same project) using the same servers configured to run/debug?
Where I work, as a rule, no one is allowed to save any IDE specific configuration on the VCS.
Why not expand the IDE sync settings to also sync the run/debug configuration when needed instead of manually copying some files across projects?
Is there any other way besides copying files manually?
Run configurations are project specific and should be shared with the project. It's not IDE level setting.
For Gradle projects one can use https://github.com/JetBrains/gradle-idea-ext-plugin/wiki/DSL-spec-v.-0.1#runconfigurations .
Including the .idea directory in VCS was problematic for us, but I found a symbolic link helpful though.
This effectively decoupled run configs from the problematic stuff leaving gitignore to have its way with the rest of .idea
What worked for me was to do the following in my .gitignore.
This basically says to ignore everything under .idea except the runConfigruations.