每个 Intellij Maven 模块的自定义 Maven 设置/构建位置

时间:2021-02-23 08:56:48

标签: java maven intellij-idea

是否可以为每个 Intellij maven 模块自定义 maven 设置/构建位置?

这些 maven 设置似乎属于每个项目而不是每个模块提供的 workspace.xml。我需要在workspace.xml 中给出相同的代码片段:

  <component name="MavenImportPreferences">
    <option name="generalSettings">
      <MavenGeneralSettings>
        <option name="mavenHome" value="<CUSTOM>" />
        <option name="userSettingsFile" value="<CUSTOM>" />
      </MavenGeneralSettings>
    </option>
    <option name="importingSettings">
      <MavenImportingSettings>
        <option name="importAutomatically" value="true" />
      </MavenImportingSettings>
    </option>
  </component>

对于每个 .iml,或者是否有任何可用于模块的自定义 workspace.xml?

1 个答案:

答案 0 :(得分:0)

intellij maven 开发人员在线。

现在无法在设置中为不同的链接 maven 项目设置不同的 maven 发行版。 (我们计划在未来这样做)

作为一种解决方法,您可以尝试使用 maven 包装器。 IDEA 现在在 2020.1 中支持每个项目的 maven 包装器,但仅用于导入。稍后支持通过 mvnw 执行。