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

3
42 comments

aaaand 5 years later still no easy way to copy a run configuration from one project to another...

7

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.

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.


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


2

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.

2

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.

2

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/ .

2

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.

1

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.

1

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.

 

 

1

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!

1

I 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. 

1

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.

1

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?

1

This way all the users already having .gitignore properly configured in their projects will have to adjust it again for the yet another directory.

1

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

0

Ah. My bad. The dialog was too small and I had to croll down or expand the dialog to see the checkbox...

0

How do you import the seperate run configs in their own xml to a new project ?

Thanks

0

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)

0

I agree with Lukas , as it stands it's "acceptable" , my run configurations get picked up without having to restart intellij so thats nice.

0

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.

0

Use the shared configurations with .idea directory based project format.

0

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.

0

That's a small price to pay for a proper solution.

0

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.

0

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.

0

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.

0

To ensure that any new run configurations are created with the desired settings, my fellow engineers and I at my company configure the run template configuration settings. This is especially useful for running tests within IDEA. The attached screen shot shows a sample. It appears that these template configurations are stored inside `.idea/workspace.xml`. Is there any way to export and share these?

0

Sharing default/template configurations is not supported yet: https://youtrack.jetbrains.com/issue/IDEA-65915.

0

Idea 2021.2.2

*.run.xml files put into .run folder does not appear in run configurations dialog. only after I moved them to .idea/runConfugurations they did appear

0

@Guai could you please describe the steps to reproduce this - how do you save the run configurations?

Note that you should save them from the Run Configuration interface for the IDE to discover the path properly:

The file must end with

.run.xml

and be located under the project content root directory.

0

Please sign in to leave a comment.