Export settings and share them with other developers
Hi!
I've sucessfully exported all my settings into one jar. My goal is to be able to copy this jar to other developers so that we have the same base settings.
In the jar, one of the files (namely "options\project.default.xml") contains my Windows username in two places:
- The name of the dictionnary
- The svn configuration directory, which points to C:\Users\MyUsername\AppData\Roaming\Subversion
Two questons:
1. Does the IDE check those informations and replace them with the correct ones at import time, if the user is not the same as it was at export time?
2. Is there a way to place a variable instead of the username in the project.default.xml file to make sure that the correct name is used at import time?
I honestly don't expect the IDE to do (1) but hope for some way to achieve (2). :)
Thanks for your help!
Sébastien
请先登录再写评论。
Hello.
Settings import is basically just unpacking. Particular IDE subsystems, reading their settings from xml configs, can do some "clever" things, but I would not expect it.
Path variables are supported. Please add an entry to Settings / Path Variables.
NB: when defining a path (e.g. to SVN configuration) you have not to type your variable name. Instead, you type a real file system path, IDE checks it against defined path variables, and replace the start of the path with a matching variable.
Variables are stored in config/options/path.macros.xml. Just notice that on imporing settings they contain paths from machine they were exported.
Several variables are predefined, like USER_HOME.
Regards,
Alexander.
Thank you for your reply.
What are the predefined variables? I can't find them in the documentation...
USER_HOME is used for sure.
Others may be defined by plugins, so the list is potentially not limited. E.g. Maven plugin defines MAVEN_REPOSITORY and M2_HOME variables (taken from other sources), Kotlin plugin defines KOTLIN_BUNDLED. This way other plugins also can define something.
Alexander.
ok thanks a lot!
Hello Alexander,
Sorry for bringing back an old post...
I've tried what we discussed here locally and it works fine, but when I export the settings, the path.macros.xml file is not present in the Jar.
Is that a bug in the export algorythm, or did I do something wrong?
Thanks for your help,
Sébastien
Hello.
Yes, it's the same for me. May be a bug, or decision not to export local file system paths (which path.macros.xml basically consist of). Since the export is very old, I doubt, does anybody remember why this file is skipped. You can create an issue in the tracker, if this prevents working.
Basically the export is just packing xmls into jar.
Regards,
Alexander.
Hello Alexander,
Thanks for your answer!
I'll open an issue for that. Since it's the second issue I'm going to open about data missing from the export, should I ask for a thorough verification of everything that might be missing from the export?
Also: if I add manually the xml file to the JAR, will it be used during the import?
Regards,
Sébastien
Hi.
> Also: if I add manually the xml file to the JAR, will it be used during the import?
I've checked it, and unfortunately no, the file has not been picked. Probably it's because import asks to select desirable settings categories to import, and path variables are just not suggested.
> should I ask for a thorough verification of everything that might be missing from the export
Probably you have to create an issue in the bug tracker and describe what do you need, like "export all settings" or "export path variables".
Also you may try the following. Install IDEA, setup necessary (base) settings. They all are stored in user.home/.IntellijIdeaNN/config. Pick desired files. Probably, skip some files or remove components inside files, containing user-specific name or paths.
Archive the files. Suggest to unpack this archive into other users' config directories.
Regards,
Alexander.
Hello Alexander,
Thanks for your reply. I've created an issue here: http://youtrack.jetbrains.com/issue/IDEA-127006
I thought of simple copying the files like you suggest, but it's much more easy and straightforward to use the built-in feature. Moreover, the behavior that you described in your first answer (checking against existing variables) would not be available if I just copy/past the home directory.
After all, I just want to use the import/export feature like it's supposed to work :)
Regards
Why still exporting as a Jar? this makes it hard to share via email. Why not json like VSCODE