Customizing and Developing the plugins and pages In SONAR - ruby-on-rails

I started working on SONAR, I have been analyzing the projects and thats going fine. Two questions has raised
If I want to customize the SONAR pages or adding new customized plugins to it, Do I need to have knowledge on RUBY.
Can I get SONAR src distribution,so that I can put it in my say Eclipse workspace and modify and add plugins by my own ?
Need your suggestions,and knowledge.

Sonar plugins are mainly developed in Java (metric computation, code parsing, resource creation, ...), but if you want to extend Sonar UI, then yes you need Ruby on Rails knowledge.
You can find Sonar source on GitHub: https://github.com/SonarSource/sonar.
You can also find the sources of lots of Sonar Plugins on the plugins forge's SVN repository: https://svn.codehaus.org/sonar-plugins/trunk/
And finally, visit the documentation on how to write plugins for Sonar: http://docs.codehaus.org/display/SONAR/Developing+Plugins

Related

pmd plugin is not available in jenkins

pmd plugin is not available in jenkins
Neither it is available on jenkins plugins page
Searching the Jenkins plugin site reveals nothing as observed.
But if you look in GitHub, it shows the following:
This plugin reached end-of-life.
All functionality has been integrated into the Warnings Next
Generation Plugin
and the Static Analysis Model and Parsers
Library.
If you look on the Jenkins plugins site, it shows "forbidden". That suggests it's been pulled and its use discouraged.
Instead, install the Warnings Next Generation Plugin (needs some latest dependencies).
In your job, add a build-step "Records compiler warnings and static analysis results".
Choose "Static Analysis Tool | Tool" [ PMD ]. The default intake is "'**/pmd.xml'".
The plugin's main page gives an overview and notes support for more than hundred report formats. There is additional documentation describing all the extra features.
ps: Perhaps Jenkins needs a better mechanism (WEBSITE-764:Deprecated plugin handling - UX) to handle removed plugins?

Adding in-place plugin to grails 3 project

In grails 2.x, we were allowed to add an in place plugin by adding following in BuildConfig.groovy
grails.plugin.location."my-plugin" = "../my-plugin"
My question is, can we add our local plugins similarly in-place in grails3.0 as well or there is some other way to do this in grails.
Actual purpose is to test the plugin whether it's working properly or not before pushing it to bintray.
Yes, there is. Grails 3 is based on Gradle so multi-project gradle builds solve your issue.
Basically you add dependency as:
compile project(':../my-custom-plugin')
and has to modify settings.gradle to include plugin:
include '../my-custom-plugin'
Check Grails documentation on Plugins and Multi-Project Builds in http://grails.github.io/grails-doc/latest/guide/plugins.html
Other way is to install plugin in local maven repository using gradle publishToMavenLocal command and resolve if from there, before publishing to Bintray or other dependency repository.
Additionally since Grails 3.1.1, reloading is now supported for 'inline' plugins. Check https://github.com/grails/grails-core/releases/tag/v3.1.1 and http://grails.io/post/138665751278/grails-3-gradle-multi-project-builds
It is done using grails { plugins { syntax. Copied from docs:
grails {
plugins {
compile ":hibernate"
compile project(':myplugin')
}
}
This multi-project thing is a bit too big to answer in a short post. I just recently started with it, but, thankfully, I now have the hang of it. There's a tutorial on my site with a plugin handling the domain classes and services and all other sub-projects (just one, a web application in this example) using the plugin. The code is also downloadable. Here's the link: http://www.databaseapplications.com.au/grails-multi-app.jsp Make no mistake, there are a few things to watch out for.

What is the .link_to_grails_plugins folder used for?

Background: I'm just learning Groovy and Grails. I inherited a project from someone who has disavowed themselves of it completely, so I'm basically just thumbing around blindly. I am using the Springsource IDE.
My source had a number of plugin dependencies. I attempted to install these via the plugin manager but one plugin (image-tools) was not available through that medium and needed to be installed separately. I've been unable to install it or the others, as I always end up with build errors which apparently reverts the partial plugin install. While search for references to the image-tools plugin which I could comment out in an attempt to get SOMETHING compiling correctly, I found the .link_to_grails_plugins directory, which seemed to contain the source of all the necessary grails plugins.
Adding this to my classpath and rebuilding seemed to let me make some progress, but I'm not sure if that's what I should actually be doing. Can someone explain to me what this folder is used for? Google hasn't been particularly helpful.
.link_to_grails_plugins is not a standard Grails directory - it has been created by the STS IDE.
The Grails plugins are cached in the grails.project.plugins.dir and grails.global.plugins.dir as described in the documentation for Customizing the Build:
The image-tools plugin documentation indicates that it must be built from the source and provides the instructions for doing so.

How can I easily link sources for dependencies in Grails project in IntelliJ IDEA?

Is there any way to get IDEA to automatically download sources for Grails, my plugins and all the dependencies? Alternately, is there an easy way to get IDEA to pickup sources downloaded by this plugin?
http://www.grails.org/plugin/eclipse-scripts
It puts them under ~/.ivy2/...
IDEA should automatically load all plugins for a Grails project, if the Grails/Griffon plugin is being used.
I see all the Grails plugins for a given project in my Grails View, under Plugins.
If you aren't seeing the files, try right-clicking on the project's name in the Grails View, and choosing Grails > Synchronize Grails settings.
Please note that if you are using the free (community) version of IntelliJ IDEA, it does not include the necessary plugins for working with Grails directly. You must pay for the full version to get it.

PMD with grails project

Does PMD works with grails project, i.e. with .groovy files??
i'm using STS editor,
if it works, what setup i have to do?
Please let me know, if anyone have any idea
Thanks in advance
I'm not aware of any PMD plugin for Groovy/Grails. However, there is a CodeNarc Grails plugin, which does similar kinds of static analysis on Groovy/Grails code.
codeNarc is one of the best choices for grails projects, thou it is ignoring java classes that potentially are part of your project.
I have not seen any pmd or findBugs plugins for grails that would take care of the java portion. You can use the STS/Eclipse PMD plugin thou to analyze explicitly the src/java/ folder.
Unfortunately the findBugs eclipse-plugin is not able to limit to a certain parts of the project so it no big use (findBugs works purely on class files and works through the complete project).
I guess it should be possible to write a grails pmd plugin that would analyze the java parts of a grails project.
Starting with Grails 3, the build system uses Gradle. There is a PMD gradle plugin which you could use to perform static analysis on your java source files. There is also a Codenarc gradle plugin which you can use to perform analysis on the groovy files in your project.
https://docs.gradle.org/current/userguide/pmd_plugin.html

Resources