Quantcast

[sonar-dev] Sonar plugin API change request

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[sonar-dev] Sonar plugin API change request

Alexandre Victoor-2
Hello all
A couple of months ago, I have tried to develop a sonar PIT plugin
that executes tests as the PIT maven plugin does. The idea was to
reduce as much as possible the users configuration work. I have
realized during the release vote that what I have done only work with
maven2 and cannot work with maven3.
Digging a little bit, I have found two solutions in order to implement
a full maven3 PIT plugin:
- Use a MavenPluginHandler as it is done for plugins such as jacoco or
cobertura. The bad side of this is that will make the code much more
maven dependent as it is right now. This is perhaps the reason why
analysis run with the "java runner" use a "reuse reports" mode for the
tests and coverage.
- Change the plugin API in order to get the effective runtime
classpath of the sonar plugin which is the result of maven expression
"${plugin.artifactMap}""

Let me know if there is a chance the APi might evolve. Otherwise I
will go the MavenPluginHandler way...
Regards

Alex

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Sonar plugin API change request

Simon Brandhof
Hi Alexandre,

- Use a MavenPluginHandler as it is done for plugins such as jacoco or
cobertura. The bad side of this is that will make the code much more
maven dependent as it is right now. This is perhaps the reason why
analysis run with the "java runner" use a "reuse reports" mode for the
tests and coverage.

Exact.

- Change the plugin API in order to get the effective runtime
classpath of the sonar plugin which is the result of maven expression
"${plugin.artifactMap}""

Do you think that having the effective classpath is enough to execute tests from sonar ? For example configuration of tests will have to be injected or duplicated.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Sonar plugin API change request

Alexandre Victoor-2
Hello
Thanks for your response
Indded you are tight, the effective classpath i snot enough. The other
parameters could be found in a "MavenProject" object injected by pico
when maven is used. Other configuration parameters will actually be
needed for the java runner.
I guess that most PIT Sonar users use maven and do not use ant anymore
(... no troll intended). For most users, thoses who have a maven build
the configuration should remain simple.
Regards

Alex


On Tue, Sep 11, 2012 at 2:08 PM, Simon Brandhof
<[hidden email]> wrote:

> Hi Alexandre,
>
>> - Use a MavenPluginHandler as it is done for plugins such as jacoco or
>> cobertura. The bad side of this is that will make the code much more
>> maven dependent as it is right now. This is perhaps the reason why
>> analysis run with the "java runner" use a "reuse reports" mode for the
>> tests and coverage.
>
>
> Exact.
>
>> - Change the plugin API in order to get the effective runtime
>> classpath of the sonar plugin which is the result of maven expression
>> "${plugin.artifactMap}""
>
>
> Do you think that having the effective classpath is enough to execute tests
> from sonar ? For example configuration of tests will have to be injected or
> duplicated.
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Sonar plugin API change request

