Quantcast

Sonar Hudson/Jenkins Plugin ignoring Maven profile an using activeByDefault instead

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

Sonar Hudson/Jenkins Plugin ignoring Maven profile an using activeByDefault instead

andrew.thompson
Ive have an issue with the Hudson Sonar Maven Plugin (2.0 but also seemed to be an issue with 1.8.1), when the build runs using the latest plugin I get 0% code coverage reported.

I am using the IBM jdk to build and I know thats not supported,
However I don't think that is the issue as if I run the build outside of hudson I get code coverage percentage.
local command: mvn clean install sonar:sonar -Plocal
hudson command: [goals: clean install]  [profile: build] [sonar plugin checked]

A hunch is that when the plugin runs it ignores that I have specified the 'build' profile in maven and uses instead whatever is set as active in this case 'local'.

        <profile>
            <id>local</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                 <ibm.ws.client.dir>C:/Progra~2/IBM/WebSphere/AppClient</ibm.ws.client.dir>
            </properties>
        </profile>
        <profile>
            <id>build</id>
            <properties>                 
                <ibm.ws.client.dir>C:/Progra~1/IBM/WebSphere/AppClient</ibm.ws.client.dir>
            </properties>
        </profile>

In my surefire configuration i specify the location to the jdk is ibm.ws.client.dir this differs on build and uat as build runs windows server 2003 and local uses windows 7 so the 32bit program files directories differ.

In the logs I get
-------------------------------------------------------  T E S T S ------------------------------------------------------- The system cannot find the path specified. The system cannot find the path specified.As a test I switched the local profile to C:/Progra~1 and it started working,
-------------------------------------------------------  T E S T S -------------------------------------------------------  -------------------------------------------------------  T E S T S ------------------------------------------------------- Running com

So it seems the Sonar Hudson plugin ignores the maven profile (in this case 'build') and uses whatever is set to <activeByDefault>true</activeByDefault> in the pom in my case 'local'

This to me seems like a bug should I raise it and if so where?

I have attached a screengrab of my maven3 configuration in hudson and the sonar setup

Thanks and Regards

Andrew Thompson
Technical Consultant

Office Direct Line: 01795 415811,
Fax: 01795 415819,
Email: [hidden email],

Entity Group Ltd is a limited company registered in England and Wales

Registered number: 2123343.
Registered Office:
980 Cornforth Drive,  
Kent Science Park,  
Sittingbourne,  
Kent,  
ME9 8PX

Web: www.entity.co.uk
Number: GB447183634

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed.

If you have received it in error, please notify the sender immediately
and destroy any copies.

Any views or opinions presented are solely those of the author and
do not necessarily represent those of Entity Group Ltd.
**********************************************************************


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

    http://xircles.codehaus.org/manage_email

