gpt4 book ai didi

maven - 在 JShell 中,如何从 Maven 项目导入类路径

转载 作者:行者123 更新时间:2023-12-03 22:59:36 30 4
gpt4 key购买 nike

我有一个正在开发的本地 Maven 项目。如何启动 jshell使用包含所有依赖项的项目类路径,以便我可以在 JShell 中测试项目或依赖项类。

最佳答案

您可以使用 jshell-maven-plugin:

mvn com.github.johnpoth:jshell-maven-plugin:1.3:run

这将使用您的项目的运行时路径启动 JShell session 。如果要包含测试依赖项,只需将 -DtestClasspath 添加到命令中。

注意:该插件期望项目已经构建。如果没有,请在插件之前调用适当的 Maven 构建阶段,例如:
mvn [install|compile|test-compile] com.github.johnpoth:jshell-maven-plugin:1.3:run

源代码: https://github.com/johnpoth/jshell-maven-plugin ;欢迎贡献:) 完全免责声明:我编写了插件。

享受!

关于maven - 在 JShell 中,如何从 Maven 项目导入类路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47705036/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com