donatellosantoro commented on issue #7819:
URL: https://github.com/apache/netbeans/issues/7819#issuecomment-6345198244
Still reproducible on Apache NetBeans 31, macOS, JDK 23.0.2 (GraalVM CE).
Steps: Java with Ant project → Project Properties → Libraries → Compile
Tests → add the bundled "JUnit 5.10.3" library → Run Test File on any Jupiter
test:
executor-snippets/junit.xml:184: The following error occurred while
executing this line:
executor-snippets/junit.xml:128: The <classpath> or <modulepath> for
<junit> must include junit.jar if not in Ant's own classpath
Root cause, as far as I can tell: both the generated
`nbproject/build-impl.xml` (`-init-macrodef-junit-single` / `-batch`) and the
Compile-on-Save snippet `executor-snippets/junit.xml` run tests with the legacy
Ant `<junit>` task, which only supports JUnit 3/4 and requires `junit.jar`.
Nothing uses `<junitlauncher>`, so the JUnit 5 library that the IDE offers (and
that the "Create Tests" wizard picks by default) can never run in an Ant
project. Disabling Compile on Save doesn't help, because build-impl.xml has the
same problem.
Swapping in JUnit 4.13.2 + Hamcrest 1.3 works.
Possible fixes: generate `<junitlauncher>`-based targets when the JUnit 5
library is on the test classpath (the bundled Ant is ≥ 1.10.3), or at least
stop offering/defaulting to JUnit 5 for Ant projects.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists