Let me add an example of what I observed and couldn't find
any documentation about:

<project>
        <groupId>my-group</groupId>
        <artifactId>my-parent-pom</artifactId>
        <properties>
                <scm-host>svn.my.host.org</scm-host>
                
<project-scm-path>trunk/maven/my-parent-project</project-scm-path>
        <properties>
        <scm>
                
<connection>scm:svn:svn://${scm-host}/${project-scm-path}</connection>
        </sm>
</project>

<project>
        <parent>
                <groupId>my-group</groupId>
                <artifactId>my-parent-pom</artifactId>
        </parent>
        <groupId>my-group</groupId>
        <artifactId>my-child</artifactId>
        <properties>
                
<project-scm-path>trunk/maven/my-child-project</project-scm-path>
        <properties>
</project>

Question: what <scm><connection> should my-child have?

Experiments yield: 
        "scm:svn:svn://svn.my.host.org/trunk/maven/my-child-project/my-child"
        Note the appended "my-child"!
Compare this to the value in my-parent-pom:
        "scm:svn:svn://svn.my.host.org/trunk/maven/my-parent-project"
If I copy&paste the inherited <scm> section verbatim into the child 
I get the expected result:
        "scm:svn:svn://svn.my.host.org/trunk/maven/my-child-project"

For one, I'm asking if it is possible to obtain that result without duplicating
a declaration that is already inherited.

Second, I'm asking if there is any documentation that would tell
me in advance and without having to experiment, what the effect
of the given declarations is.

Also: if overriding inherited properties is a supported concept,
it would be cool if maven would follow the lead of good OO programming
languages: let the user specify whether a property definition is intended
to create a fresh property vs. override an inherited one (think @Override).
In my example I was additionally confused because a small typo in
one property name caused the introduction of a new (unused) property
where I intended to override an existing one. Good languages can
detect typos and report errors -- be they imperative or declarative.

Stephan

On Monday, October 18, 2010 05:02:57 pm you wrote:
> I've observed some unexpected behavior when a declaration in a 
> parent pom uses a property that is overridden in a child pom.
> 
> While waiting for parameterized mixins I'd love to know to what 
> degree property overriding can actually simulate parameterization.
> 
> Is this a FAQ? Were should I search for a definition of the semantics?
> Is evaluation order-dependent? If so, how exactly?
> 
> best,
> Stephan


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to