title: Glue code is not loaded when running with cucumber-spring back-end from jar file
body: <p>I have been trying to get spring-based cucumber tests to run using a combination of Junit(4.12), Cucumber-Java(4.1.1), Cucumber-Spring(4.1.1) and Cucumber-Junit(4.1.1).
  I have no issues loading glue code when running the tests from inside the IDE (IntelliJ 2018.3.4) but it seems that for some reason when I try running from the a compiled jar file (which is a requirement in this case) cucumber doesn't find the step definitions. </p>
  
  <p>I've already tried multiple glue code formats such as:
      "classpath:com.a.b.c.stepdefs"
      "com.a.b.c.stepdefs"
      "classpath:com/a/b/c/stepdefs"</p>
  
  <p>I've also tried providing relative paths from the runner class up to the step definitions class (nested just one level below)
  "stepdefs"</p>
  
  <p>Also gave a try running using both JUnit and the cucumber.cli.Main and attempted to use different style of step definitions (both cucumber expression - which the missing step snippets are pointing me to - and regex)</p>
  
  <p>I am using the spring-boot-maven-plugin so I am aware that that generally changes the jar structure</p>
  
  <p>All of the above variations fully work when running from the IDE, but not from the jar file</p>
  
  <p>Main Class:</p>
  
  <pre><code>@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
  @ComponentScan(basePackages = {"com.a.b.test.core.data",
      "com.a.b.c",
      "com.a.b.c.stepdefs"}
  )
  public class CucumberApplication {
  
      public static void main(String[] args) throws IOException, InterruptedException {
  
          SpringApplication.run(CucumberApplication.class, args);
  
          Result result = JUnitCore.runClasses(RunnerCentral.class);
          System.exit(result.wasSuccessful() ? 0 : 1);
  
      }
  }
  </code></pre>
  
  <p>Runner Class:</p>
  
  <pre><code>package com.a.b.c;
  
  @RunWith(Cucumber.class)
  @CucumberOptions(features = "classpath:BOOT-INF/classes/features",
  glue = "classpath:com/a/b/c/stepdefs",
  plugin = "json:target/cucumber-html-reports/cucumber.json")
  public class RunnerCentral {
  }
  </code></pre>
  
  <p>POM config of spring-boot-maven-plugin:</p>
  
  <pre><code>  &lt;plugin&gt;
       &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
       &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
       &lt;version&gt;2.1.0.RELEASE&lt;/version&gt;
           &lt;configuration&gt;
               &lt;fork&gt;true&lt;/fork&gt;
               &lt;mainClass&gt;${start-class}&lt;/mainClass&gt;
               &lt;requiresUnpack&gt;
                   &lt;dependency&gt;
                       &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
                       &lt;artifactId&gt;cucumber-java&lt;/artifactId&gt;
                   &lt;/dependency&gt;
                   &lt;dependency&gt;
                       &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
                       &lt;artifactId&gt;cucumber-spring&lt;/artifactId&gt;
                   &lt;/dependency&gt;
                   &lt;dependency&gt;
                       &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
                       &lt;artifactId&gt;cucumber-junit&lt;/artifactId&gt;
                   &lt;/dependency&gt;
               &lt;/requiresUnpack&gt;
           &lt;/configuration&gt;
           &lt;executions&gt;
               &lt;execution&gt;
                   &lt;goals&gt;
                       &lt;goal&gt;repackage&lt;/goal&gt;
                   &lt;/goals&gt;
               &lt;/execution&gt;
           &lt;/executions&gt;
       &lt;/plugin&gt; 
  </code></pre>
  
  <p>I am expecting the behavior to be consistent between running from IDE and running from a packaged source although I may be missing something</p>
  
  <p>Another thing I want to mention is that when swapping the backend with cucumber-picocontainer everything seems to work (spring is a requirement so a swap isn't possible)</p>