如何在项目之间共享IntelliJ运行/调试配置? [英] How do I share IntelliJ Run/Debug configurations between projects?

查看:100
本文介绍了如何在项目之间共享IntelliJ运行/调试配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多不同版本的应用。每个都是一个单独的intellij项目。每次我打开一个新配置时,配置列表都会空白:

I have many different versions of my app. Each one is a separate intellij project. Every time I open a new one, the list of configurations starts blank:

关于这个令人讨厌的事情是我部署到1 vm并且我每次都需要复制和粘贴调试配置测试不同的版本。 Intellij根据Intellij实例创建此对话框模式,因此我无法在项目实例之间复制和粘贴字段。

The annoying thing about this is I deploy to 1 vm and I have to copy and paste the debug configurations each time I want to test a different version. Intellij makes this dialog modal per Intellij Instance, so I can't copy and paste the fields between Project Instances.

我最终拍摄了一个配置的屏幕截图,并手动将字段复制到另一个项目中。这是一个非常原始的解决方案。是否有更方便的方法将运行配置从一个项目转移到另一个项目?

I end up taking a screenshot of one configuration and copying the fields by hand into the other project. It's a pretty primitive solution. Is there a more convenient way to get a run configuration from one project to another?

我在Windows 7上使用Intellij 13.

I'm using Intellij 13 on Windows 7.

我可以在不同的项目中共享IntelliJ Idea的设置吗?可能有答案,但问题是不同的。这是关于窗口布局。因此,我不认为它是重复的。

Can I share settings for IntelliJ Idea across different projects? may have the answer to this, but the question is different. It's about window layout. Therefore I don't consider it a duplicate.

推荐答案

最好的方法是点击下一步共享复选标记编辑/创建配置时命名字段。您可以使用运行>编辑配置访问此对话框。

The best way to do this is to click the "share" checkmark next to Name field when you edit/create the configuration. You can get to this Dialog with Run > Edit Configurations.

共享复选标记从 workspace.xml 中提取设置,而是将其放在目录 .idea \runConfigurations 中。这是为了与其他人共享设置而设计的。
您可以复制此文件并将其放在所有想法项目中的相同位置。

The share check-mark pulls the setting out of your workspace.xml and instead puts it in the directory .idea\runConfigurations. This is designed so you can share the setting with others. You could copy this file and put it in the same location in all your idea projects.

但是,将来您可能需要考虑使用源代码控制应用程序版本的分支而不是单独的项目。 IntelliJ处理得非常好。

However, in the future, you might want to consider using source control branches for app versions rather than separate projects. IntelliJ handles these very well.

这篇关于如何在项目之间共享IntelliJ运行/调试配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