I am working on migrating existing build scripts (Ant) to a Maven pom. I can
run our suite of Junit tests, some of these fail because of the modified
environment. The xml/txt files are created in the arget/surefire-reports
folder without problems. However I get the following error when I try to
generate the HTML report:
E:\workspace\maven-build>mvn -e surefire-report:report-only
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'surefire-report'.
[INFO]
------------------------------------------------------------------------
...
[INFO] [surefire-report:report-only]
[WARNING] Unable to locate Test Source XRef to link to - DISABLED
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] An error has occurred in Maven Surefire Report report generation.
Embedded error: String index out of range: -1
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: An error has
occurred in Maven Surefire Report report generation
.
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav
a:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:224)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
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:324)
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.plugin.MojoExecutionException: An error has
occurred in Maven Surefire Report report generat
ion.
at
org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:79)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
... 16 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of
range: -1
at java.lang.String.substring(String.java:1444)
at
org.apache.maven.plugins.surefire.report.SurefireReportGenerator.getErrorLineNumber(SurefireReportGenerator.j
ava:612)
at
org.apache.maven.plugins.surefire.report.SurefireReportGenerator.constructFailureDetails(SurefireReportGenera
tor.java:579)
at
org.apache.maven.plugins.surefire.report.SurefireReportGenerator.doGenerateReport(SurefireReportGenerator.jav
a:103)
at
org.apache.maven.plugins.surefire.report.SurefireReportMojo.executeReport(SurefireReportMojo.java:181)
at
org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:98)
at
org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:73)
... 18 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Mon Jan 21 16:42:29 IST 2008
[INFO] Final Memory: 4M/9M
[INFO]
------------------------------------------------------------------------
I tried with version 2.3 of the SureFire plugin, and today with newer
version 2.4.
HTML reports are essential component of our build artifacts.
Has someone faced this issue before?
Could someone explain I could resolve this issue?
Thanks in advance,
--
View this message in context:
http://www.nabble.com/Error-when-running-surefire-report%3Areport-only-tp14996496s177p14996496.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]