Intellij中如何将模块+配置的名称包含到IvyIDEA库名中

How to include the name of the module+configuration into the IvyIDEA library name in Intellij

我有一个带有 ivy.xml 文件的 Web 项目,该文件具有多种配置 - 编译、提供和测试。对于部署,我想将某些依赖项设置为包含在 .war 文件(编译)中,但不包含其他依赖项。

到目前为止,我能够将 IvyIDEA 插件设置为仅解析特定的 ivy 配置,但对于我来说,我无法弄清楚如何为每个配置创建多个 IvyIDEA 库。

根据以下 links 是可能的,但他们没有提供额外的细节:

https://github.com/guymahieu/ivyidea/issues/90

https://github.com/guymahieu/ivyidea/issues/99

根据第一个link,"There is an option in the IvyIDEA configuration to include the name of the module+configuration into the IDEA library name",但是我找不到这个选项。

根据第二个link,"In the IvyIDEA settings there is an option to create an IDEA library for each configuration",但我找不到这个选项。

如有任何帮助,我们将不胜感激。

WAR 文件将由 ANT 构建。使用 ivy retrieve 任务创建包含 "compile" 依赖项的目录,如下所示:

<ivy:retrieve pattern="${lib.dir}/[artifact]-[revision].[ext]" conf="compile"/>

<war destfile="${war.file}" webxml="${resources.dir}/web.xml">
    <fileset dir="${resources.dir}" excludes="web.xml"/>
    <lib dir="${lib.dir}"/>
</war>

这是我自己偶然想出来的。原来我找错地方了

正确的查看位置在 文件 > 设置 下,或按 Ctrl + Alt + S

从那里你可以从设置面板select IvyIDEA(对我来说它就在工具下面)。在这个 window 中有一个名为 "Resolved Library Naming" 的部分,您可以在其中选择 "Include Module Name" and/or "Include Configuration Name".

完成此操作后,右键单击您的项目,然后 select IvyIDEA > Resolve,您应该会在 "External Libraries" 下看到组织好的库。

使用这些您可以定义将哪些部署到您的 .war 文件中。