I'm using cucumber-jvm + jenkins to run my tests. My team added the surefire-plugin via maven and when we try to run our tests on Jenkins (using 'mvn test') we got the exception below ((File name too long)).
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] org.apache.maven.surefire.util.NestedRuntimeException: null; nested exception is org.apache.maven.surefire.report.ReporterException: Unable to create file for report: /*********/********/******/***********************/********/target/surefire-reports/| <155> | <13;72579b9ae7f844fc9b9ded4b62d3e085;26592;I> | <{"idtTransaction":"1393174","idtInscriptionAccount":"50928278","numPaymentReceipt":"1","idtApplication":"155","numPaymentValue":"2.00","datTransaction":""}> | <HAGASUHUSAHUSAGDUFASUGIKH> | <13> |.txt (File name too long); nested exception is java.io.FileNotFoundException: /opt/jenkins/jobs/test-aff-prepaid-importer-aqa/workspace/target/surefire-reports/| <155> | <13;72579b9ae7f844fc9b9ded4b62d3e085;26592;I> | <{"idt*****":"1393174","idt*****":"50928278","num******":"1","idt******":"155","num******":"2.00","dat*******":""}> | <HAGASUHUSAHUSAGDUFASUGIKH> | <13> |.txt (File name too long)
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.RuntimeException: org.apache.maven.surefire.util.NestedRuntimeException: null; nested exception is org.apache.maven.surefire.report.ReporterException: Unable to create file for report: /opt/jenkins/jobs/test-aff-prepaid-importer-aqa/workspace/target/surefire-reports/| <155> | <13;72579b9ae7f844fc9b9ded4b62d3e085;26592;I> | <{"idt*****":"1393174","idt******":"50928278","num*****":"1","idt******":"155","num********":"2.00","dat*******":""}> | <HAGASUHUSAHUSAGDUFASUGIKH> | <13> |.txt (File name too long); nested exception is java.io.FileNotFoundException: /****/********/******/***********************/workspace/target/surefire-reports/| <155> | <13;72579b9ae7f844fc9b9ded4b62d3e085;26592;I> | <{"idt*******":"1393174","idt********":"50928278","num*********":"1","idt***********":"155","num************":"2.00","datTransaction":""}> | <HAGASUHUSAHUSAGDUFASUGIKH> | <13> |.txt (File name too long)
at org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer.close(ThreadedStreamConsumer.java:123)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:463)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:352)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:158)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:883)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:747)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:645)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.surefire.util.NestedRuntimeException: null; nested exception is org.apache.maven.surefire.report.ReporterException: Unable to create file for report: /****/******/******/************************/workspace/target/surefire-reports/| <155> | <13;72579b9ae7f844fc9b9ded4b62d3e085;26592;I> | <{"idt*******":"1393174","idt**********":"50928278","num*************":"1","idt*******":"155","num*******":"2.00","dat*******":""}> | <HAGASUHUSAHUSAGDUFASUGIKH> | <13> |.txt (File name too long); nested exception is java.io.FileNotFoundException: /*****/*******/******/***********************/workspace/target/surefire-reports/| <155> | <13;72579b9ae7f844fc9b9ded4b62d3e085;26592;I> | <{"idt******":"1393174","idt***********":"50928278","num**************":"1","idt**********":"155","num********":"2.00","dat*********":""}> | <HAGASUHUSAHUSAGDUFASUGIKH> | <13> |.txt (File name too long)
at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:172)
at org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:67)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.maven.surefire.report.ReporterException: Unable to create file for report: /****/*****/*****/*****************/***********/target/surefire-reports/| <155> | <13;72579b9ae7f844fc9b9ded4b62d3e085;26592;I> | <{"idt********":"1393174","idt***********":"50928278","num********":"1","idt********":"155","num*******":"2.00","dat************":""}> | <HAGASUHUSAHUSAGDUFASUGIKH> | <13> |.txt (File name too long); nested exception is java.io.FileNotFoundException: /******/******/*****/*******************/workspace/target/surefire-reports/| <155> | <13;72579b9ae7f844fc9b9ded4b62d3e085;26592;I> | <{"idt*******":"1393174","idt************":"50928278","num***********":"1","idt********":"155","num*********":"2.00","dat********":""}> | <HAGASUHUSAHUSAGDUFASUGIKH> | <13> |.txt (File name too long)
at org.apache.maven.plugin.surefire.report.FileReporter.testSetStarting(FileReporter.java:83)
at org.apache.maven.plugin.surefire.report.FileReporter.testSetCompleted(FileReporter.java:108)
at org.apache.maven.plugin.surefire.report.TestSetRunListener.testSetCompleted(TestSetRunListener.java:141)
at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.consumeLine(ForkClient.java:105)
... 2 more
Caused by: java.io.FileNotFoundException: /****/******/******/************/workspace/target/surefire-reports/| <155> | <13;72579b9ae7f844fc9b9ded4b62d3e085;26592;I> | <{"idt****":"1393174","idt*********":"50928278","num********":"1","idt*****":"155","num******":"2.00","dat*******":""}> | <HAGASUHUSAHUSAGDUFASUGIKH> | <13> |.txt (File name too long)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
at java.io.FileWriter.<init>(FileWriter.java:73)
at org.apache.maven.plugin.surefire.report.FileReporter.testSetStarting(FileReporter.java:71)
... 5 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 59 seconds
[INFO] Finished at: Mon Oct 07 15:31:16 BRT 2013
[INFO] Final Memory: 37M/247M
[INFO] ------------------------------------------------------------------------
Build step 'Execute shell' marked build as failure
Finished: FAILURE