Setting MavenGeneralSettings relative to $PROJECT_DIR$ and sharing it with VCS?
Hi all.
We have several maven projects each of them use its own maven distribution and its own maven user settings.
All projects are under VCS.
We want that our developers could open these projects in IntelliJ IDEA (2019.3) after checking out without any additional manual configuration of IDEA.
For that reason we put directory .idea (except the workspace.xml according to https://intellij-support.jetbrains.com/hc/en-us/articles/206544839-How-to-manage-projects-under-Version-Control-Systems) under VCS.
The problem is: MavenGeneralSettings are saved in workspace.xml and after checking out the project the developers have to configure maven settings in IntelliJ IDEA manually.
What I tried is to specify MavenGeneralSettings in .IntelliJIdea\config\options\project.default.xml in the following way:
<component name="MavenImportPreferences">
<option name="generalSettings">
<MavenGeneralSettings>
<option name="localRepository" value="C:\.m2\repository" />
<option name="mavenHome" value="$PROJECT_DIR$/maven" />
<option name="userSettingsFile" value="$PROJECT_DIR$/maven/userSsettings.xml" />
</MavenGeneralSettings>
</option>
<option name="importingSettings">
<MavenImportingSettings>
<option name="dedicatedModuleDir" value="$PROJECT_DIR$/.idea/modules" />
<option name="jdkForImporter" value="#JAVA_HOME" />
<option name="vmOptionsForImporter" value="-Xmx1024m" />
</MavenImportingSettings>
</option>
</component>
But this has no effect.
So, my question is:
Is it somehow possible to save maven settings for IDEA project, so that maven directories and files are specified relative to $PROJECT_DIR$ and so that it is possible to open this IDEA project and start working with it without any additional manual configuration of IDEA?
Please sign in to leave a comment.
Hi. Please check this answer: https://youtrack.jetbrains.com/issue/IDEA-26406#focus=streamItem-27-3688813.0-0