You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Rémy Sanlaville <re...@gmail.com> on 2007/02/09 17:51:11 UTC

[M2] Execute only in the parent POM and some sub-modules ?

Hi,

I wonder if it is possible to execute a plugin only for some sub-modules
from the parent pom ?

I have a multi-modules projects

parent
  |
  |-- module A
  |
  |-- module B
  |
  |-- module C
  |
  |-- module ...
  |
  |-- pom.xml

I want to generate a web site of my project but excluding one or two
modules. It would by nice to
share the reporting section in my parent pom and excluding these modules
when executing mvn site.
But I also want to take into account all the modules for others tasks
(compile, package, install...).

How can I do this ?

Rémy

Re: [M2] Execute only in the parent POM and some sub-modules ?

Posted by Edwin Punzalan <ep...@exist.com>.
For now, you can't.  You need to put the plugin into the poms of the 
projects where you want it to run.

Rémy Sanlaville wrote:
> Hi,
>
> I wonder if it is possible to execute a plugin only for some sub-modules
> from the parent pom ?
>
> I have a multi-modules projects
>
> parent
>  |
>  |-- module A
>  |
>  |-- module B
>  |
>  |-- module C
>  |
>  |-- module ...
>  |
>  |-- pom.xml
>
> I want to generate a web site of my project but excluding one or two
> modules. It would by nice to
> share the reporting section in my parent pom and excluding these modules
> when executing mvn site.
> But I also want to take into account all the modules for others tasks
> (compile, package, install...).
>
> How can I do this ?
>
> Rémy
>

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


Re: [m2] Execute only in the parent POM and some sub-modules ?

Posted by Rémy Sanlaville <re...@gmail.com>.
Thanks for all,

Finally, I followed the Stephan's recommendation with the profiles
configuration.
You can also have a look to
http://www.nabble.com/Excluding-certain-modules-in-a-profile-tf3185303s177.html#a8840699

    <profiles>
        <profile>
            <id>site</id>
            <modules>
                <module>moduleA</module>
                <module>moduleB</module>
            </modules>
        </profile>

        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <modules>
                <module>moduleA</module>
                <module>moduleB</module>
                <module>moduleC</module>
            </modules>
        </profile>
    </profiles>

mvn compile : compile all my three modules
mvn site -Psite : generates the web site only for the modules A and B

Rémy

Re: [m2] Execute only in the parent POM and some sub-modules ?

Posted by franz see <fr...@gmail.com>.
Good day to you, Edwin,

Thanks for the correction :-)

Cheers,
Franz


Edwin Punzalan wrote:
> 
> Hi, franz.
> 
> <inherited> is used inside parent poms... if you want to run the plugin 
> only in the parent pom and don't want modules to run them (through 
> inheritance).  You don't put it inside your modules unless they 
> themselves have their own modules.
> 
> 
> franz see wrote:
>> Good day,
>>
>> Either this or declare <inherited>false</inherited> inside the plugin
>> sections of those modules you don't want to do the goal.
>>
>> Cheers,
>> Franz
>>
>>
>> Stephane Nicoll-2 wrote:
>>   
>>> you can specify this in a profile and activate it only when needed.
>>>
>>> Cheers,
>>> Stéphane
>>>
>>> On 2/9/07, Rémy Sanlaville <re...@gmail.com> wrote:
>>>     
>>>> Hi,
>>>>
>>>> I wonder if it is possible to execute a plugin only for some
>>>> sub-modules
>>>> from the parent pom ?
>>>>
>>>> I have a multi-modules projects
>>>>
>>>> parent
>>>>   |
>>>>   |-- module A
>>>>   |
>>>>   |-- module B
>>>>   |
>>>>   |-- module C
>>>>   |
>>>>   |-- module ...
>>>>   |
>>>>   |-- pom.xml
>>>>
>>>> I want to generate a web site of my project but excluding one or two
>>>> modules. It would by nice to
>>>> share the reporting section in my parent pom and excluding these
>>>> modules
>>>> when executing mvn site.
>>>> But I also want to take into account all the modules for others tasks
>>>> (compile, package, install...).
>>>>
>>>> How can I do this ?
>>>>
>>>> Rémy
>>>>
>>>>       
>>> ---------------------------------------------------------------------
>>> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Execute-only-in-the-parent-POM-and-some-sub-modules---tf3201453s177.html#a8917995
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: [m2] Execute only in the parent POM and some sub-modules ?

