Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Indeed, generating the whole site at each build is clearly not an option. But the problem is that <code>mvn surefire-report:report-only</code> doesn't create the the css/*.css files, hence the ugly result. This is logged in <a href="https://issues.apache.org/jira/browse/SUREFIRE-616" rel="noreferrer">SUREFIRE-616</a> (doesn't mean something will happen though). Personally, I don't use HTML reports that much so I can live with that but that's not a good answer so here is a workaround based on the ant task (*sigh*):</p> <pre><code> &lt;plugin&gt; &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;test-reports&lt;/id&gt; &lt;phase&gt;test&lt;/phase&gt; &lt;configuration&gt; &lt;tasks&gt; &lt;junitreport todir="target/surefire-reports"&gt; &lt;fileset dir="target/surefire-reports"&gt; &lt;include name="**/*.xml"/&gt; &lt;/fileset&gt; &lt;report format="noframes" todir="target/surefire-reports"/&gt; &lt;/junitreport&gt; &lt;/tasks&gt; &lt;/configuration&gt; &lt;goals&gt; &lt;goal&gt;run&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;ant&lt;/groupId&gt; &lt;artifactId&gt;ant-junit&lt;/artifactId&gt; &lt;version&gt;1.6.2&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/plugin&gt; </code></pre> <p><strong>Update:</strong> My initial idea was to run the Maven AntRun plugin "on demand" to generate the reports... but that's not what I posted, I bound it to the <code>test</code> phase... But I didn't think about the case of failed tests (that would stop the build and prevent the execution of the AntRun plugin). So, either:</p> <ol> <li><p>Don't bind the AntRun plugin to the <code>test</code> phase, move the configuration outside the <code>execution</code> and call <code>mvn antrun:run</code> on the command line to generate the reports when wanted. </p></li> <li><p>or use the <a href="http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#testFailureIgnore" rel="noreferrer"><code>testFailureIgnore</code></a> option of the test mojo and set it to true in the surefire plugin configuration:</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;testFailureIgnore&gt;true&lt;/testFailureIgnore&gt; &lt;/configuration&gt; &lt;/plugin&gt; </code></pre></li> <li><p>or set this expression from the command line using the -D parameter:</p> <pre><code>$ mvn test -Dmaven.test.failure.ignore=true </code></pre></li> </ol> <p>I think that Option #1 is the best option, you don't necessarily want to generate the reports (especially when the test passes) and generate them systematically may slow down the build on the long term. I'd generate them "on demand".</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload