You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by sverhagen <sv...@wps-nl.com> on 2008/08/17 17:30:29 UTC

Site resources in sub-modules

Googled for this, but to no avail. My question:

Can sub-modules re-use the site resources of their parent? And how?

I've a src/site/site.xml in my parent project. This files is nicely re-used
by the sub-models.

However, my src/site/resources/... (an image and a CSS file in their own
sub-folers) aren't picked up.

This is how the image is referenced:

	<bannerLeft>
		<src>./images/image.png</src>
	</bannerLeft>
-- 
View this message in context: http://www.nabble.com/Site-resources-in-sub-modules-tp19020780p19020780.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 resources in sub-modules

Posted by sverhagen <sv...@wps-nl.com>.

Wendy Smoak-3 wrote:
> 
> On Sun, Aug 17, 2008 at 8:30 AM, sverhagen <sv...@wps-nl.com> wrote:
> 
> Wouldn't it need to be ../images/image.png?  (Two dots leading, rather
> than one.)  The files in src/main/resources won't be copied into every
> subdirectory, but they will be there on the server, so relative urls
> should work.
> 

With your permission, I don't think that will work.

The directory structure is like this:

parent project
|--sub module
\--sub module

So, parent and sub modules need a different number of these "../" to make
this work... while I try to configure this from a single site.xml.
-- 
View this message in context: http://www.nabble.com/Site-resources-in-sub-modules-tp19020780p19021203.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 resources in sub-modules

Posted by Wendy Smoak <ws...@gmail.com>.
On Sun, Aug 17, 2008 at 8:30 AM, sverhagen <sv...@wps-nl.com> wrote:

> Can sub-modules re-use the site resources of their parent? And how?
> I've a src/site/site.xml in my parent project. This files is nicely re-used
> by the sub-models.
> However, my src/site/resources/... (an image and a CSS file in their own
> sub-folers) aren't picked up.
> This is how the image is referenced:
>        <bannerLeft>
>                <src>./images/image.png</src>
>        </bannerLeft>

Wouldn't it need to be ../images/image.png?  (Two dots leading, rather
than one.)  The files in src/main/resources won't be copied into every
subdirectory, but they will be there on the server, so relative urls
should work.

(Note that this won't work if you preview the individual pieces of the
site from the target directory, you'll need to stage it or deploy it
to check the links.)

-- 
Wendy

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


Re: Site resources in sub-modules

Posted by sverhagen <sv...@wps-nl.com>.

Stefano Bagnara-2 wrote:
> 
> sverhagen ha scritto:
>> Can sub-modules re-use the site resources of their parent? And how?
> Use absolute urls.
> 
> They will be stripped according to your pom url and relative paths will 
> be calculated for child modules.
> 
> This only works fine with latest site plugin (2.0-beta-7)
> 

Okay, I am using 2.0-beta-7, so that's good.

Not sure what kind of absolute URL's you have in mind. Would you be so kind
as to provide a brief example?
-- 
View this message in context: http://www.nabble.com/Site-resources-in-sub-modules-tp19020780p19021231.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 resources in sub-modules

Posted by Stefano Bagnara <ap...@bago.org>.
sverhagen ha scritto:
> Googled for this, but to no avail. My question:
> 
> Can sub-modules re-use the site resources of their parent? And how?
> 
> I've a src/site/site.xml in my parent project. This files is nicely re-used
> by the sub-models.
> 
> However, my src/site/resources/... (an image and a CSS file in their own
> sub-folers) aren't picked up.
> 
> This is how the image is referenced:
> 
> 	<bannerLeft>
> 		<src>./images/image.png</src>
> 	</bannerLeft>

Use absolute urls.

They will be stripped according to your pom url and relative paths will 
be calculated for child modules.

This only works fine with latest site plugin (2.0-beta-7)

Stefano

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