[ https://jira.codehaus.org/browse/SUREFIRE-999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=325904#comment-325904 ]
Mirko Friedenhagen commented on SUREFIRE-999: --------------------------------------------- Kristian, I replied to this on github, but the comment is now gone because I did a push --force, sorry. I now included a description in the commit: https://github.com/mfriedenhagen/maven-surefire/commit/7a8ad1f0f5cc7d07d1fd811943cc58d96efa371e {quote} Let `SurefireReportOnlyMojo` be a child of `AbstractSurefireReportMojo` to avoid execution of phase validate. Because Surefire uses doclet annotations and there is no way to specify a phase `@execute phase="none"`, `SurefireReportOnlyMojo` would inherit the execution of phase `test` from `SurefireReportMojo`. Alternatives to `SurefireReportOnlyMojo` extending from `AbstractSurefireReportMojo` and duplicating setters etc.: * Introduce another abstract class between `AbstractSurefireReportMojo` and `SurefireReportMojo` which defines the setters etc. and let both `SurefireReportMojo` and `SurefireReportOnlyMojo` extend this, only defining different goal-names and only `SurefireReportMojo` define `@execute`. * Switch to Java annotations instead of doclet annotations. Both approaches would have had a much bigger risk of introducing incompatibilities. {quote} > Skip phase `validate` during site-generation for `report-only` resp. > `failsafe-report-only` > -------------------------------------------------------------------------------------------- > > Key: SUREFIRE-999 > URL: https://jira.codehaus.org/browse/SUREFIRE-999 > Project: Maven Surefire > Issue Type: Bug > Components: Maven Surefire Report Plugin > Affects Versions: 2.14.1, 2.15 > Reporter: Mirko Friedenhagen > > * We have a lot of projects in our CI system (Jenkins) where we run {{mvn > clean deploy site-deploy}}. > * Because of this, we do not repeat test execution again during phase > {{site}} by defining the {{reportSet}} to include {{report-only}}. > * However, {{report-only}} does invoke the phase {{validate}} again which > will execute some lengthy {{enforcer}} checks. > * I created a clone of {{maven-surefire}} where I did redefine > {{report-only}} to not fork the lifecyle and have a small integration-test > project > https://github.com/mfriedenhagen/pastebin/tree/surefire-reportonly-test which > will show the issue: > * Running {{mvn -e}} will produce the following output: > {code} > [INFO] --- maven-site-plugin:3.0:site (default-site) @ > surefire-reportonly-test --- > [INFO] configuring report plugin org.apache.maven.plugins:maven-jxr-plugin:2.3 > [INFO] configuring report plugin > org.apache.maven.plugins:maven-surefire-report-plugin:2.14.1 > [INFO] > [INFO] >>> maven-surefire-report-plugin:2.14.1:report-only > (report:report-only) @ surefire-reportonly-test >>> > [INFO] > [INFO] <<< maven-surefire-report-plugin:2.14.1:report-only > (report:report-only) @ surefire-reportonly-test <<< > [INFO] > [INFO] >>> maven-surefire-report-plugin:2.14.1:failsafe-report-only > (report:failsafe-report-only) @ surefire-reportonly-test >>> > [INFO] > [INFO] <<< maven-surefire-report-plugin:2.14.1:failsafe-report-only > (report:failsafe-report-only) @ surefire-reportonly-test <<< > [INFO] Relativizing decoration links with respect to project URL: > https://github.com/mfriedenhagen/pastebin > {code} > * When running {{mvn -e -Dmaven-surefire-plugin.version=2.15-SNAPSHOT}} the > following output will be produced: > {code} > [INFO] --- maven-site-plugin:3.0:site (default-site) @ > surefire-reportonly-test --- > [INFO] configuring report plugin org.apache.maven.plugins:maven-jxr-plugin:2.3 > [INFO] configuring report plugin > org.apache.maven.plugins:maven-surefire-report-plugin:2.15-SNAPSHOT > [INFO] Relativizing decoration links with respect to project URL: > https://github.com/mfriedenhagen/pastebin > [INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 > skin. > [INFO] Skipped "Test Source Xref" report, file "xref-test/index.html" already > exists for the English version. > [INFO] Generating "Test Source Xref" report --- maven-jxr-plugin:2.3 > [INFO] Generating "Surefire Report" report --- > maven-surefire-report-plugin:2.15-SNAPSHOT > [INFO] Generating "Failsafe Report" report --- > maven-surefire-report-plugin:2.15-SNAPSHOT > [INFO] > ------------------------------------------------------------------------ > {code} > I will include the pull request in a comment. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira