4

I'm struggling to understand the complexities of deploying a multi-module maven site that has working links. This is complicated by the fact that I'm deploying to Google Code using the maven-scm-provider-hg.

According to the docs, I'm supposed to run mvn site:site site:stage to get a full working site. However when I run mvn site:deploy it deploys the parent pom site which is empty except for the images and css folders.

Next I try mvn site:stage-deploy. This fails because it adds staging/ to the url, which since I'm using Google code causes an error because http://code.google.com/p/myproject.site/staging isn't a repository. This also isn't a long term solution since I'm pretty sure the maven release plugin runs site:site.

What is the official way to deploy a full multi-module site with working links?

TheLQ
  • 14,830
  • 14
  • 69
  • 107
  • At least, what I can say is that mvn site:stage would deploy it locally, AS in production (like http://code.google.com/p/myproject.site). Staging is a convinient way to see what happen (locally) like site:deploy. This is the right way to test a fully functionnal site (with working links). This is not suitable for production deployement. – Jean-Rémy Revy Aug 18 '12 at 13:59
  • In addition, mvn site:deploy would deploy allsubsites recursively ... I can't explain what's the matter oO. Consider that you main pom should have some general informations. This would be, indeed, the main site – Jean-Rémy Revy Aug 18 '12 at 14:16
  • Could you show us the content of your distributionManagement section? BTW, have you tried to set the $stagingSiteURL value to http://code.google.com/p/myproject.site? – poussma Aug 22 '12 at 07:32

1 Answers1

0

In order to run the site build of a multi module build with everything ready you have to run the site lifecycle phase site-deploy and not just the site plugin goal.

So I would run

mvn clean install site-deploy

or for deploy of artifacts and site

mvn clean deploy site-deploy

And of course you have to have the setup correct in terms of distribution management. Besides that you want to ensure that all modules have the same directory name as their artifactId and you have set up site.xml with the respective links and so on as documented on the site plugin website.

Depending on the site deployment protocol you might also have to add a build extension (e.g. if you use dav)

It certainly takes a bit of fiddling but it works. Also I would recommend to use the latest version of the site plugin (3.1) and Maven (3.0.4).

Manfred Moser
  • 29,539
  • 13
  • 92
  • 123