Alexandre Victoor-2
sorry for the last typos...
If maven is not used to launch the analysis, pico will not be able to
inject any MavenProject instance and will fail.
I do not know if it is possible to change this behavior in order to
inject 'null' instead... Otherwise you are right, every test
configuration parameter would have to be duplicated which would make
this API change not worth the pain :(

Alex

On Wed, Sep 12, 2012 at 10:00 PM, Alexandre Victoor
<[hidden email]> wrote:

> Hello
> Thanks for your response
> Indded you are tight, the effective classpath i snot enough. The other
> parameters could be found in a "MavenProject" object injected by pico
> when maven is used. Other configuration parameters will actually be
> needed for the java runner.
> I guess that most PIT Sonar users use maven and do not use ant anymore
> (... no troll intended). For most users, thoses who have a maven build
> the configuration should remain simple.
> Regards
>
> Alex
>
>
> On Tue, Sep 11, 2012 at 2:08 PM, Simon Brandhof
> <[hidden email]> wrote:
>> Hi Alexandre,
>>
>>> - Use a MavenPluginHandler as it is done for plugins such as jacoco or
>>> cobertura. The bad side of this is that will make the code much more
>>> maven dependent as it is right now. This is perhaps the reason why
>>> analysis run with the "java runner" use a "reuse reports" mode for the
>>> tests and coverage.
>>
>>
>> Exact.
>>
>>> - Change the plugin API in order to get the effective runtime
>>> classpath of the sonar plugin which is the result of maven expression
>>> "${plugin.artifactMap}""
>>
>>
>> Do you think that having the effective classpath is enough to execute tests
>> from sonar ? For example configuration of tests will have to be injected or
>> duplicated.
>>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Sonar plugin API change request

Evgeny Mandrikov
Hi,

Create two constructors - one with MavenProject and another without. picocontainer is greedy, so it will inject MavenProject into first constructor, if it's available, and otherwise will use second.

On Thu, Sep 13, 2012 at 4:05 AM, Alexandre Victoor <[hidden email]> wrote:
sorry for the last typos...
If maven is not used to launch the analysis, pico will not be able to
inject any MavenProject instance and will fail.
I do not know if it is possible to change this behavior in order to
inject 'null' instead... Otherwise you are right, every test
configuration parameter would have to be duplicated which would make
this API change not worth the pain :(

Alex

On Wed, Sep 12, 2012 at 10:00 PM, Alexandre Victoor
<[hidden email]> wrote:
> Hello
> Thanks for your response
> Indded you are tight, the effective classpath i snot enough. The other
> parameters could be found in a "MavenProject" object injected by pico
> when maven is used. Other configuration parameters will actually be
> needed for the java runner.
> I guess that most PIT Sonar users use maven and do not use ant anymore
> (... no troll intended). For most users, thoses who have a maven build
> the configuration should remain simple.
> Regards
>
> Alex
>
>
> On Tue, Sep 11, 2012 at 2:08 PM, Simon Brandhof
> <[hidden email]> wrote:
>> Hi Alexandre,
>>
>>> - Use a MavenPluginHandler as it is done for plugins such as jacoco or
>>> cobertura. The bad side of this is that will make the code much more
>>> maven dependent as it is right now. This is perhaps the reason why
>>> analysis run with the "java runner" use a "reuse reports" mode for the
>>> tests and coverage.
>>
>>
>> Exact.
>>
>>> - Change the plugin API in order to get the effective runtime
>>> classpath of the sonar plugin which is the result of maven expression
>>> "${plugin.artifactMap}""
>>
>>
>> Do you think that having the effective classpath is enough to execute tests
>> from sonar ? For example configuration of tests will have to be injected or
>> duplicated.
>>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Sonar plugin API change request

Alexandre Victoor-2

Nice!
Thanks a lot for this tip!

Le 13 sept. 2012 08:57, "Evgeny Mandrikov" <[hidden email]> a écrit :
Hi,

Create two constructors - one with MavenProject and another without. picocontainer is greedy, so it will inject MavenProject into first constructor, if it's available, and otherwise will use second.

On Thu, Sep 13, 2012 at 4:05 AM, Alexandre Victoor <[hidden email]> wrote:
sorry for the last typos...
If maven is not used to launch the analysis, pico will not be able to
inject any MavenProject instance and will fail.
I do not know if it is possible to change this behavior in order to
inject 'null' instead... Otherwise you are right, every test
configuration parameter would have to be duplicated which would make
this API change not worth the pain :(

Alex

On Wed, Sep 12, 2012 at 10:00 PM, Alexandre Victoor
<[hidden email]> wrote:
> Hello
> Thanks for your response
> Indded you are tight, the effective classpath i snot enough. The other
> parameters could be found in a "MavenProject" object injected by pico
> when maven is used. Other configuration parameters will actually be
> needed for the java runner.
> I guess that most PIT Sonar users use maven and do not use ant anymore
> (... no troll intended). For most users, thoses who have a maven build
> the configuration should remain simple.
> Regards
>
> Alex
>
>
> On Tue, Sep 11, 2012 at 2:08 PM, Simon Brandhof
> <[hidden email]> wrote:
>> Hi Alexandre,
>>
>>> - Use a MavenPluginHandler as it is done for plugins such as jacoco or
>>> cobertura. The bad side of this is that will make the code much more
>>> maven dependent as it is right now. This is perhaps the reason why
>>> analysis run with the "java runner" use a "reuse reports" mode for the
>>> tests and coverage.
>>
>>
>> Exact.
>>
>>> - Change the plugin API in order to get the effective runtime
>>> classpath of the sonar plugin which is the result of maven expression
>>> "${plugin.artifactMap}""
>>
>>
>> Do you think that having the effective classpath is enough to execute tests
>> from sonar ? For example configuration of tests will have to be injected or
>> duplicated.
>>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_
Loading...