<ant><depend id="..."/></ant> not working as expected

Stefan Bodewig <[email protected]> Fri, 15 May 2026 10:52:40 +0200
Newsgroups gmane.comp.jakarta.gump
Message-ID <[email protected]>
Hi

while I was adding a new Antlib component of my own I also looked into
the failing Tomcat test builds in Gump.

Those builds have several <depend> tags with an id for the same project
nested into <ant>.

<ant>
   <depend property="bouncycastle-provider.jar" project="bouncy-castle" id="bc-provider" />
   <depend property="bouncycastle-pkix.jar" project="bouncy-castle" id="bc-pkix" />
   <depend property="bouncycastle-util.jar" project="bouncy-castle" id="bc-util" />
</ant>

Obviously the expectation is this will be equivalent to

<depend project="bouncy-castle" ids="bc-provider bc-pkix bc-util"/>

at the project level (plus three <property> elements).

From reading the docs (I certainly didn't remember the implementation
anymore :-) I can understand why one would expect that.

The current code has never been meant to be used with multiple
dependencies to the same project, I'm afraid. The first nested <depend>
will add <depend project="bouncy-castle" ids="bc-provider"/> to the
project and the next two will not do anything as the project already
depends on "bouncy-castle" (line 161 in builder.py). The method name
project.hasFullDependencyOnNamedProject is misleading.

The workaround is to add an explicit <depend> at the project level,
which I did for the tomcat 11.x builds (partially to verify my
analysis).

A proper fix probably involves checking whether the project-level
dependency either doesn't contain any ids or includes the current
one. Implementing that may take a bit of time (I'm willing to give it a
try).

Stefan