I solved this problem for the README.md file in the Git repository using the approach described in your question, which copies README.md from the root directory to ${baseDir}/src/site/markdown . I used maven-resources-plugin to copy the file. Instead of deleting the copied file after the site was created (to avoid SCM pollution) I added it to .gitignore as suggested by Bruno .
The following is a detailed description of the solution.
In the project.build.plugins of pom.xml :
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <executions> <execution> <id>copy-readme</id> <phase>pre-site</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${basedir}/src/site/markdown</outputDirectory> <resources> <resource> <directory>${basedir}</directory> <includes> <include>README.md</include> </includes> </resource> </resources> </configuration> </execution> </executions> </plugin>
In .gitignore :
# Copied from root to site source files by maven-resources-plugin /src/site/markdown/README.md
You can see the corresponding commit here .
Filip bΓ‘rtek
source share