0

I am trying to run .feature from java main application or say a spring boot application rather going through Junit approach. I am facing issues to run it from main. somehow i tried to run from main by using Main.main call in eclipse but when i packaged to in .jar or deployed to openshift it started throwing No backend module found exception. Could anyone of you please help me to find a way on it? I am using java8 and cucumber-java8 dependency

e.g

Main.main(new String[] { "-g", "com.test.helloworld", "C:\\Users\\<user.name>\\git1\\test-helloworld\\src\\main\\resources\\helloworld.feature" });

I would like to try this with plain java main class. In eclipse its able to execute without any hassles but when i tries in jar/openshift its unable to load feature or backend modules.

IMParasharG
  • 1,869
  • 1
  • 15
  • 26

1 Answers1

1

SpringBoot uses a nested jar structure that requires the use of ApplicationContext.getResources to access it transparently. As such you'll have to implement a resource loader for Cucumber that utilizes the application context.

See also:

M.P. Korstanje
  • 10,426
  • 3
  • 36
  • 58