Re: Any idea why Ivy only publishes a POM and not an ivy.xml?

Martin Gainty <[email protected]> Mon, 3 Aug 2026 22:39:45 +0000
Newsgroups gmane.comp.jakarta.ant.devel
Message-ID <SN7PR19MB70912B37BBE8BA93EE36848EAED52@SN7PR19MB7091.namprd19.prod.outlook.com>
--_000_SN7PR19MB70912B37BBE8BA93EE36848EAED52SN7PR19MB7091namp_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello Eric
if scope is runtime you can specify banned dependencies implementing the ma=
ven-enforcer-plugin as seen here
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>enforce-banned-scopes</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes> <!-- Exclude httpclient, and Pack200 in runtime scope -->
<exclude>org.apache.httpcomponents.client5:httpclient*:*:runtime</exclude>
<exclude>java.util.jar:Pack200:*:*:runtime</exclude>
</excludes>
</bannedDependencies>
</rules>
</configuration>
</execution>
</executions>
</plugin>

Will this work for op?
Martin

________________________________
From: Milles, Eric (TR Technology) via dev <[email protected]>
Sent: Monday, August 3, 2026 12:49 PM
To: [email protected] <[email protected]>
Cc: Milles, Eric (TR Technology) <[email protected]>
Subject: Re: Any idea why Ivy only publishes a POM and not an ivy.xml?

In your ivy xml, you would have something like this:

<dependency org=3D"org.apache.ivy" name=3D"ivy" conf=3D"your_conf->core(mas=
ter),httpclient(optional)">
  <exclude org=3D"org.apache.commons" module=3D"commons-compress" />
  <!-- other excludes for "vfs", etc. -->
</dependency>

The maven scope mapping does not provide a separate name to use for "httpcl=
ient" and "pack200" groups.  But you can remove the extras.  It might be ea=
sier to add the org.apache.httpcomponents:httpclient dependency instead of =
excluding all others.

Yes, if the ivy.xml was published you could do this more directly.

________________________________
From: Stefan Bodewig <[email protected]>
Sent: Monday, August 3, 2026 11:23 AM
To: [email protected] <[email protected]>
Subject: Re: Any idea why Ivy only publishes a POM and not an ivy.xml?

On 2026-08-03, Milles, Eric (TR Technology) via dev wrote: > As a consumer,=
 you can provide fallback. For example > conf=3D"optional(runtime)". I don'=
t believe this does what I want. Ivy has this in its dependency section <de=
pendency


On 2026-08-03, Milles, Eric (TR Technology) via dev wrote:

> As a consumer, you can provide fallback.  For example
> conf=3D"optional(runtime)".

I don't believe this does what I want.

Ivy has this in its dependency section

        <dependency org=3D"org.apache.httpcomponents" name=3D"httpclient" r=
ev=3D"${httpclient.version}" conf=3D"default,httpclient->runtime,master"/>
        <dependency org=3D"org.apache.commons" name=3D"commons-compress"
                    rev=3D"${commons-compress.version}"
                    conf=3D"default,pack200->default,optional">
          <exclude org=3D"com.github.luben"/>
          <exclude org=3D"org.brotli"/>
          <exclude org=3D"org.tukaani"/>
        </dependency>
        ...

both httpclient and commoms-compress end up as optional in the Maven
POM.

As a project that depends on Ivy I only want to pull in the dependencies
required to use httpclient but not pack200 as I know nothing is going to
use pack200 (or vfs, or jsch or ...). With an Ivy file I can say
default->httpclient . Can I achieve the same with a POM alone?

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



--_000_SN7PR19MB70912B37BBE8BA93EE36848EAED52SN7PR19MB7091namp_--