问题
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