简体   繁体   中英

How to get Cucumber-JVM to work with Gradle and Guice?

Cucumber-JVM and Gradle don't play along nicely. This is well known, and a workaround has existed for some time.

However, I can't get said workaround to work with some more advanced tests using Guice as a DI container: Cucumber does not pick up the Guice module configured in the properties file, and maybe doesn't even pick up the file itself, causing singletons to be configured multiple times.

My project conforms to standard layout ( src/test/java , src/test/resources ), with Cucumber's cucumber-guice.properties residing in the root of the resource folder. Inside my IDE of choice, IntelliJ IDEA, the tests run fine.

Do you know how to make this work?

我可以通过注解直接应用范围来解决问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM