我在使用JUnit 5.52时遇到了问题,当我添加测试类并尝试运行它时,我得到了下一条消息:The <classpath> or <modulepath> for <junit> must include junit.jar if not in Ant's own classpath BUILD FAILED (total time: 0 seconds)
我运行的是Apache NetBeans IDE 11.3,我通过删除JUnit 5并使用JUnit 4.12解决了这个问题,但由于大学的要求,我可能会使用5.52。
有什么想法如何解决它,仍然使用JUnit 5.52或任何JUnit 5库?
先谢谢你。
2条答案
按热度按时间ebdffaop1#
您可以在https://github.com/junit-team/junit5-samples/tree/main/junit5-jupiter-starter-maven中找到有关如何在Netbeans中运行Junit 5的示例代码
您必须在POM中执行两项操作:
这是我测试过的一种配置,它可以正常工作:
zlwx9yxi2#
似乎没有答案,降级到Junit4.12是唯一的解决方案。你也可以尝试手动重新安装jar库(我也试过)。