You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Yann Albou <ya...@club-internet.fr> on 2006/12/18 21:27:11 UTC
how to overwrite plugin definition with an execution phase?
Hello,
In my pom parent I have defined (in the pluginManagement section) a
plugin configuration that is bind to a phase:
<project>
[...]
<build>
[...]
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
</execution>
</executions>
</plugin>
</pluginManagement>
[...]
</project>
This pom parent is used by many different projects.
But in one of my project (that inherited from this pom parent), I need
to overwrite this configuration.
I have tried to define a new id : but the plugin is executed twice :
1)using the pom parent definition.
2)using the one of my current project.
If I redefine the configuration using the same id (make-assembly) maven
say it cannot use the same id twice.
my sample used the maven assembly plugin but it applies also on others
plugins.
How can I do to overwrite this definition ?
Yann.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: how to overwrite plugin definition with an execution phase?
Posted by Yann Albou <ya...@club-internet.fr>.
Thanks Wayne.
I will organize my project as you mentioned...
Thanks
Yann.
Wayne Fay wrote:
> This has come up previously. And as far as I know, you can't.
>
> You can only use general configurations like this in a parent pom
> where you want the same configuration to be used across --all--
> children.
>
> If you have 5 children and want to apply the generic config to 3 of
> them, you cannot host the config in one parent shared by all 5.
> Instead, you will need to make a parent->subparent->children
> relationship. So they all share a common grandparent, but then you
> have 2 different parents above the children modules.
>
> I'd suggest a similar arrangement with your own poms. You will need
> another "level" of parent poms to make this happen.
>
> Wayne
>
> On 12/18/06, Yann Albou <ya...@club-internet.fr> wrote:
>> Hello,
>>
>> In my pom parent I have defined (in the pluginManagement section) a
>> plugin configuration that is bind to a phase:
>>
>> <project>
>> [...]
>> <build>
>> [...]
>> <pluginManagement>
>> <plugins>
>> <plugin>
>> <artifactId>maven-assembly-plugin</artifactId>
>> <configuration>
>> <descriptorRefs>
>> <descriptorRef>jar-with-dependencies</descriptorRef>
>> </descriptorRefs>
>> </configuration>
>> <executions>
>> <execution>
>> <id>make-assembly</id>
>> <phase>package</phase>
>> <goals>
>> <goal>attached</goal>
>> </goals>
>> </execution>
>> </executions>
>> </plugin>
>> </pluginManagement>
>> [...]
>> </project>
>>
>> This pom parent is used by many different projects.
>>
>> But in one of my project (that inherited from this pom parent), I need
>> to overwrite this configuration.
>>
>> I have tried to define a new id : but the plugin is executed twice :
>> 1)using the pom parent definition.
>> 2)using the one of my current project.
>>
>> If I redefine the configuration using the same id (make-assembly) maven
>> say it cannot use the same id twice.
>>
>> my sample used the maven assembly plugin but it applies also on others
>> plugins.
>> How can I do to overwrite this definition ?
>>
>> Yann.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: how to overwrite plugin definition with an execution phase?
Posted by Wayne Fay <wa...@gmail.com>.
This has come up previously. And as far as I know, you can't.
You can only use general configurations like this in a parent pom
where you want the same configuration to be used across --all--
children.
If you have 5 children and want to apply the generic config to 3 of
them, you cannot host the config in one parent shared by all 5.
Instead, you will need to make a parent->subparent->children
relationship. So they all share a common grandparent, but then you
have 2 different parents above the children modules.
I'd suggest a similar arrangement with your own poms. You will need
another "level" of parent poms to make this happen.
Wayne
On 12/18/06, Yann Albou <ya...@club-internet.fr> wrote:
> Hello,
>
> In my pom parent I have defined (in the pluginManagement section) a
> plugin configuration that is bind to a phase:
>
> <project>
> [...]
> <build>
> [...]
> <pluginManagement>
> <plugins>
> <plugin>
> <artifactId>maven-assembly-plugin</artifactId>
> <configuration>
> <descriptorRefs>
> <descriptorRef>jar-with-dependencies</descriptorRef>
> </descriptorRefs>
> </configuration>
> <executions>
> <execution>
> <id>make-assembly</id>
> <phase>package</phase>
> <goals>
> <goal>attached</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> </pluginManagement>
> [...]
> </project>
>
> This pom parent is used by many different projects.
>
> But in one of my project (that inherited from this pom parent), I need
> to overwrite this configuration.
>
> I have tried to define a new id : but the plugin is executed twice :
> 1)using the pom parent definition.
> 2)using the one of my current project.
>
> If I redefine the configuration using the same id (make-assembly) maven
> say it cannot use the same id twice.
>
> my sample used the maven assembly plugin but it applies also on others
> plugins.
> How can I do to overwrite this definition ?
>
> Yann.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org