maven3.JPG (38K) Download Attachment
sonar.JPG (35K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sonar Hudson/Jenkins Plugin ignoring Maven profile an using activeByDefault instead

andrew.thompson
A follow up to this its not related to active by default it just ignores the profile completely... this is what is shown in the logs (Ive xxxxx'ed out so values):

E:\Hudson\tools\Maven3\bin\mvn.bat -f E:\Hudson\workspace\XXXXXX\pom.xml -e -B sonar:sonar -Dsonar.jdbc.driver=org.h2.Driver -Dsonar.jdbc.url=jdbc:h2:tcp://XXXXX:9092/sonar ******** ******** -Dsonar.host.url=http://xxxxxxxx:9000 -Dsonar.branch=xx

I believe this is lacking the '-Pbuild' so it should be:

E:\Hudson\tools\Maven3\bin\mvn.bat -f E:\Hudson\workspace\XXXXXX\pom.xml -e -B sonar:sonar -Pbuild -Dsonar.jdbc.driver=org.h2.Driver -Dsonar.jdbc.url=jdbc:h2:tcp://XXXXX:9092/sonar ******** ******** -Dsonar.host.url=http://xxxxxxxx:9000 -Dsonar.branch=xx

Thanks and Regards

Andrew Thompson
Technical Consultant

Office Direct Line: 01795 415811,
Fax: 01795 415819,
Email: [hidden email],

Entity Group Ltd is a limited company registered in England and Wales

Registered number: 2123343.
Registered Office:
980 Cornforth Drive,  
Kent Science Park,  
Sittingbourne,  
Kent,  
ME9 8PX

Web: www.entity.co.uk
Number: GB447183634

-----[hidden email] wrote: -----
To: [hidden email]
From: [hidden email]
Date: 10/30/2012 02:43PM
Subject: [sonar-user] Sonar Hudson/Jenkins Plugin ignoring Maven profile an using activeByDefault instead

Ive have an issue with the Hudson Sonar Maven Plugin (2.0 but also seemed to be an issue with 1.8.1), when the build runs using the latest plugin I get 0% code coverage reported.

I am using the IBM jdk to build and I know thats not supported,
However I don't think that is the issue as if I run the build outside of hudson I get code coverage percentage.
local command: mvn clean install sonar:sonar -Plocal
hudson command: [goals: clean install]  [profile: build] [sonar plugin checked]

A hunch is that when the plugin runs it ignores that I have specified the 'build' profile in maven and uses instead whatever is set as active in this case 'local'.

        <profile>
            <id>local</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                 <ibm.ws.client.dir>C:/Progra~2/IBM/WebSphere/AppClient</ibm.ws.client.dir>
            </properties>
        </profile>
        <profile>
            <id>build</id>
            <properties>                 
                <ibm.ws.client.dir>C:/Progra~1/IBM/WebSphere/AppClient</ibm.ws.client.dir>
            </properties>
        </profile>

In my surefire configuration i specify the location to the jdk is ibm.ws.client.dir this differs on build and uat as build runs windows server 2003 and local uses windows 7 so the 32bit program files directories differ.

In the logs I get
-------------------------------------------------------  T E S T S ------------------------------------------------------- The system cannot find the path specified. The system cannot find the path specified.As a test I switched the local profile to C:/Progra~1 and it started working,
-------------------------------------------------------  T E S T S -------------------------------------------------------  -------------------------------------------------------  T E S T S ------------------------------------------------------- Running com

So it seems the Sonar Hudson plugin ignores the maven profile (in this case 'build') and uses whatever is set to <activeByDefault>true</activeByDefault> in the pom in my case 'local'

This to me seems like a bug should I raise it and if so where?

I have attached a screengrab of my maven3 configuration in hudson and the sonar setup

Thanks and Regards

Andrew Thompson
Technical Consultant

Office Direct Line: 01795 415811,
Fax: 01795 415819,
Email: [hidden email],

Entity Group Ltd is a limited company registered in England and Wales

Registered number: 2123343.
Registered Office:
980 Cornforth Drive,  
Kent Science Park,  
Sittingbourne,  
Kent,  
ME9 8PX

Web: www.entity.co.uk
Number: GB447183634

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed.

If you have received it in error, please notify the sender immediately
and destroy any copies.

Any views or opinions presented are solely those of the author and
do not necessarily represent those of Entity Group Ltd.
**********************************************************************
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


[attachment "maven3.JPG" removed by Andrew Thompson/Entity]
[attachment "sonar.JPG" removed by Andrew Thompson/Entity]
---------------------------------------------------------------------
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 Hudson/Jenkins Plugin ignoring Maven profile an using activeByDefault instead

andrew.thompson
 A workaround I have found is to add the -P to the "Additional properties" section in the job's sonar configuration.

Andrew Thompson
Technical Consultant

Office Direct Line: 01795 415811,
Fax: 01795 415819,
Email: [hidden email],

Entity Group Ltd is a limited company registered in England and Wales

Registered number: 2123343.
Registered Office:
980 Cornforth Drive,  
Kent Science Park,  
Sittingbourne,  
Kent,  
ME9 8PX

Web: www.entity.co.uk
Number: GB447183634

-----[hidden email] wrote: -----
To: [hidden email]
From: [hidden email]
Date: 10/30/2012 03:01PM
Subject: Re: [sonar-user] Sonar Hudson/Jenkins Plugin ignoring Maven profile an using activeByDefault instead

A follow up to this its not related to active by default it just ignores the profile completely... this is what is shown in the logs (Ive xxxxx'ed out so values):

E:\Hudson\tools\Maven3\bin\mvn.bat -f E:\Hudson\workspace\XXXXXX\pom.xml -e -B sonar:sonar -Dsonar.jdbc.driver=org.h2.Driver -Dsonar.jdbc.url=jdbc:h2:tcp://XXXXX:9092/sonar ******** ******** -Dsonar.host.url=http://xxxxxxxx:9000 -Dsonar.branch=xx

I believe this is lacking the '-Pbuild' so it should be:

E:\Hudson\tools\Maven3\bin\mvn.bat -f E:\Hudson\workspace\XXXXXX\pom.xml -e -B sonar:sonar -Pbuild -Dsonar.jdbc.driver=org.h2.Driver -Dsonar.jdbc.url=jdbc:h2:tcp://XXXXX:9092/sonar ******** ******** -Dsonar.host.url=http://xxxxxxxx:9000 -Dsonar.branch=xx

Thanks and Regards

Andrew Thompson
Technical Consultant

Office Direct Line: 01795 415811,
Fax: 01795 415819,
Email: [hidden email],

Entity Group Ltd is a limited company registered in England and Wales

Registered number: 2123343.
Registered Office:
980 Cornforth Drive,  
Kent Science Park,  
Sittingbourne,  
Kent,  
ME9 8PX

Web: www.entity.co.uk
Number: GB447183634

-----[hidden email] wrote: -----
To: [hidden email]
From: [hidden email]
Date: 10/30/2012 02:43PM
Subject: [sonar-user] Sonar Hudson/Jenkins Plugin ignoring Maven profile an using activeByDefault instead

Ive have an issue with the Hudson Sonar Maven Plugin (2.0 but also seemed to be an issue with 1.8.1), when the build runs using the latest plugin I get 0% code coverage reported.

I am using the IBM jdk to build and I know thats not supported,
However I don't think that is the issue as if I run the build outside of hudson I get code coverage percentage.
local command: mvn clean install sonar:sonar -Plocal
hudson command: [goals: clean install]  [profile: build] [sonar plugin checked]

A hunch is that when the plugin runs it ignores that I have specified the 'build' profile in maven and uses instead whatever is set as active in this case 'local'.

        <profile>
            <id>local</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                 <ibm.ws.client.dir>C:/Progra~2/IBM/WebSphere/AppClient</ibm.ws.client.dir>
            </properties>
        </profile>
        <profile>
            <id>build</id>
            <properties>                 
                <ibm.ws.client.dir>C:/Progra~1/IBM/WebSphere/AppClient</ibm.ws.client.dir>
            </properties>
        </profile>

In my surefire configuration i specify the location to the jdk is ibm.ws.client.dir this differs on build and uat as build runs windows server 2003 and local uses windows 7 so the 32bit program files directories differ.

In the logs I get
-------------------------------------------------------  T E S T S ------------------------------------------------------- The system cannot find the path specified. The system cannot find the path specified.As a test I switched the local profile to C:/Progra~1 and it started working,
-------------------------------------------------------  T E S T S -------------------------------------------------------  -------------------------------------------------------  T E S T S ------------------------------------------------------- Running com

So it seems the Sonar Hudson plugin ignores the maven profile (in this case 'build') and uses whatever is set to <activeByDefault>true</activeByDefault> in the pom in my case 'local'

This to me seems like a bug should I raise it and if so where?

I have attached a screengrab of my maven3 configuration in hudson and the sonar setup

Thanks and Regards

Andrew Thompson
Technical Consultant

Office Direct Line: 01795 415811,
Fax: 01795 415819,
Email: [hidden email],

Entity Group Ltd is a limited company registered in England and Wales

Registered number: 2123343.
Registered Office:
980 Cornforth Drive,  
Kent Science Park,  
Sittingbourne,  
Kent,  
ME9 8PX

Web: www.entity.co.uk
Number: GB447183634

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed.

If you have received it in error, please notify the sender immediately
and destroy any copies.

Any views or opinions presented are solely those of the author and
do not necessarily represent those of Entity Group Ltd.
**********************************************************************
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


[attachment "maven3.JPG" removed by Andrew Thompson/Entity]
[attachment "sonar.JPG" removed by Andrew Thompson/Entity]
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
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 Hudson/Jenkins Plugin ignoring Maven profile an using activeByDefault instead

Julien HENRY-3
Hi Andrew,

In fact you have found the solution. We don't automatically take the profile parameter from the Maven build section so you have to set it again (if it is necessary) in the Sonar configuration section. This is to allow a different configuration between Maven build and Sonar execution.

Regards,

Julien


De : "[hidden email]" <[hidden email]>
À : [hidden email]
Envoyé le : Mardi 30 octobre 2012 16h09
Objet : Re: [sonar-user] Sonar Hudson/Jenkins Plugin ignoring Maven profile an using activeByDefault instead

A workaround I have found is to add the -P to the "Additional properties" section in the job's sonar configuration.

Andrew Thompson
Technical Consultant

Office Direct Line: 01795 415811,
Fax: 01795 415819,
Email: [hidden email],

Entity Group Ltd is a limited company registered in England and Wales

Registered number: 2123343.
Registered Office:
980 Cornforth Drive, 
Kent Science Park, 
Sittingbourne, 
Kent, 
ME9 8PX

Web: www.entity.co.uk
Number: GB447183634

[hidden email] wrote: -----
To: [hidden email]
From: [hidden email]
Date: 10/30/2012 03:01PM
Subject: Re: [sonar-user] Sonar Hudson/Jenkins Plugin ignoring Maven profile an using activeByDefault instead

A follow up to this its not related to active by default it just ignores the profile completely... this is what is shown in the logs (Ive xxxxx'ed out so values):

E:\Hudson\tools\Maven3\bin\mvn.bat -f E:\Hudson\workspace\XXXXXX\pom.xml -e -B sonar:sonar -Dsonar.jdbc.driver=org.h2.Driver -Dsonar.jdbc.url=jdbc:h2:tcp://XXXXX:9092/sonar ******** ******** -Dsonar.host.url=http://xxxxxxxx:9000 -Dsonar.branch=xx

I believe this is lacking the '-Pbuild' so it should be:

E:\Hudson\tools\Maven3\bin\mvn.bat -f E:\Hudson\workspace\XXXXXX\pom.xml -e -B sonar:sonar -Pbuild -Dsonar.jdbc.driver=org.h2.Driver -Dsonar.jdbc.url=jdbc:h2:tcp://XXXXX:9092/sonar ******** ******** -Dsonar.host.url=http://xxxxxxxx:9000 -Dsonar.branch=xx

Thanks and Regards

Andrew Thompson
Technical Consultant

Office Direct Line: 01795 415811,
Fax: 01795 415819,
Email: [hidden email],

Entity Group Ltd is a limited company registered in England and Wales

Registered number: 2123343.
Registered Office:
980 Cornforth Drive,  
Kent Science Park,  
Sittingbourne,  
Kent,  
ME9 8PX

Web: www.entity.co.uk
Number: GB447183634

[hidden email] wrote: -----
To: [hidden email]
From: [hidden email]
Date: 10/30/2012 02:43PM
Subject: [sonar-user] Sonar Hudson/Jenkins Plugin ignoring Maven profile an using activeByDefault instead

Ive have an issue with the Hudson Sonar Maven Plugin (2.0 but also seemed to be an issue with 1.8.1), when the build runs using the latest plugin I get 0% code coverage reported.

I am using the IBM jdk to build and I know thats not supported,
However I don't think that is the issue as if I run the build outside of hudson I get code coverage percentage.
local command: mvn clean install sonar:sonar -Plocal
hudson command: [goals: clean install]  [profile: build] [sonar plugin checked]

A hunch is that when the plugin runs it ignores that I have specified the 'build' profile in maven and uses instead whatever is set as active in this case 'local'.

        <profile>
            <id>local</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                 <ibm.ws.client.dir>C:/Progra~2/IBM/WebSphere/AppClient</ibm.ws.client.dir>
            </properties>
        </profile>
        <profile>
            <id>build</id>
            <properties>                 
                <ibm.ws.client.dir>C:/Progra~1/IBM/WebSphere/AppClient</ibm.ws.client.dir>
            </properties>
        </profile>

In my surefire configuration i specify the location to the jdk is ibm.ws.client.dir this differs on build and uat as build runs windows server 2003 and local uses windows 7 so the 32bit program files directories differ.

In the logs I get
-------------------------------------------------------  T E S T S ------------------------------------------------------- The system cannot find the path specified. The system cannot find the path specified.As a test I switched the local profile to C:/Progra~1 and it started working,
-------------------------------------------------------  T E S T S -------------------------------------------------------  -------------------------------------------------------  T E S T S ------------------------------------------------------- Running com

So it seems the Sonar Hudson plugin ignores the maven profile (in this case 'build') and uses whatever is set to <activeByDefault>true</activeByDefault> in the pom in my case 'local'

This to me seems like a bug should I raise it and if so where?

I have attached a screengrab of my maven3 configuration in hudson and the sonar setup

Thanks and Regards

Andrew Thompson
Technical Consultant

Office Direct Line: 01795 415811,
Fax: 01795 415819,
Email: [hidden email],

Entity Group Ltd is a limited company registered in England and Wales

Registered number: 2123343.
Registered Office:
980 Cornforth Drive,  
Kent Science Park,  
Sittingbourne,  
Kent,  
ME9 8PX

Web: www.entity.co.uk
Number: GB447183634

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed.

If you have received it in error, please notify the sender immediately
and destroy any copies.

Any views or opinions presented are solely those of the author and
do not necessarily represent those of Entity Group Ltd.
**********************************************************************
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


[attachment "maven3.JPG" removed by Andrew Thompson/Entity]
[attachment "sonar.JPG" removed by Andrew Thompson/Entity]
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



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

    http://xircles.codehaus.org/manage_email




Loading...