maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From WhatTheHell <>
Subject RE: Checking properties in a multi-pom environment
Date Wed, 13 Aug 2008 09:31:25 GMT

Hi Brian,

Thank you for your reply. Actually, I think you've just answered my
question, but maybe there still is some other solution.

My situation is:

The root-pom with no properties inside but with some modules. Here you have
a part of it:

-- \/ -- root-pom part -- \/ --



                <!-- ... -->

-- /\ -- root-pom part -- /\ --

And in a module 'war' we have several profiles. Some of them have the
property 'the.url' and some of them don't. Of course different profiles have
different values of the.url, so it can not be set globally.
I have to check some more properties from different modules and that's why I
wanted to try to check them from one place to have all the rules togather.

As far as I understand, when I add a rule to the root it will be checked in
every module's pom. So the rule will fail in all the poms except 'war' (but
only if a good profile was used). Is that correct?
I was just wondering whether there is a possibility to check if the rule was
OK at least once in a tree - not for every single pom. And if it failed in
every pom then use the value in <fail></fail> to fail the compilation or

Well, if I have to check the properties in the modules where they appear
I'll live with it   :-)
But if you have any idea for my case, please let me know about it.

I hope this time I gave you enough details.



Brian E Fox wrote:
> The enforcer rule should work, you'll need to be more explicit about
> what's not working. If you put the enforcer in the root, it will execute
> for all children. If some of those children don't have it set, then it
> should fail. I just double checked the rule, and it's using the core
> code to result the property, so it should behave exactly like the core
> and see inherited properties.
> -----Original Message-----
> From: WhatTheHell [] 
> Sent: Tuesday, August 12, 2008 10:44 AM
> To:
> Subject: Checking properties in a multi-pom environment
> Hi Maven users  :)
> I faced a problem to check if some properties were set during maven's
> compilation/deployment etc or not. 
> We have one 'root' pom and it runs some other poms as modules. There are
> no
> properties in the root-pom. They are set during maven's work. The
> example
> property can be the project's URL. Sometimes we just make a local
> compilation and then we don't need it to be set. However, when we deploy
> a
> new release we have to be sure that the URL was set. We use some
> different
> profiles when we just compile and when we deploy and some of those
> profiles
> do have a property while some other don't.
> I've tried to use an enforcer plugin. I've created a
> requireProperty-rule in
> a root-pom, but as far as I can see it doesn't work in a pom-tree
> environment (please correct me if I'm wrong), because I've run mvn with
> a
> profiles that do set the URL for sure and my rule failed. I've also
> tried to
> make a java-custom-rule, but it also failed saying, that I haven't set
> the
> property  :-(
> I know I can check my rule in every single pom that sometimes can set
> the
> URL, but I wanted to do it in the root. Is it possible?
> We use:
> Maven version: 2.0.8
> Java version: 1.5.0_15
> I've tried to find a solution for a couple of days, but I couldn't.
> Maybe
> I've missed some reference...
> Thanks for any help
> Best
> Pawel
> -- 
> View this message in context:
> 8945713p18945713.html
> Sent from the Maven - Users mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View this message in context:
Sent from the Maven - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message