after running the JUnit tests, I use the Maven Surefire Report plugin (http://maven.apache.org/plugins/maven-surefire-report-plugin/) to create an HTML test report. This results in the following file:
./target/site/surefire-report.html
I know that for creating PDF files there is a Maven PDF plugin (http://maven.apache.org/plugins/maven-pdf-plugin/surefire-report.html). But I can't get it to work. I included it in my pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pdf-plugin</artifactId>
<executions>
<execution>
<id>pdf</id>
<phase>test</phase>
<goals>
<goal>pdf</goal>
</goals>
<configuration>
<outputDirectory>/tmp</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
When I try to start it, I get an error that some source directory does not exist:
...
[mvn] [INFO] [pdf:pdf {execution: default-cli}]
[mvn] [INFO] ------------------------------------------------------------------------
[mvn] [INFO] Building VB Common
[mvn] [INFO] task-segment: [pdf:pdf]
[mvn] [INFO] ------------------------------------------------------------------------
[mvn] [INFO] [pdf:pdf {execution: default-cli}]
[mvn] [INFO] ------------------------------------------------------------------------
[mvn] [ERROR] BUILD ERROR
[mvn] [INFO] ------------------------------------------------------------------------
[mvn] [INFO] Error during document generation: Source directory doesn't exists (/home/user/myproject/src/site).
[mvn]
...
The error is not so surprising as I do not have a folder. / src / site. But how can I customize the PDF plugin so that it takes my HTML report from. / target / site / surefire -report.html as the source file for the PDF?