I am trying to generate html reports for maven surefire and failsafe plugins.
It seems that surefire creates a html report by default, if somewhat lacking in formatting. So when I run mvn verify one is produced.
I’ve been looking around online for guidance about how to produce two reports in HTML that are nicely formatted and it seems that using mvn site is the way to go. My problem is that although two nice reports are generated, the command hangs for a while and then produces a stack trace.
My mvn reporting entries look like this:
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>2.20</version>
<configuration>
<skipSurefireReport>${skipSurefireReport}</skipSurefireReport>
<reportsDirectories>
<reportsDirectory>${basedir}/target/failsafe-reports</reportsDirectory>
</reportsDirectories>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>
</plugins>
</reporting>
I’m invoking the tests using mvn verify and then producing the reports using mvn site and am seeing this stacktrace:
[INFO] Generating "Dependency Management" report --- maven-project-
info-reports-plugin:2.9:dependency-management
[WARNING] Unable to create Maven project for org.springframework.data:spring-data-mongodb-log4j:pom:1.10.5.BUILD-SNAPSHOT from repository.
org.apache.maven.project.ProjectBuildingException: Error resolving project artifact: Could not find artifact org.springframework.data:spring-data-mongodb-log4j:pom:1.10.5.BUILD-SNAPSHOT for project org.springframework.data:spring-data-mongodb-log4j:pom:1.10.5.BUILD-SNAPSHOT
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:313)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:236)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromRepository(DefaultMavenProjectBuilder.java:251)
at org.apache.maven.report.projectinfo.dependencies.RepositoryUtils.getMavenProjectFromRepository(RepositoryUtils.java:298)
at org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer.getDependencyRow(DependencyManagementRenderer.java:260)
at org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer.renderDependenciesForScope(DependencyManagementRenderer.java:208)
at org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer.renderDependenciesForAllScopes(DependencyManagementRenderer.java:157)
at org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer.renderSectionProjectDependencies(DependencyManagementRenderer.java:150)
at org.apache.maven.report.projectinfo.dependencies.renderer.DependencyManagementRenderer.renderBody(DependencyManagementRenderer.java:136)
at org.apache.maven.reporting.AbstractMavenReportRenderer.render(AbstractMavenReportRenderer.java:83)
at org.apache.maven.report.projectinfo.DependencyManagementReport.executeReport(DependencyManagementReport.java:124)
at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:255)
at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:227)
at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:329)
at org.apache.maven.plugins.site.render.SiteMojo.renderLocale(SiteMojo.java:181)
at org.apache.maven.plugins.site.render.SiteMojo.execute(SiteMojo.java:135)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact org.springframework.data:spring-data-mongodb-log4j:pom:1.10.5.BUILD-SNAPSHOT
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:453)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:255)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:232)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:303)
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:302)
... 37 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.springframework.data:spring-data-mongodb-log4j:pom:1.10.5.BUILD-SNAPSHOT
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:443)
... 41 more
[INFO] Generating "About" report --- maven-project-info-reports-plugin:2.9:index
[INFO] Generating "Licenses" report --- maven-project-info-reports-plugin:2.9:license
[INFO] Generating "Plugin Management" report --- maven-project-info-reports-plugin:2.9:plugin-management
[INFO] Generating "Plugins" report --- maven-project-info-reports-plugin:2.9:plugins
[INFO] Generating "Team" report --- maven-project-info-reports-plugin:2.9:project-team
[INFO] Generating "Source Code Management" report --- maven-project-info-reports-plugin:2.9:scm
[INFO] Generating "Summary" report --- maven-project-info-reports-plugin:2.9:summary
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:55 min
[INFO] Finished at: 2017-09-04T11:31:35+01:00
[INFO] Final Memory: 63M/1575M
[INFO] ------------------------------------------------------------------------
Digging around online produces remarkably few references to this error message. Can anyone advise me on how to get around it?
I have tried adding the maven site plugin as well but without success and have now removed it again.
Despite the stack trace, the failsafe report I'm interested in is produced ok.
Cheers
Bradley
https://issues.apache.org/jira/browse/MPIR-374
solution:
export MAVEN_OPTS="$MAVEN_OPTS -Dorg.slf4j.simpleLogger.log.org.apache.maven.report.projectinfo=ERROR"