I complained about this on the maven-users list (before I stumbled upon this ticket...): http://www.mail-archive.com/users@maven.apache.org/msg105588.html.
But contrary to the ticket's title, I don't think that Maven plugins have be smart enough to detect the kind of
packaging used.
In fact, the more I think about it, the more I come to the conclusion that making a plugin's behavior depend on the project's packaging is a bad idea; this would turn the project's packaging into a (non-obvious) flag.
What would solve the problem nicely, though, is better communication between the maven-surefire-plugin and the maven-surefire-report-plugin: All that is required is for the former to generate its surefire-reports even if no unit tests were found. Then the maven-surefire-report-plugin could decide, based on the presence or absence of the surefire-reports whether to add its "Surefire Report" or not. (When the packaging is "pom" surefire:test is not bound to the lifecycle; no surefire-reports and thus no "Surefire Report" will be generated.)
This would require some kind of coordinate effort by the maven-surefire-plugin and the maven-surefire-report-plugin, but would IMHO be the cleanest solution.
I complained about this on the maven-users list (before I stumbled upon this ticket...): http://www.mail-archive.com/users@maven.apache.org/msg105588.html.
But contrary to the ticket's title, I don't think that Maven plugins have be smart enough to detect the kind of
packaging used.
This would require some kind of coordinate effort by the maven-surefire-plugin and the maven-surefire-report-plugin, but would IMHO be the cleanest solution.