You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Felipe Leme <ma...@felipeal.net> on 2004/07/16 14:36:01 UTC

Re: [PATCH] Option to set different templates to be used as announcement

On Thu, 15 Jul 2004 21:26:41 +0200, Vincent Massol <vm...@pivolis.com> 
wrote:

 > I'm answering on the list now as this issue is turning into a 
discussion... :-)

Makes sense, I  was thinking about that too. In fact, I can wrap up the 
discussion in a [VOTE] message, if you don't mind.

 > I don't think there's any relation with the multiproject here. If you 
wish
 > to share properties between multiple projects in Maven, you simply 
define it
 > in a top level project.properties file which gets inherited automatically
 > when you use the <extend> element in the child projects.

Yes, I know. I'm more concerned about the variable's value (see below).

 > The properties are getting placed in the context of the project. They are
 > each resolved at runtime. Which means ${basedir} gets the right value.

Yes, the multiproject/reactor takes a good care of this basedir 
resolution (in fact, the multiproject's FAQ states that you should 
always use ${basedir} in these casses). The problem is, I'd like the 
option of using the same customized stylesheet in many different 
projects, independently of using multiproject or not. For instance, 
imagine I have a master project with many sub-projects. If I set at the 
master level the property:

maven.announcement.stylesheet.value=etc/myAnnouncement.jcl

Then all sub-projects will reference the right file (i.e., located at 
the ROOT_MULTIPROJECT/etc), when I invoke multiproject (I'm assuming 
that's the multiproject behavior when ${basedir} is not used. I haven't 
tested that though). But then if I run a project on its own (i.e., not 
using multiproject), it would try to find the file at PROJECT_DIR/etc, 
which is wrong. Of course, I could solve that issue (without using the 
type property) by using a absolute URI, but that would be bad, as I 
would need to know the physical location of the file (or at least an EL 
expression to obtain that value). On the other hand, if we had the type 
property, I could easily solve it setting these properties:

maven.announcement.stylesheet.type=resource
maven.announcement.stylesheet.value=myAnnouncement.jcl

These properties state that the myAnnouncement.jcl is located at the 
announcement's plugin directory, so the location is the same 
independently of how I'm invoking my project. The only drawback is that 
I have to sneak that file into the plugins's directory, but that's fine 
in my situation, as we provided a customized maven instalation anyway. 
As an additional advantage of this approach, we could provide more 
stylesheets in the  distribution (for instance, announcement.jcl, 
fullAnnouncement.jcl, minimumAnnoucement.jcl, etc...).

What do you think?

Felipe

PS: for those who haven't a clue about what is this discussion about, 
take a look on the Jira's discussion:

http://jira.codehaus.org/browse/MPANNOUNCEMENT-11


















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