Hi Martin!

2008/6/24 Martin Höller <[EMAIL PROTECTED]>:
[...]
> Ok, let me explain it in more detail.
>
> What you have is a parent project P and a child project C. The child
> specifies its parent via
>
>  <parent>
>    <groupId>yourGroupId</groupId>
>    <artifactId>theParentId</artifactId>
>    <version>someVersion</version>
>    <relativePath>../wherever/parent/lives</relativePath>
>  </parent>
>
> in the pom.xml file. Is this correct?

Yes.

> The parent project P configures the compiler plugin via <pluginManagement>
> as described in my previous mail. Also correct?
>
> If the above is true, C should inherit the configuration from P when
> building. AFIAK maven does not insert the configuration from P into C's
> pom.xml, as the configuration can always be retreived from P's pom.xml.
> That's the reason why maven inserts a version tag for your parent when
> releasing the child.

Okay, maybe I wasn't explicit enough I am not talking about the normal
use case I am talking about the usage of the release plugin, where you
specify in the config to generate a release pom, like so:
<build>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.0-beta-7</version>
        <configuration>
          <tagBase>svn://foo/bar/baz</tagBase>
          <generateReleasePoms>true</generateReleasePoms>
        </configuration>
      </plugin>
<build>

This is what I have in the child projects pom and this also ends up in
the release-pom.xml which the release plugin generates. But what I
found out is that all other plugins defined in the <build> tag of the
_parents_ pom are completely ignored and do not end up in the
release-pom.xml, which is, what I would expect as that works for all
other stuff coming from the parent pom like reporting, dependencies or
repositories. To make it more clear: I try to create a pom that is
completely frozen (no version ranges etc.) to be checked in to be able
to rebuild any release in the future w/ the ability to use version
ranges during development. That is what the release plugin promises
and does except for the configuration for plugins in the build section
of the parent pom, from what I can see so far.

>> I tried exactly this, and it's not inherited into the release-pom.
>
> What do you mean by "inherited"? Copyied into C's pom.xml? That's not the
> intention. It should be inserted into the reactor at runtime from the
> parent.

As I said, the generated release-pom.xml does not contain any of the
settings defined in the build tag of the parent pom. Bug? Feature?
Wrong understanding?


> Probably because most examples want to stay simple and small. Using a
> <pluginManagement> in a parent is like specifying a default plugin version
> to use, if not explicitly specivied via the <version> tag in a subproject.
>
> See the books "Better Builds with Maven" and "Maven - The Definitve Guide"
> for more explanations.

Will digg into those once again, but I have tried to find answers
there, maybe I just overlook something obvious.

Thanks again!

Andre

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to