如何从命令行执行Cucumber Spring Boot Packaged Jar? [英] How to execute Cucumber Spring Boot Packaged Jar from command line?
问题描述
我对cucumber-jvm世界还很陌生。尝试将黄瓜弹簧启动应用程序打包为Jar。应用程序在Eclipse上运行良好。但是当我将其打包为可执行jar时,它失败并出现Exception:
I am fairly new to cucumber-jvm world. Trying to package cucumber spring boot app as Jar. app runs fine from Eclipse. But when I package as executable jar it fails with Exception :
主线程中的异常,没有找到后端模块。确保在CLASSPATH上具有后端模块。请帮助。谢谢。
Exception in Main Thread, No backend Module found. Make sure that you have backend module on CLASSPATH. Kindly help. Thank you.
推荐答案
来自: https://github.com/cucumber/cucumber-jvm/issues/1320
SpringBoot使用嵌套需要使用 ApplicationContext.getResources
进行透明访问的jar结构。您必须创建自己的Cucumber运行时实例,并为它提供使用 ApplicationContext
的类加载器和资源加载器。
SpringBoot uses a nested jar structure that requires the use of ApplicationContext.getResources
to access it transparently. You'll have to create your own instance of the Cucumber runtime and provide it a class loader and resource loader that use the ApplicationContext
.
这篇关于如何从命令行执行Cucumber Spring Boot Packaged Jar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!