You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Martin Ahrer <ma...@gmx.at> on 2008/04/21 15:20:05 UTC

site deployment url

I have 2 projects named PARENT and A. For both I want to deploy a site.
Why can't I just define the site deployment url like
sites/${project.artifactId} in the parent and inherit in the sub project
(using the pom parent element).

 I have tried many variations come to the conclusion that in order to get
the right directory I have to define the deployment site in every sub
project:
1.) Parent site url is 'sites/',  A defines no url, resulting url is
'sites/A'
2.) Parent site url is 'sites/',  A defines url as
sites/${project.artifactId}, resulting url is 'sites/A'

3.) Parent site url is 'sites',   A defines no url, resulting url is
'sites/A'
4.) Parent site url is 'sites',   A defines url as
sites/${project.artifactId}, resulting url is 'sites/A'

5.) Parent site url is 'sites/${project.artifactId}',   A defines no url,
resulting url is 'sites/A/A'
6.) Parent site url is 'sites/${project.artifactId}',   A defines url as
'sites/${project.artifactId}', resulting url is 'sites/A'

7.) Parent site url is 'sites/${project.artifactId}/',   A defines no url,
resulting url is 'sites/A/A'
8.) Parent site url is 'sites/${project.artifactId}/',   A defines url as
'sites/${project.artifactId}', resulting url is 'sites/A'

I have even tried the formerly documented feature with the trailing / that
should control whether a subproject should add its aritfactId to the url.
I find it strange that when using the ${project.artifactId} expression in
the parent project the resulting url is sites/A/A.

>From the above results I see that I need to specifiy the url in every
project, the parent and all of the sub projects (I have a large number!)


-----
http://www.martinahrer.at/blog http://www.martinahrer.at/blog 
-- 
View this message in context: http://www.nabble.com/site-deployment-url-tp16807725s177p16807725.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: site deployment url

Posted by Wouter Hermeling <wh...@gmail.com>.
Actually,

I've found a way to tweak this kind of parent-child property problems. I
have set-up a corporate pom which is the parent for a lot of projects (each
project being a multimodule project on it's own).
There's a nice trick when it comes to inheriting properties: use the
profiles.xml! 

The trick is that properties in the profiles.xml are not inherited, as the
following example shows (tested with maven 2.0.8):

Parent pom.xml:
<properties><site.suffix>/</site.suffix></properties>
<distributionManagement><site><url>protocol.host.path</url></site></distributionManagement>

Parent profiles.xml:
<properties><site.suffix>/${pom.artifactId}</site.suffix></properties>

This way:
* For the parent pom, the property from the profile will be used. So the
site url will be: protocol.host.path/${pom.artifactId}
* For the child poms, the inherited property from the parent pom.xml will be
used. So the site url will begin with: protocol.host.path/ which will be
suffixed with the artifactId of the child resulting in
protocol.host.path/<childArtifactId>

I believe this is what you seek. 


Martin Ahrer wrote:
> 
> I have 2 projects named PARENT and A. For both I want to deploy a site.
> Why can't I just define the site deployment url like
> sites/${project.artifactId} in the parent and inherit in the sub project
> (using the pom parent element).
> 
>  I have tried many variations come to the conclusion that in order to get
> the right directory I have to define the deployment site in every sub
> project:
> 1.) Parent site url is 'sites/',  A defines no url, resulting url is
> 'sites/A'
> 2.) Parent site url is 'sites/',  A defines url as
> sites/${project.artifactId}, resulting url is 'sites/A'
> 
> 3.) Parent site url is 'sites',   A defines no url, resulting url is
> 'sites/A'
> 4.) Parent site url is 'sites',   A defines url as
> sites/${project.artifactId}, resulting url is 'sites/A'
> 
> 5.) Parent site url is 'sites/${project.artifactId}',   A defines no url,
> resulting url is 'sites/A/A'
> 6.) Parent site url is 'sites/${project.artifactId}',   A defines url as
> 'sites/${project.artifactId}', resulting url is 'sites/A'
> 
> 7.) Parent site url is 'sites/${project.artifactId}/',   A defines no url,
> resulting url is 'sites/A/A'
> 8.) Parent site url is 'sites/${project.artifactId}/',   A defines url as
> 'sites/${project.artifactId}', resulting url is 'sites/A'
> 
> I have even tried the formerly documented feature with the trailing / that
> should control whether a subproject should add its aritfactId to the url.
> I find it strange that when using the ${project.artifactId} expression in
> the parent project the resulting url is sites/A/A.
> 
> From the above results I see that I need to specifiy the url in every
> project, the parent and all of the sub projects (I have a large number!)
> 
> 

-- 
View this message in context: http://www.nabble.com/site-deployment-url-tp16807725s177p16812026.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org