Hi,

I would like to let my co-workers publish Maven sites easily. For this I'd
like to define some kind of convention for site locations. I would like this
to work "out-of-the-box", so if I create a new Maven project that uses the
company POM, its site would be deployed to the right location automatically.

Consider this multi-module project:

/- com.example.hello:hello-parent (packaging: POM)
  |
  +- com.example.hello:hello-core (packaging: JAR)
  |
  +- com.example.hello:hello-web  (packaging: WAR)

I'd like to deploy the site to this location:

http://maven-sites.local/com/example/hello/ (i.e. I would like to have the
groupId to be converted into a path)

...with the modules to be published in folders under this URL (just as is
the default right now):

http://maven-sites.local/com/example/hello/hello-core/
http://maven-sites.local/com/example/hello/hello-web/

I can do this if I explicitly set the site location in the parent POM to
"scp://maven-sites/var/www/com/example/hello/".

However, requiring each project to do this is rather error prone, so I'd
like to define a pattern in the company parent POM, and have all projects
automatically derive their location from there.

This doesn't work. If I set a location in our top-level POM to, say,
"scp://maven-sites/var/www/", sites will be published to folders under that
location based on their artifactId. This means that I get URLs like this:

http://maven-sites.local/hello-parent/
http://maven-sites.local/hello-parent/hello-core/

I have several problems with this:

   - The URLs I get are not very nice.
   - The company POM's site gets published to the root location (
   http://maven-sites.local/), which causes all kinds of troubles.
   - If I have two projects with different groupIds, but with the same
   artifactId, their sites will collide.

Is there an easy way to solve this, or should all projects define their own
site locations?

-- 
Thanks,
Lorant

Reply via email to