maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KARR, DAVID" <dk0...@att.com>
Subject RE: Strategies for overriding parent plugin configuration in some modules without duplicating config code?
Date Wed, 22 Feb 2017 15:11:32 GMT
> -----Original Message-----
> From: Martin Hoeller [mailto:martin@xss.co.at]
> Sent: Monday, February 20, 2017 11:44 PM
> To: Maven Users List <users@maven.apache.org>
> Subject: Re: Strategies for overriding parent plugin configuration in
> some modules without duplicating config code?
> 
> Hi!
> 
> On Mon, 20 Feb 2017 16:32 "KARR, DAVID" <dk068x@att.com> wrote:
> 
> > Although my issue is about configuring the "jacoco-maven-plugin", I
> > think it's really more of a pure Maven configuration issue, as I don't
> > think this situation is unique to JaCoCo.
> >
> > I have a somewhat large multi-module project.  Each of the child
> > modules has a parent pom that configures the "jacoco-maven-plugin" to
> > do offline instrumentation (at present, all the modules having unit
> > tests using PowerMock, which doesn't work with online
> > instrumentation).
> >
> > I've designed a change that I'll have to make in a few classes in each
> > module that will allow the unit tests to use Mockito, and for JaCoCo
> > to use online instrumentation.  I'll eventually fix all of them to
> > work this way, but it will take a little while.  In the meantime, I
> > just want to override the configuration in the "fixed"
> > modules with online instrumentation and let the other modules use the
> > default of offline instrumentation.
> >
> > The simple-minded way to do this is just to define the same
> > configuration using online instrumentation in each "fixed" module, so
> > it will override the parent pom.  Copying that block to every "fixed"
> > module is not a great idea.  I'd like a solution that requires less
> > code duplication.
> 
> 
> Just two weeks ago Tamás Cservenák pointed out on this list the
> configuration-maven-plugin [1]. I haven't used it myself, but it sounds
> like this plugin could help you saving some code duplication.
> 
> hth,
> - martin
> 
> [1] https://github.com/cstamas/configuration-maven-plugin

It does look promising, but as the README says, this is just a "proof of concept" and doesn't
appear to be available in mavencentral.

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


Mime
View raw message