how to persist and import run configurations
Answered
Is there a way in IDEA to export the current run configurations to a file( not the .iws file ) so that they can be published and imported into other users' workspace?
My project is .ipr file based.
---------------------------
Somesh Sasalatti
Senior Member of Techincal Staff
Salesforce.com
Please sign in to leave a comment.
Hello somesh,
If you check the "Share configuration" checkbox in the run configurations
dialog, the selected run configuration will be stored in the .ipr file.
If you use the directory-based project format, every shared run configuration
is stored in a separate .xml file.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
I am using IU-107.148 (first EAP after release of 10.5)
I do not see any "share" checkbox in the run configurations dialog. I am using the directory based project (so the run configurations are nodes in .idea/workspace.xml).
I have two versions of the project - one on my laptop and one on my desktop. I've been unable to use the same one on both machines due to slight differences in the JDK and other similar differences. Anyway, I am looking for an easy way to either share run configurations between the two projects, or at least to easily copy run configurations between them. Would be nice to do the same for artifacts.
Arnon
Ah. My bad. The dialog was too small and I had to croll down or expand the dialog to see the checkbox...
How do you import the seperate run configs in their own xml to a new project ?
Thanks
There isn't an impot function as such. Just put the xml file into the .idea\runConfigurations directory of the new project. You may need to create the 'runConfiguration' directory.
aaaand 5 years later still no easy way to copy a run configuration from one project to another...
Follow the steps provided above i.e..'check share...., create new runConfigurations folder if needed..' then if you have your IDE currently running when you copied over the file, you must close the IDE and relaunch. It will pick the new configurations after the restart.
Also struggling with this, my build configurations all have the share box ticked, I've manually created a runConfigurations directory and there's no XML within.
Tried restarting the IDE, have even restarted the machine once.
This is poor. This must have been an issue for user for many years, and still not addressed. I use three different machines depending on location, and keep having to re-create the run/debug configs.
I just did and it wasn't that bad. Of course, it would be helpful to have it exportable/importable (similar approach as it used for Patching in Git), however, I think this is acceptable - as all configurations appears in single directory 'runConfigurations'. You just need to copy that (as @Mark Veder mentioned this already)
I agree with Lukas , as it stands it's "acceptable" , my run configurations get picked up without having to restart intellij so thats nice.
This solution did not work for me. I set the run config to "Share", but nothing was dropped in the file system. I tried creating the runConfigurations directory manually with the same result. No amount of "applying" or restarting helped.
I copy/paste runConfiguration sub-folder under .idea folder as Mark wrote six years ago
Mark's solution posted six years ago works for me. Just create a "runConfigurations" folder under ".idea" folder and put your .xml file into it.
I run several processes with different configs for my micro-service system. It'd be super helpful to have an import/export option for all (or a set of selected ones) configs under "Run Configurations". It'd be a way easier to backup and do minor tweaks during tests in addition to share with my team!
See http://stackoverflow.com/a/3136255/104891.
It would be nice if these run configurations could be included in the settings repository. This would also allow other team members to pull these run configurations from version control to avoid copy and paste.
@Mhobbs07 Use
Share configuration
checkbox in the Run/Debug configuration settingsI agree, it would be very nice to be able to store run configuration in a settings repository and share them without copying /pasting, synching changes is a nightmare if you have multiple branches.
Run configuration can be specific to the code in a branch and may not work with a different branch. Shared configurations stored in the version control solve this problem.
It should be so easy like .launch file in Eclipse but isn't.
We use ipr project files which can't be commited to VCS and there are no support for such case.
Even if you copy configurations from ipr to .idea\runConfigurations\workspace.xml then file will be ignored and cleared.
Can't you just add support for ipr and workspace.xml and merge both configurations in GUI?
Use the shared configurations with .idea directory based project format.
There should be a better way than sharing your ENTIRE .idea folder or manually adding a folder and dropping the XML inside. My suggestion is to put the run config in its own folder within the root of the project when I click "Share through VSC." That way I can maintain the .gitignore file ignoring my personal .idea folder but include the Run/Debug configurations.
This way all the users already having .gitignore properly configured in their projects will have to adjust it again for the yet another directory.
That's a small price to pay for a proper solution.
How this works in 2020.1 is hard to piece together from the above. The Run Configurations dialog has no "Share" checkbox. Is there up-to-date coherent documentation for the above? I found nothing here, where I would expect it:
https://www.jetbrains.com/help/idea/2020.1/run-debug-configuration-application.html?utm_campaign=IU&utm_content=2020.1&utm_medium=link&utm_source=product#1
Furthermore, on that help page there is a discussion of Store as Project File, a feature that the 2020.1 UI says is for backward compatibility only.
Yes, it has changed the default location to .run directory, but you can still use the same location as in the previous version (.idea/runConfigurations), it's pretty clear from the option:
See https://www.jetbrains.com/help/idea/sharing-run-debug-configurations.html for more details.
It was also highlighted in this blog post in case you've missed it: https://blog.jetbrains.com/idea/2020/03/intellij-idea-2020-1-beta2/ .
Thanks. The weird thing is that all of my .idea folder files are in the repo, and I can see the run configurations in the workspace.xml file, but when I clone the repo to a new folder and open it in IDEA, there are no run configurations. Still, the documentation should explain this clearly and the UI should be clearer.
worskpace.xml is not to be shared via the version control and it's excluded by default, therefore run configurations are not shared this way until you do it explicitly via the share option described above.
Thanks.