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

25 comments
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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

0
Comment actions Permalink

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

Thanks

0
Comment actions Permalink

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
Comment actions Permalink

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

5
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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.

1
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

I copy/paste runConfiguration sub-folder under .idea folder as Mark wrote six years ago

-1
Comment actions Permalink

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.

-1
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

@Mhobbs07 Use Share configuration checkbox in the Run/Debug configuration settings

-1
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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

0
Comment actions Permalink

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
Comment actions Permalink

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

0
Comment actions Permalink

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

-1

Please sign in to leave a comment.