title: Cucumber error when compiling HTML reports
body: <p>I'm using Cucumber for the Java implementation and after running my test suite on <strong>Jenkins</strong> I'm getting a <strong>Java heap space error</strong>. I've tried to raise the memory for the process but still get the error. I've also tried to raise the memory for the surefire and failsafe maven plugins but still doesn't work as the problem is not taking place during test/integration phases. </p>
  
  <p>It happens when <strong>compiling and generating the JSON reports</strong> but also sometimes when running the tests. Any clues about it?</p>
  
  <p>The error trace is:</p>
  
  <pre><code>[CucumberReportPublisher] Compiling Cucumber Html Reports ...
  [CucumberReportPublisher] copying all json files from slave: /apps/hudson/workspace/cbs-billing-web-nightly1/trunk/cbs-billing-web-qa-test/target/cucumberReport to master reports directory: /apps/hudson/jobs/cbs-billing-web-nightly1/builds/2014-05-15_02-01-24/cucumber-html-reports
  [CucumberReportPublisher] Found the following number of json files: 1
  [CucumberReportPublisher] 0. Found a json file: cucumber.json
  [CucumberReportPublisher] Generating HTML reports
  FATAL: Java heap space
  java.lang.OutOfMemoryError: Java heap space
  at java.util.Arrays.copyOf(Arrays.java:2882)
  at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
  at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
  at java.lang.StringBuffer.append(StringBuffer.java:224)
  at java.lang.StringBuffer.append(StringBuffer.java:284)
  at java.util.regex.Matcher.appendReplacement(Matcher.java:746)
  at java.util.regex.Matcher.replaceAll(Matcher.java:813)
  at java.lang.String.replaceAll(String.java:2189)
  at net.masterthought.cucumber.util.Util.U2U(Util.java:107)
  at net.masterthought.cucumber.ReportParser.parseJsonResults(ReportParser.java:30)
  at net.masterthought.cucumber.ReportParser.(ReportParser.java:18)
  at net.masterthought.cucumber.ReportBuilder.(ReportBuilder.java:65)
  at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:97)
  at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
  at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
  at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
  at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1030)
  at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:725)
  at hudson.model.Run.execute(Run.java:1695)
  at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519)
  at hudson.model.ResourceController.execute(ResourceController.java:88)
  at hudson.model.Executor.run(Executor.java:231)
  </code></pre>