Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#967933: ant-optional: Missing ant-junitlauncher.jar

249 views
Skip to first unread message

Matthijs Kooijman

unread,
Aug 5, 2020, 4:30:03 AM8/5/20
to
Package: ant-optional
Version: 1.10.6-1ubuntu0.1
Severity: normal

Hi,

I'm trying to run junit-based tests for the JOSM application using ant,
which does not work out of the box. The error I'm getting is:

build.xml:491: The following error occurred while executing this line:
build.xml:442: Problem: failed to create task or type junitlauncher
Cause: the class org.apache.tools.ant.taskdefs.optional.junitlauncher.confined.JUnitLauncherTask was not found.

Which suggests the org.apache.tools.ant.taskdefs.optional.junitlauncher.confined package is
missing, which was added in ant 1.10.6 [1].

I'm not entirely familiar with this ecosystem, but I *think* this
package is supplied by upstream (the java sources are present in the
Debian source package) and should result in an ant-junitlauncher.jar
file, which I think should be shipped in the ant-optional Debian
package. However, that jar is not contained in any Debian package
AFAICS.

It seems there is an explicit whitelist of jar/pom files to install, and
this new jar was probably forgotten when it was added upstream?

Note that I tested on a slightly older Ubuntu version, but it seems the
newest Debian version has the same problem.

If my analysis is correct, could you make the changes so
ant-junitlauncher is included?

Gr.

Matthijs

[1]: https://ant.apache.org/manual/api/org/apache/tools/ant/taskdefs/optional/junitlauncher/confined/package-summary.html

Stefan Tauner

unread,
Jul 14, 2021, 8:40:03 AM7/14/21
to
On Wed, 05 Aug 2020 09:55:57 +0200 Matthijs Kooijman
<matt...@stdin.nl> wrote:
>
> If my analysis is correct, could you make the changes so
> ant-junitlauncher is included?

Hello,

the good news is, adding that module is not a big deal. I think I have
done that correctly. Even better, it gets rid of the specific error you
reported!

However, that does not make josm test successfully for me. I get
another message that could either mean I built ant-optional not
correctly or there is something weird going on in josm:

test:
[echo] Running unit tests with JUnit
[junitlauncher] Error: Could not find or load main class org.apache.tools.ant.taskdefs.optional.junitlauncher.StandaloneLauncher
[junitlauncher] Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.taskdefs.optional.junitlauncher.StandaloneLauncher

The documentation of StandaloneLauncher hints at it should not actually
be used externally. However, it is referenced in
JUnitLauncherTaskTest.java (which is part of the exposed/"confined"
classes) in a test... it's a bit weird.

Since there is some discussion about a newer ant release in some of the
josm tickets with similar problems I tried updating to the currently
available upstream releases (1.10.10 and 1.10.11) but it doesn't fix
that issue.

One of the devs pointed me to the CI configuration that builds on
Ubuntu. Maybe there is some hint in there but I dont see it...
https://github.com/openstreetmap/josm/blob/master/.github/workflows/ant.yml

I am out of ideas. At least it builds fine and is executable...

--
Kind regards/Mit freundlichen Grüßen, Stefan Tauner

Stefan Tauner

unread,
Jul 15, 2021, 6:00:03 AM7/15/21
to
Ok, got it. I missed some additional build requirements for Ant on
Junit5 if one wants to build junitlauncher completely and the whole
confined stuff threw me off.

Interestingly, junit5 is then not needed at runtime anymore - at least
not for how josm uses it. I have not tested other applications though.

I have made some additional useful changes but I do not intend to do a
NMU (yet) - it would be my first and I am not really confident that
this does not break anything - unless instructed to do so.
Feel free to copy any of it:
https://salsa.debian.org/stefanct/ant/-/commits/master

Stefan Tauner

unread,
Jul 10, 2022, 8:40:03 PM7/10/22
to
On Mon, 11 Jul 2022 00:06:35 +0000
Tony Mancill <nor...@salsa.debian.org> wrote:

> Control: tag -1 pending
>
> Hello,
>
> Bug #967933 in ant reported by you has been fixed in the
> Git repository and is awaiting an upload. You can see the commit
> message below and you can check the diff of the fix at:
>
> https://salsa.debian.org/java-team/ant/-/commit/b15414ef50d903860f6264e0b49d4658231aa3d5

Hi Tony,

thanks!
What do you think about the junit5 dependencies mentioned earlier that I
have included in my attempt
(https://salsa.debian.org/stefanct/ant/-/commit/3ca052c0b7a1c7300659a791ab18989af6fc25bd)?
I forgot about everything I did back then TBH though.

tony mancill

unread,
Jul 11, 2022, 12:50:03 AM7/11/22
to
Hello Stefan,
I think I should have read the information in the bug report more
carefully instead of merely focusing on the title... :)

Thank you for the pointer to your branch. I will prepare another upload
with a build-dep on junit5 and setting the build classpath.

Cheers,
tony
signature.asc
0 new messages