The GitHub Pages Maven plugin pushes resources, namely JavaDocs, to a GitHub repository automatically. This is useful for keeping your GitHub Pages up to date. While this plugin was designed to push API documentation, it can be re-purposed to automatically push anything to a repository branch.
Walker Crouse is an aspiring software engineer, amateur open source contributor, and starving college student. If you like my work, please consider donating a small amount so that I can continue to give these projects the time they deserve. Thank you.
- Run
mvn archetype:generate \
-DarchetypeGroupId=se.walkercrou \
-DarchetypeArtifactId=ghp-maven-archetype \
-DarchetypeVersion=1.0 \
-DgroupId=com.example \
-DartifactId=hello-world
-
Develop, Document, Repeat!
-
Run
mvn -P release
and watch your documentation update online!
The following is a table of available parameters for this plugin
Name | Description | Default | Required |
---|---|---|---|
branch |
The branch to push content in contentDir to |
gh-pages |
No |
commitMessage |
The commit message to use when updating remote | ... |
No |
contentDir |
The directory to copy files from | apidocs |
No |
contentDestination |
The directory to copy files to from the contentDir |
root | No |
Run this plugin on your project alone with
mvn ghp:update \
-Dbranch=my-branch \
-DcommitMessage="Custom commit message" \
-DcontentDir=my-content \
-DcontentDestination=docs \
The following is a standard configuration for this plugin
<configuration>
<branch>my-branch</branch>
<commitMessage>Custom commit message</commitMessage>
<contentDir>my-content</contentDir>
<contentDestination>docs</contentDestination>
</configuration>