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

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

Andrey Dernov, I had some configuratins saved outside of the project. There are some other run configurations in the project (not yet saved), if I choose to save them then Idea saves them to the project/.run folder. Then I place those saved (outside) confugurations there right next to newly saved files and they do not appear in the dialog. But when I moved those saved configurations to project/.idea/runConfigurations they did appear

0

How do you save the configuration outside? As mentioned the files must be saved from the IDE UI. Also the file must end with

.run.xml

and be located under the project content root directory.

0

they do end with .run.xml

I backed them up from that same project earlier. then I've recreated the project and return the files to their original location. For some reason that didn't work unless I moved them to project/.idea/runConfigurations

0

Okay, looks like https://intellij-support.jetbrains.com/hc/en-us/community/posts/206905825-how-to-persist-and-import-run-configurations?page=1#community_comment_360001555480 is the more current GUI way. But while at it, is there any way to have the script path and working directory be specified in the run configuration (via the GUI or otherwise) as relative paths relative to the project root, so that these run configurations are really as valuable to share as they can be? 

0

>is there any way to have the script path and working directory be specified in the run configuration (via the GUI or otherwise) as relative paths relative to the project root

Are you talking about some specific run configuration? What is the exact issue?

0

Thanks, we currently use full paths for those run configuration fields (script path and working directory) whereas in order to share configurations after exporting them, we'd need to use relative paths in the configurations, which is something that I'm not sure is possible (using relative paths in a run configuration). Perhaps you can point me in the right direction, naively using paths relative to the project root, in a run configuration, doesn't work for me, so I wonder if that is supported in some way. Because that way we can share run configs without each person having to change the paths to suit the full path where they keep the project.

0

Each configuration has its specifics. Please specify the run configuration you are using and which run configuration parameters you are using. 

Generally, for standard "project directory" paths one does not need to add any specific variables/configurations. If it is feasible for the current context - IDE will use paths, relative the project directory.

The other option - is to define your own Path Variable macro for the path, specific to your machine. Then IDE will substitute this path to a macro variable in xml files, when saving the configuration. Other developers when opening the run configuration will be prompted to define their own  path for this macro.

0

Please sign in to leave a comment.