You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Niranjan Rao <nh...@gmail.com> on 2014/05/09 02:59:31 UTC

How to override settings for maven module

I have a master POM file which defines common stuff such as common 
dependencies like junit and compiler settings.

The compiler settings are set to treat warning as error using 
maven-compiler-plugin and Werror as compiler argument. I have a new 
module which declares the master pom as parent pom, but has generated 
code which has lot of warnings. I would like to disable treating 
warnings as errors only for this module or if possible only for 
generated package or generated source directory.

I tried adding compiler plugin entry in module's pom file. But it looks 
like it overrides from parent. How do I disable warnings for this module 
only?

Regards,

Niranjan

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


Re: How to override settings for maven module

Posted by Niranjan Rao <nh...@gmail.com>.
Found the answer, you need to use combine.self="override" in the 
compiler plugin settings. More details at 
http://stackoverflow.com/questions/1771561/maven-is-it-possible-to-override-the-configuration-of-a-plugin-already-defined

On 05/08/2014 05:59 PM, Niranjan Rao wrote:
> I have a master POM file which defines common stuff such as common 
> dependencies like junit and compiler settings.
>
> The compiler settings are set to treat warning as error using 
> maven-compiler-plugin and Werror as compiler argument. I have a new 
> module which declares the master pom as parent pom, but has generated 
> code which has lot of warnings. I would like to disable treating 
> warnings as errors only for this module or if possible only for 
> generated package or generated source directory.
>
> I tried adding compiler plugin entry in module's pom file. But it 
> looks like it overrides from parent. How do I disable warnings for 
> this module only?
>
> Regards,
>
> Niranjan


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


Re: How to override settings for maven module

Posted by Niranjan Rao <nh...@gmail.com>.
Thanks for the answer, but as I said in the email, I already have a 
module which consists just generated code. However I could not figure 
out how to override settings for the plugin block. Maven by default 
merges the arguments from parent pom. Answer was to use 
combine.self="override" block in the configuration section of the plugin.

Regards,

Niranjan


On 05/12/2014 09:31 AM, Karl Heinz Marbaise wrote:
> Hi,
>
> the first thing in such situations is to create a separate module 
> which contains the generation code part. In this module you can change 
> the configuration for maven-compiler-plugin via a pluginManagemen 
> block...
>
> So looks like this:
>
>   parent (pom.xml)
>     +-- mod-generated (pom.xml)
>     +-- mod-the-rest (pom.xml)
>
> If you follow this suggestions you have clear separation of concern 
> for your modules and you only need to change the configuration for the 
> mod-generated.
>
> Kind regards
> Karl-Heinz Marbaise
>
> On 5/9/14 2:59 AM, Niranjan Rao wrote:
>> I have a master POM file which defines common stuff such as common
>> dependencies like junit and compiler settings.
>>
>> The compiler settings are set to treat warning as error using
>> maven-compiler-plugin and Werror as compiler argument. I have a new
>> module which declares the master pom as parent pom, but has generated
>> code which has lot of warnings. I would like to disable treating
>> warnings as errors only for this module or if possible only for
>> generated package or generated source directory.
>>
>> I tried adding compiler plugin entry in module's pom file. But it looks
>> like it overrides from parent. How do I disable warnings for this module
>> only?
>>
>> Regards,
>>
>> Niranjan
>
> ---------------------------------------------------------------------
> 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 override settings for maven module

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

the first thing in such situations is to create a separate module which 
contains the generation code part. In this module you can change the 
configuration for maven-compiler-plugin via a pluginManagemen block...

So looks like this:

   parent (pom.xml)
     +-- mod-generated (pom.xml)
     +-- mod-the-rest (pom.xml)

If you follow this suggestions you have clear separation of concern for 
your modules and you only need to change the configuration for the 
mod-generated.

Kind regards
Karl-Heinz Marbaise

On 5/9/14 2:59 AM, Niranjan Rao wrote:
> I have a master POM file which defines common stuff such as common
> dependencies like junit and compiler settings.
>
> The compiler settings are set to treat warning as error using
> maven-compiler-plugin and Werror as compiler argument. I have a new
> module which declares the master pom as parent pom, but has generated
> code which has lot of warnings. I would like to disable treating
> warnings as errors only for this module or if possible only for
> generated package or generated source directory.
>
> I tried adding compiler plugin entry in module's pom file. But it looks
> like it overrides from parent. How do I disable warnings for this module
> only?
>
> Regards,
>
> Niranjan

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