You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2026/07/19 08:36:39 UTC

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

Dear people with Ivy knowledge

I want to add Ivy support to the CycloneDX Antlib next, so people who
use Ivy don't need to specify all (dependency) components manually.

As first step I added a dependency to Ivy with
https://github.com/apache/ant-antlibs-cyclonedx/commit/1ca8ce0e0dff4df1fc47ffb68a4117f4b6424148

Intially I only had conf="default" or "default->default" in ivy.xml but
that only added ivy.jar to the classpath and the jar with all
dependencies. When I added "optional" I got the rest of Ivy's
dependencies as well.

This lead me to understand Ivy was using the ivy-2.6.0.pom and not the
Ivy file which would have lots of configurations. And yes, there is no
ivy.xml file in maven central. We do publish ivy.xml files with the
Antlibs, though.

Is there any reason Ivy doesn't publish its ivy.xml file? And if there
is, should we stop publishing that of the Antlibs?

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


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

Posted by Stefan Bodewig <bo...@apache.org>.
On 2026-08-03, Milles, Eric (TR Technology) via dev wrote:

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

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

> The maven scope mapping does not provide a separate name to use for "httpclient" and "pack200" groups.  But you can remove the extras.  It might be easier 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.

Thank you, Eric. So doesn't Ivy take away one of Ivy's benefits (the
more powerful configuration concept) by not publishing the ivy.xml
file. Exclusions and explicit dependencies (which I d personally prefer,
the example was just for the sake of argument) can be done with other
tools as well.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


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

Posted by Martin Gainty <mg...@hotmail.com>.
Hello Eric
if scope is runtime you can specify banned dependencies implementing the maven-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 <de...@ant.apache.org>
Sent: Monday, August 3, 2026 12:49 PM
To: dev@ant.apache.org <de...@ant.apache.org>
Cc: Milles, Eric (TR Technology) <er...@thomsonreuters.com>
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="org.apache.ivy" name="ivy" conf="your_conf->core(master),httpclient(optional)">
  <exclude org="org.apache.commons" module="commons-compress" />
  <!-- other excludes for "vfs", etc. -->
</dependency>

The maven scope mapping does not provide a separate name to use for "httpclient" and "pack200" groups.  But you can remove the extras.  It might be easier 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 <bo...@apache.org>
Sent: Monday, August 3, 2026 11:23 AM
To: dev@ant.apache.org <de...@ant.apache.org>
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="optional(runtime)". I don't believe this does what I want. Ivy has this in its dependency section <dependency


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

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

I don't believe this does what I want.

Ivy has this in its dependency section

        <dependency org="org.apache.httpcomponents" name="httpclient" rev="${httpclient.version}" conf="default,httpclient->runtime,master"/>
        <dependency org="org.apache.commons" name="commons-compress"
                    rev="${commons-compress.version}"
                    conf="default,pack200->default,optional">
          <exclude org="com.github.luben"/>
          <exclude org="org.brotli"/>
          <exclude org="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: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org



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

Posted by "Milles, Eric (TR Technology) via dev" <de...@ant.apache.org>.
In your ivy xml, you would have something like this:

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

The maven scope mapping does not provide a separate name to use for "httpclient" and "pack200" groups.  But you can remove the extras.  It might be easier 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 <bo...@apache.org>
Sent: Monday, August 3, 2026 11:23 AM
To: dev@ant.apache.org <de...@ant.apache.org>
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="optional(runtime)". I don't believe this does what I want. Ivy has this in its dependency section <dependency


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

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

I don't believe this does what I want.

Ivy has this in its dependency section

        <dependency org="org.apache.httpcomponents" name="httpclient" rev="${httpclient.version}" conf="default,httpclient->runtime,master"/>
        <dependency org="org.apache.commons" name="commons-compress"
                    rev="${commons-compress.version}"
                    conf="default,pack200->default,optional">
          <exclude org="com.github.luben"/>
          <exclude org="org.brotli"/>
          <exclude org="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: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org



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

