1

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.

P.R.S
  • 33
  • 1
  • 8

1 Answers1

0

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"}
Grasshopper
  • 8,611
  • 2
  • 14
  • 30
  • When I added this code the program the program still does not find the code. `3 Steps (3 undefined)` – P.R.S Jul 16 '17 at 19:34
  • What happens when you run the class containing the above command directly, outside of the jar file? – Grasshopper Jul 17 '17 at 04:29
  • When I moved folder with all steps and runed class with main method the app found glue code and features. – P.R.S Jul 17 '17 at 12:00