how to create executable jar file with cucumber tests?

好久不见. 提交于 2019-12-25 16:09:56

问题


My service create an executable jar by gradle. When i create and run my jar (java -jar file.jar) i recive error:

no main manifest attribute, in "file.jar"

because i don't have main_class.

I created main method:

public static void main(final String[] args) throws Throwable {
String[] arguments = {"--plugin", "html:build/reports/cucumber", "src/test/resources/features", "--glue", "src/test/java/steps"};
cucumber.api.cli.Main.main(arguments);

}

and My program founds the features but doesn't found glue code.

Could someone help me with this problem? Thank you in advance.


回答1:


The value for the glue option should be a java classpath. And the feature files should be the last option.

{"--plugin", "html:build/reports/cucumber", "--glue", "steps", "src/test/resources/features"}


来源:https://stackoverflow.com/questions/45128988/how-to-create-executable-jar-file-with-cucumber-tests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!