title: Why does jbehave-maven-plugin give me a NoClassDefFoundError?
body: <p>I get the following error when I run <code>mvn integration-test -e com.example.mymodule</code>:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.jbehave:jbehave-maven-plugin:3.9.5:run-stories-as-embeddables (embeddable-stories) on project com.example.mymodule: Failed to run stories as embeddables: Failure in running embeddable: com.example.mymodule.TheStories: Could not initialize class freemarker.ext.beans.BeansWrapper -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jbehave:jbehave-maven-plugin:3.9.5:run-stories-as-embeddables (embeddable-stories) on project com.example.mymodule: Failed to run stories as embeddables
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  Caused by: org.apache.maven.plugin.MojoFailureException: Failed to run stories as embeddables
      at org.jbehave.mojo.RunStoriesAsEmbeddables.execute(RunStoriesAsEmbeddables.java:20)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
      ... 19 more
  Caused by: org.jbehave.core.embedder.Embedder$RunningEmbeddablesFailed: Failure in running embeddable: com.example.mymodule.TheStories
      at org.jbehave.core.embedder.Embedder.runAsEmbeddables(Embedder.java:130)
      at org.jbehave.mojo.RunStoriesAsEmbeddables.execute(RunStoriesAsEmbeddables.java:18)
      ... 21 more
  Caused by: java.lang.NoClassDefFoundError: Could not initialize class freemarker.ext.beans.BeansWrapper
      at freemarker.template.ObjectWrapper.&lt;clinit&gt;(ObjectWrapper.java:69)
      at freemarker.core.Configurable.&lt;init&gt;(Configurable.java:139)
      at freemarker.template.Configuration.&lt;init&gt;(Configuration.java:142)
      at freemarker.template.Configuration.&lt;clinit&gt;(Configuration.java:127)
      at org.jbehave.core.reporters.FreemarkerProcessor.configuration(FreemarkerProcessor.java:30)
      at org.jbehave.core.reporters.FreemarkerProcessor.process(FreemarkerProcessor.java:21)
      at org.jbehave.core.reporters.TemplateableViewGenerator.write(TemplateableViewGenerator.java:267)
      at org.jbehave.core.reporters.TemplateableViewGenerator.createReports(TemplateableViewGenerator.java:219)
      at org.jbehave.core.reporters.TemplateableViewGenerator.generateReportsView(TemplateableViewGenerator.java:110)
      at org.jbehave.core.embedder.Embedder.generateReportsView(Embedder.java:249)
      at org.jbehave.core.embedder.Embedder.generateReportsView(Embedder.java:237)
      at org.jbehave.core.embedder.Embedder.runStoriesAsPaths(Embedder.java:213)
      at org.jbehave.core.junit.JUnitStories.run(JUnitStories.java:20)
      at org.jbehave.core.embedder.Embedder.runAsEmbeddables(Embedder.java:121)
      ... 22 more
  </code></pre>
  
  <p>When I run <code>mvn dependency:tree -pl com.example.mymodule | grep freemarker</code> I get</p>
  
  <pre><code>[INFO] |  +- org.freemarker:freemarker:jar:2.3.19:compile
  </code></pre>
  
  <p>I used <code>javap</code> to confirm that the class <code>freemarker.ext.beans.BeansWrapper</code> exists in this jar:</p>
  
  <pre><code>javap -classpath C:\Users\CONOR2\.m2\repository\org\freemarker\freemarker\2.3.19\freemarker-2.3.19.jar freemarker.ext.beans.BeansWrapper
  </code></pre>
  
  <p>Here's the relevant portion of my depdendencies from my pom.xml:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.jbehave&lt;/groupId&gt;
      &lt;artifactId&gt;jbehave-core&lt;/artifactId&gt;
      &lt;version&gt;3.9.5&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.jbehave&lt;/groupId&gt;
      &lt;artifactId&gt;jbehave-core&lt;/artifactId&gt;
      &lt;version&gt;3.9.5&lt;/version&gt;
      &lt;classifier&gt;resources&lt;/classifier&gt;
      &lt;type&gt;zip&lt;/type&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.jbehave.site&lt;/groupId&gt;
      &lt;artifactId&gt;jbehave-site-resources&lt;/artifactId&gt;
      &lt;version&gt;3.2&lt;/version&gt;
      &lt;type&gt;zip&lt;/type&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Here's my plugin section:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.jbehave&lt;/groupId&gt;
      &lt;artifactId&gt;jbehave-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;3.9.5&lt;/version&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;unpack-view-resources&lt;/id&gt;
              &lt;phase&gt;process-resources&lt;/phase&gt;
              &lt;goals&gt;
                  &lt;goal&gt;unpack-view-resources&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
          &lt;execution&gt;
              &lt;id&gt;embeddable-stories&lt;/id&gt;
              &lt;phase&gt;integration-test&lt;/phase&gt;
              &lt;configuration&gt;
                  &lt;includes&gt;
                      &lt;include&gt;com/example/mymodule/TheStories.java&lt;/include&gt;
                  &lt;/includes&gt;
                  &lt;excludes /&gt;
                  &lt;ignoreFailureInStories&gt;true&lt;/ignoreFailureInStories&gt;
                  &lt;ignoreFailureInView&gt;false&lt;/ignoreFailureInView&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
                  &lt;threads&gt;1&lt;/threads&gt;
                  &lt;metaFilters&gt;
                      &lt;metaFilter&gt;&lt;/metaFilter&gt;
                  &lt;/metaFilters&gt;
              &lt;/configuration&gt;
              &lt;goals&gt;
                  &lt;goal&gt;run-stories-as-embeddables&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>I tried this with versions 3.9.5 and 4.0.3, but I get the same error with both versions.</p>