How to share IntelliJ Run / Debug projects between projects?

I have many different versions of my application. Each of them is a separate intellij project. Every time I open a new one, the configuration list is empty:

enter image description here

The annoying thing about this is that I deploy to 1 vm and I have to copy and paste debug configurations every time I want to test a different version. Intellij makes this dialog modal for Intellij Instance, so I cannot copy and paste fields between instances of Project.

As a result, I take a screenshot of one configuration and manually copy the fields to another project. This is a fairly primitive solution. Is there a more convenient way to get the launch configuration from one project to another?

I am using Intellij 13 for Windows 7.




Can I share settings for IntelliJ Idea in different projects? can answer this question, but the question is different. This is about the layout of the window. Therefore, I do not consider this a duplicate.

+69
java intellij-idea
Jul 08
source share
5 answers

The best way to do this is to click the โ€œshareโ€ checkbox next to the โ€œNameโ€ field when editing / creating the configuration. You can go to this Run> Edit Configurations dialog box.

enter image description here

The share checkmark pulls the settings from your workspace.xml and instead places it in the .idea\runConfigurations . It is designed so that you can share the setting with others. You can copy this file and place it in one place in all projects of your idea.

However, in the future you may need to use version control branches for application versions, rather than individual projects. IntelliJ does a great job of this.

+89
Jul 08 '14 at 10:03
source share

goto

 Run > Edit Configuration > create or select existing configuration you want to use > click save and persist it on file system > click on share check mark 

now copy this file from

  PROJECT_ROOT_DIRECTORY/.idea/runConfigurations/ConfigurationName.xml 

to your NEW_PROJECT_ROOT_DIRECTORY/.idea/runConfigurations in the same place and now it is available for your launch configuration

+7
Jul 08 '14 at 22:04
source share

Copy folder

 ~/your-old-project/.idea/runConfigurations 

to

 ~/your-new-project/.idea/ 

This is the folder containing the startup configurations.

+5
02 Sep '16 at 19:12
source share

The default launch configurations are stored in the .idea / workspace.xml file. The first alternative is to share this file, but this is not possible because you also share many unnecessary configurations. As already mentioned, the first step is to check the "share" option to separate startup configurations from workspace.xml.

dispatching startup configurations from workspace.xml

After that, I recommend adding runConfigurations to the original control. But the main problem is that you have already marked the .idea folder as ignored. You can unregister a folder by setting up a version control system. For example, if you use git, you can modify the .gitignore file as follows:

 .idea/* !/.idea/runConfigurations 

don't forget to add * after .idea /

As a last step, add your launch configurations to the original control and enjoy the general settings!

+2
Sep 05 '17 at 15:08
source share

This is not exactly the answer to your question, but it answers a question similar to your question and the one I had, and I suppose others can as well.

That is, how to save the configuration of the run of the unit and instrumentation? Usually I right-click on the test directory, in which a menu appears with the option "Run everything that is in this directory." AndroidStudio then creates the launch configuration โ€œon the fly,โ€ and a new option โ€œSave new configuration?โ€ Appears in the "Configure configuration" drop-down menu. or something similar.

Clicking this option opens the Run Configuration menu, and at that moment I check the Share box, as mentioned by many others. Then it makes the version control system ask me if I want to add this new launch configuration file. If you have not registered your version control system, you can find new files in the .idea / runConfigurations files.

0
Sep 05 '17 at 17:57
source share



All Articles