Hosting Maven Sites & Repos at Google Code
by Dana H. P'Simer
Sat, Aug 14, 2010
- In order to know where the local wiki repo directory is, I needed a property to hold that value and then we would set it in the settings.xml, however I am a fan of not having any external dependencies that could cause the build to fail. So I added this to my POM to set a default:
<properties>
<strip-bom.deploy.directory>${basedir}/target/deploy</strip-bom.deploy.directory>
...
</properties>
- Next I added the following to my POM to define the distributionManagement settings
<distributionManagement>
<repository>
<id>strip-bom-deploy</id>
<name>Repo</name>
<uniqueVersion>true</uniqueVersion>
<url>file:${strip-bom.deploy.directory}/repo</url>
</repository>
<site>
<id>strip-bom-site</id>
<name>Site</name>
<url>file:${strip-bom.deploy.directory}/site</url>
</site>
<downloadUrl>http://code.google.com/p/strip-bom-maven-plugin/downloads</downloadUrl>
</distributionManagement>
- Next, I added this to my settings.xml:
<profiles>
<profile>
<activation><activeByDefault>true</activeByDefault></activation>
<properties>
<strip-bom.deploy.directory>${user.home}/dev/dhptech/strip-bom-maven-plugin-wiki</strip-bom.deploy.directory>
</properties>
<id>default</id>
</profile>
</profiles>
Now, when I do a snapshot build, I can execute mvn deploy site-deploy, commit and push the wiki repo, and the snapshot and site are deployed at the same time.