Posted by Stefan Bodewig <bo...@apache.org>.
On 2026-08-03, Milles, Eric (TR Technology) via dev wrote:

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

I don't believe this does what I want.

Ivy has this in its dependency section

        <dependency org="org.apache.httpcomponents" name="httpclient" rev="${httpclient.version}" conf="default,httpclient->runtime,master"/>
        <dependency org="org.apache.commons" name="commons-compress"
                    rev="${commons-compress.version}"
                    conf="default,pack200->default,optional">
          <exclude org="com.github.luben"/>
          <exclude org="org.brotli"/>
          <exclude org="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: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


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

Posted by "Milles, Eric (TR Technology) via dev" <de...@ant.apache.org>.
As a consumer, you can provide fallback.  For example conf="optional(runtime)".  If optional is there, you get that.  If not, it tries runtime.  You can provide multiple values inside the fallback.  Another example, we use "main" in our ivy.xml and this maps to "compile" in maven pom.  So, when linking to an internal project, we specify conf="main(compile)".  Now we can have project linked in local workspace or consumed from repository with only maven artifacts.

________________________________
From: Stefan Bodewig <bo...@apache.org>
Sent: Monday, August 3, 2026 9:13 AM
To: dev@ant.apache.org <de...@ant.apache.org>
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: > I don't think the ivy. xml would supply anything that the pom does not already describe. When ivy consumes, the pom is converted into a suitable ivy. xml. I'm not sure. What if I


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

> I don't think the ivy.xml would supply anything that the pom does not already describe.  When ivy consumes, the pom is converted into a suitable ivy.xml.

I'm not sure. What if I as a counsumer of the ivy file want to use a
specific configuration of it?

For example Ivy itself has configurations for "optional" stuff that are
specific for some use cases. When I've got Ivy's ivy.xml I can say
something like default->httpclient and get the transitive dependencies
of core and httpclient as dependencies of my default configuration. With
"only" the POM I need to do default->default,optional and get way more
than I want. At lest this is my current understanding.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org



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

Posted by Stefan Bodewig <bo...@apache.org>.
On 2026-08-03, Milles, Eric (TR Technology) via dev wrote:

> I don't think the ivy.xml would supply anything that the pom does not already describe.  When ivy consumes, the pom is converted into a suitable ivy.xml.

I'm not sure. What if I as a counsumer of the ivy file want to use a
specific configuration of it?

For example Ivy itself has configurations for "optional" stuff that are
specific for some use cases. When I've got Ivy's ivy.xml I can say
something like default->httpclient and get the transitive dependencies
of core and httpclient as dependencies of my default configuration. With
"only" the POM I need to do default->default,optional and get way more
than I want. At lest this is my current understanding.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


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

Posted by "Milles, Eric (TR Technology) via dev" <de...@ant.apache.org>.
I don't think the ivy.xml would supply anything that the pom does not already describe.  When ivy consumes, the pom is converted into a suitable ivy.xml.
________________________________
From: Maarten Coene via dev <de...@ant.apache.org>
Sent: Monday, August 3, 2026 5:43 AM
To: dev@ant.apache.org <de...@ant.apache.org>
Cc: Maarten Coene <ma...@yahoo.com>
Subject: Re: Any idea why Ivy only publishes a POM and not an ivy.xml?

> Is there any reason Ivy doesn't publish its ivy. xml file? And if there > is, should we stop publishing that of the Antlibs? I don't think there is a particular reason for that. I guess we never thought if that before, and no-one ever


> Is there any reason Ivy doesn't publish its ivy.xml file? And if there
> is, should we stop publishing that of the Antlibs?

I don't think there is a particular reason for that.
I guess we never thought if that before, and no-one ever asked for it :-)

kind regards,
Maarten

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org



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

Posted by Maarten Coene via dev <de...@ant.apache.org>.
> Is there any reason Ivy doesn't publish its ivy.xml file? And if there
> is, should we stop publishing that of the Antlibs?

I don't think there is a particular reason for that.
I guess we never thought if that before, and no-one ever asked for it :-) 

kind regards,
Maarten

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org