Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 1.1 KB

README.md

File metadata and controls

17 lines (13 loc) · 1.1 KB

Cucumber for Java Annotation Indexer

Cucumber for Java requires that you specify the packages in which your step definitions exist. At runtime, cucumber uses some hack to try to list all the classes in this package, loads them one by one, and finds those that have step definition annotations like @When and @Then. This is both poor user experience (Can't you just find my step definitions!?) and poor performance.

This library offers a much better alternative. It uses annotation indexer to create an index of step definitions and hooks at compile time. Thanks to JSR-269, this happens automatically on Java6 and later. With the index in /META-INF/annotations, runtime can load all the step definitions quite efficiently.

This library contains BetterJavaBackend implementation, which replaces sthe standard JavaBackend.

Put this jar in your dependency instead of cucumber-java, and Cucumber should find this backend automatically.