Using Maven2 projects at googlecode.com

googlecode.com offers a nice hosting platform for your open source projects. You get SCM (either subversion or mercurial), a wiki, a bug tracker and download facilities.

Here are a few tips to facilitate Maven2 project integration with it (subversion is used as I am not familiar with mercurial yet).

Subversion access configuration

Add those informations in your pom.xml

<scm>
<connection>scm:svn:http://my-project.googlecode.com/svn</connection>
<developerConnection>scm:svn:https://my-project.googlecode.com/svn</developerConnection>
<url>https://my-project.googlecode.com/svn</url>
</scm>

When accessing the subversion repository (for instance while using maven release:prepare and maven release:perform) you must provide googlecode username and password to maven, using command-line parameters

-Dusername=googlecode.username -Dpassword=googlecode.password

or by modifying your settings.xml file

<server>
<!-- Will be used for scm connection -->
<id>googlecode.com</id>
<username>googlecode.username</username>
<password>googlecode.password</password>
</server>

Your googlecode password can be found under source tab of your googlecode.com project website, click on ‘When prompted, enter your generated googlecode.com password.’.

Issue management configuration

Add those informations in your pom.xml

<issueManagement>
<system>Google Code</system>
<url>http://code.google.com/p/my-project/issues/list</url>
</issueManagement>

Repository on subversion configuration

You can rely on googlecode subversion to provide access to your maven artifacts.

Add those informations in your pom.xml

<distributionManagement>
<repository>
<id>my-project-release</id>
<url>dav:https://my-project.googlecode.com/svn/maven2/releases</url>
</repository>
</distributionManagement>

An alternative would be to rely on the subversion wagon implementation as described here.

You will also need to modify your settings.xml file to provide googlecode.com credentials.

<server>
<id>my-project-release</id>
<username>googlecode.username</username>
<password>googlecode.password</password>
</server>

Web pages hosting

If you want to send html/css files to your svn repository and still be able to normally browse them you will have to fix the mime type which is defaulted to ‘text/text’. If you are using subversion you can manually set the mime type with those commands:

svn propset svn:mime-type 'text/html' *.html
svn propset svn:mime-type 'text/css' *.css
Bookmark and Share

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment

Security Code: