我需要在 Intellij IDEA 中打开项目时对其进行设置,代码格式 xml 文件应该自动设置。我使用“代码样式”->“java”->“导出到文件”功能创建了该文件。现在我有定义自定义 java 样式的 xml 文件,我打算将此文件添加为项目源。当其他团队成员打开项目时,我需要 Intellij IDEA 自动从此给定文件加载 java 样式。这可能吗 ?如果是这样怎么办?我无法从搜索中找到解决此问题的方法。
最佳答案
打开设置:首选项 |编辑| Code Style
Scheme附近有一个小图标,点击后可以:
You can copy the IDE scheme (Default) to the current project, using the Copy to Project... command.
您现在可以看到:.idea/codeStyles/
:codeStyleConfig.xml
和Project.xml
您可以通过将这些文件提交到版本控制存储库(例如 git)来与整个团队共享设置。
您还可以share运行配置 - 请参阅 How do I share IntelliJ Run/Debug configurations between projects?
(.idea\runConfigurations
)
另请参阅:
- 共享您的 IDE 设置 - https://www.jetbrains.com/help/idea/sharing-your-ide-settings.html
- https://stackoverflow.com/a/46144716
- https://tips.seebrock3r.me/share-the-settings-with-the-whole-team-android-studio-protip-6-3cce16eb2ea4
- https://tips.seebrock3r.me/share-settings-with-the-team-a-year-later-e28c24fc07aa
关于java - 项目打开时自动导入 Intellij IDEA java 样式格式化程序文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50828928/