Posted by Edwin Punzalan <ep...@exist.com>.
Hi, franz.

<inherited> is used inside parent poms... if you want to run the plugin 
only in the parent pom and don't want modules to run them (through 
inheritance).  You don't put it inside your modules unless they 
themselves have their own modules.


franz see wrote:
> Good day,
>
> Either this or declare <inherited>false</inherited> inside the plugin
> sections of those modules you don't want to do the goal.
>
> Cheers,
> Franz
>
>
> Stephane Nicoll-2 wrote:
>   
>> you can specify this in a profile and activate it only when needed.
>>
>> Cheers,
>> Stéphane
>>
>> On 2/9/07, Rémy Sanlaville <re...@gmail.com> wrote:
>>     
>>> Hi,
>>>
>>> I wonder if it is possible to execute a plugin only for some sub-modules
>>> from the parent pom ?
>>>
>>> I have a multi-modules projects
>>>
>>> parent
>>>   |
>>>   |-- module A
>>>   |
>>>   |-- module B
>>>   |
>>>   |-- module C
>>>   |
>>>   |-- module ...
>>>   |
>>>   |-- pom.xml
>>>
>>> I want to generate a web site of my project but excluding one or two
>>> modules. It would by nice to
>>> share the reporting section in my parent pom and excluding these modules
>>> when executing mvn site.
>>> But I also want to take into account all the modules for others tasks
>>> (compile, package, install...).
>>>
>>> How can I do this ?
>>>
>>> Rémy
>>>
>>>       
>> ---------------------------------------------------------------------
>> 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: [m2] Execute only in the parent POM and some sub-modules ?

Posted by franz see <fr...@gmail.com>.
Good day,

Either this or declare <inherited>false</inherited> inside the plugin
sections of those modules you don't want to do the goal.

Cheers,
Franz


Stephane Nicoll-2 wrote:
> 
> you can specify this in a profile and activate it only when needed.
> 
> Cheers,
> Stéphane
> 
> On 2/9/07, Rémy Sanlaville <re...@gmail.com> wrote:
>> Hi,
>>
>> I wonder if it is possible to execute a plugin only for some sub-modules
>> from the parent pom ?
>>
>> I have a multi-modules projects
>>
>> parent
>>   |
>>   |-- module A
>>   |
>>   |-- module B
>>   |
>>   |-- module C
>>   |
>>   |-- module ...
>>   |
>>   |-- pom.xml
>>
>> I want to generate a web site of my project but excluding one or two
>> modules. It would by nice to
>> share the reporting section in my parent pom and excluding these modules
>> when executing mvn site.
>> But I also want to take into account all the modules for others tasks
>> (compile, package, install...).
>>
>> How can I do this ?
>>
>> Rémy
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Execute-only-in-the-parent-POM-and-some-sub-modules---tf3201453s177.html#a8917662
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: [M2] Execute only in the parent POM and some sub-modules ?

Posted by Stephane Nicoll <st...@gmail.com>.
you can specify this in a profile and activate it only when needed.

Cheers,
Stéphane

On 2/9/07, Rémy Sanlaville <re...@gmail.com> wrote:
> Hi,
>
> I wonder if it is possible to execute a plugin only for some sub-modules
> from the parent pom ?
>
> I have a multi-modules projects
>
> parent
>   |
>   |-- module A
>   |
>   |-- module B
>   |
>   |-- module C
>   |
>   |-- module ...
>   |
>   |-- pom.xml
>
> I want to generate a web site of my project but excluding one or two
> modules. It would by nice to
> share the reporting section in my parent pom and excluding these modules
> when executing mvn site.
> But I also want to take into account all the modules for others tasks
> (compile, package, install...).
>
> How can I do this ?
>
> Rémy
>

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