title: How to create dynamic glue in cucumber java based on the feature file location?
body: <p>I am having a java project which is built using maven. </p>
  
  <p>I have multiple packages,feature files based on different functionalities. The project test structure is as below. </p>
  
  <pre><code>src
    -&gt;test
      -&gt;java
        -&gt;com
          -&gt;usercreation
            TestStepDef.java
          -&gt;uservalidation
            TestStepDef.java
     -&gt;resources
          -&gt;usercreation
             usercreation.feature
          -&gt;uservaliation
             uservalidatin.feature
  </code></pre>
  
  <p>I have only one RunCukesTest.java file</p>
  
  <pre><code>@RunWith(Cucumber.class)
  @CucumberOptions(format = { "html:target/cucumber-html-report",
                          "json:target/cucumber-json-report.json" }, 
                          features = "src/test/resources/",
                          glue = "??????",
                          tags = {"~@ignore"}
              )
   public class RunCukesTest {
  
   }
  </code></pre>
  
  <p>In this case it runs all my feature files. But it is not able to find my specific Step definitions for the feature. So I have to give the glue option as "com.usercreation". But if I do so when it runs the uservalidation feature file it will not be able to pick up the appropriate step definition.  In my use case I don't want both the step def file to be in the same package, as they have many steps with different functionalities.</p>
  
  <p>Is there a possible way where I can give the glue option dynamically based on the  package name the feature file is running. Or am I missing any other approach to this project. </p>