When trying to publish my open source projects to gh-pages with
mvn site
there have been lots of obstacles recently due to changes in the way maven and github pages works.
After studying
- https://help.github.com/articles/creating-project-pages-using-the-command-line/
- https://maven.apache.org/plugins/maven-site-plugin/
- https://help.github.com/articles/configuring-a-publishing-source-for-github-pages/
Here are some of the needed prerequisites i found and issues i ran into:
prerequisites
- git branch needs to show a gh-pages branch e.g. after using the commands in https://gist.github.com/ramnathv/2227408
- the version of the maven-site-plugin and the maven-project-info-reports-plugin have to be correct and correctly configured: maven-site plugins 3.3 java.lang.ClassNotFoundException: org.apache.maven.doxia.siterenderer.DocumentContent
- dependency.locations.enabled property needs to be false Why am I getting Maven error: "Unable to determine if resource X exists in http://maven.glassfish.org/content/groups/glassfish"?
issues
- How to force GitHub Pages build?
- Maven: Report plugin org.apache.maven.plugins:maven-project-info-reports-plugin has an empty version
- Maven: What is pluginManagement?
- Multi module POM - creating a site that works
- Struggling with Maven parent/child plugin configuration inheritance
not even mentioning work arounds i have to use for ssh-wagon and Java8 javadoc and others
The plugins used are IMHO a "moving target". Something that worked a few months ago in my experience will not work today. So I keep fixing my pom.xml files to keep up and the files grow longer and longer.
See e.g. https://github.com/BITPlan/com.bitplan.simplerest/blob/master/pom.xml
For my internal projects I use a parent pom to make sure that the projects have a common configuration. For the open source projects I did not find a way to use a parent pom for a group of projects yet.
I would like to make sure that a working configuration that i found is "transferred" to other configurations. I am thinking e.g. of
- a script that might check the configuration
- some kind of inheritance mechanism like the parent pom
I assume this is a pretty common problem and there are experiences by SO users on how to tackle this issue accross different project.
What would be a good approach and what tools would be useful?
- parent pom with pom packaging What is "pom" packaging in maven? mostly states the use of pom packaging for multi-module projects but it looks it could be used to have a reference for a parent pom. The parentPath defaults to .. see Maven: Non-resolvable parent POM. The overriding of configurations is explained in Maven : Is it possible to override the configuration of a plugin already defined for a profile in a parent POM
Examples for moving targets
- Java8 silly javadoc settings