Quantcast

"Fail to decorate" because "unable to find source"

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

"Fail to decorate" because "unable to find source"

ttback
I posted my problem here but it is very urgent for me to get this working so I am posting this to here as well: http://jira.codehaus.org/browse/SONARPLUGINS-2129

The problem seems to be triggered by missing source files in Jenkins workspace but there are files generated from mvn clean install, so I have no idea why it can't find source files. Does it mean like no javascript files in that folder?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "Fail to decorate" because "unable to find source"

ttback
I figured that maybe i need to configure sonar.sources for a Java project with heavy javascript development to point to a different place rather than the src/main/java....but I'm not sure how to configure that parameter in Jenkins Sonar plugin.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "Fail to decorate" because "unable to find source"

David Racodon-2
Hi,

You need to perform two different analyses to analyze the Java source code and the JavaScript one.

You run the Java analysis as you did as it seems to work.
Then, for the JavaScript analysis, you need to override some parameters by adding: -Dsonar.language=js -Dsonar.branch=javascript -Dsonar.sources=PATH_TO_YOUR_JAVASCRIPT_FILES

Regards,

David RACODON | SonarSource
Senior Consultant



On 8 August 2012 03:38, ttback <[hidden email]> wrote:
I figured that maybe i need to configure sonar.sources for a Java project
with heavy javascript development to point to a different place rather than
the src/main/java....but I'm not sure how to configure that parameter in
Jenkins Sonar plugin.



--
View this message in context: http://sonar.15.n6.nabble.com/Fail-to-decorate-because-unable-to-find-source-tp5001755p5001756.html
Sent from the Sonar user mailing list archive at Nabble.com.

---------------------------------------------------------------------
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: "Fail to decorate" because "unable to find source"

Rella
This post was updated on .
Hi,

I followed by your solution to analyze java + javascript project and met one problem.
My project is built by maven. In your solution, I should only make one pom.xml, right? In pom.xml, I didn't define soureDirectory. To analyze java source code, it is OK. But when I analyze javascript source code with "mvn sonar:sonar -Dsonar.language=js -Dsonar.branch=javascript -Dsonar.sources=src/main/js", the sonar result is not correct. There is only unit test metrices. Such as Lines of code and Violations ... weren't showed. Unless I define sourceDirectory in pom.xml. But sourceDirectory didn't support mutiple directory.
How I define one pom.xml for mutiple languages?

Best regards,
Rella

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

Re: "Fail to decorate" because "unable to find source"

David Racodon-2
Hi Rella,

Making it work with one pom is a kind of hack. So I won't go further into it.

The proper way to do it is:
  1. Run your Sonar analysis on the Java code the way you're currently doing it with Maven
  2. Create a sonar-project.properties file for the JavaScript code and run the Sonar analysis using the Sonar Runner. See  https://github.com/SonarSource/sonar-examples/tree/master/projects/languages/javascript/javascript-sonar-runner.

Regards,

David RACODON | SonarSource
Senior Consultant



On 20 August 2012 10:48, Rella <[hidden email]> wrote:
Hi,

I followed by your solution to analyze java + javascript project and met one
problem.
My project is built by maven. In your solution, I should only make one
pom.xml, right? In pom.xml, I didn't define soureDirectory. To analyze java
source code, it is OK. But when I analyze javascript source code with "mvn
sonar:sonar -Dsonar.language=js -Dsonar.branch=javascript
-Dsonar.sources=src/main/js", the sonar result is not correct. There is only
unit test metrices. Such as Lines of code and Violations ... weren't showed.
Unless I define sourceDirectory in pom.xml. But sourceDirectory didn't
support mutiple directory.
How I define one pom.xml for mutiple language?

Best regards,
Rella





--
View this message in context: http://sonar.15.n6.nabble.com/Fail-to-decorate-because-unable-to-find-source-tp5001755p5002069.html
Sent from the Sonar user mailing list archive at Nabble.com.

---------------------------------------------------------------------
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: "Fail to decorate" because "unable to find source"

Rella
Thank you!
Loading...