Bilbo Baggins
Bilbo Baggins

Reputation: 1199

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

I have Web Project with an ivy.xml file with multiple configurations - compile, provided, and test. For deployment I would like to set certain dependencies to be included into the .war file (compile) but not include the other dependencies.

So far I am able to set the IvyIDEA plugin to only resolve specific ivy configurations, but for the life of me I can't figure out how to create multiple IvyIDEA libraries for each configuration.

According to the following links it is possible, but they provide no additional details:

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

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

According to the first link, "There is an option in the IvyIDEA configuration to include the name of the module+configuration into the IDEA library name", but I cannot find this option.

According to the second link, "In the IvyIDEA settings there is an option to create an IDEA library for each configuration", but I cannot find this option.

Any help would be appreciated.

Upvotes: 1

Views: 382

Answers (2)

Bilbo Baggins
Bilbo Baggins

Reputation: 1199

Figured this out on my own by accident. Turns out I was looking in the wrong place.

The correct place to look is under File > Settings, or press Ctrl + Alt + S.

From there you can select IvyIDEA from the settings pane (for me it is right below Tools). In this window there is a section called "Resolved Library Naming" where you can choose to "Include Module Name" and/or "Include Configuration Name".

Once you've done this, right click on your project then select IvyIDEA > Resolve and you should see your organized libraries under "External Libraries".

Using these you can define which to deploy into your .war file.

Upvotes: 1

Mark O'Connor
Mark O'Connor

Reputation: 77991

The WAR file would be built by ANT. Use the ivy retrieve task to create a directory containing the "compile" dependencies as follows:

<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>

Upvotes: 0

Related Questions