Github Mavenized
03 Apr 2010Maven projects can use the github pages feature to publish the project site and setup a repository in Github. There is a nice post which describes how to create a new maven project in github. I am not going to repeat that.
After setting up your project, create gh-pages branch for your project.
Drop the following element in the pom.xml file This will instruct maven to deploy the site and the artifacts in the temp folder outside the root folder.
I am using a rake task to automate the release. Create a file named rakefile.rb in the project root folder and drop the following snippet in it. To run this you need the git 1.7.
Now you are ready to release the project in Github. The only thing you
have to do is instead of calling mvn release:perform
run the
release
task. To perform a release run the following commands.
I have created a demo project in Github. You can see the project site generated by maven here. The repository can be accessed at the following url http://ananthakumaran.github.com/maven-demo/maven2. Although maven provides lot of features, it sucks when we try to write a custom tasks. It is very easy to convert the above rake task to shell script. I hope this will help someone.