[sonar-dev] Question about correct API dependencies for Java plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[sonar-dev] Question about correct API dependencies for Java plugin

Dorfman, Erik (NIH/OD) [C]

(SonarQube 5.1)  I am trying to write a plugin that will be used to analyze a Java project for our very-enterprise-specific styles, code layout, etc.  I am looking at the “sonar-examples-master/plugins/java-custom-rules”.  It seems to make use of “CheckRegistrar” and other classes in org.sonar.plugins.java.api.  

 

1.       Are these the correct classes for me to use?   I know there were a lot of changes recently with 5.x, and I want to avoid old APIs.

2.       I’m still getting used to Maven: what is the best Maven dependency for pulling them in?

 

Thanks!

Erik

 

 

 

 

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

Re: [sonar-dev] Question about correct API dependencies for Java plugin

Nicolas Peru
Hi Erik,

In fact your question does not relate to SQ api but more to writing custom rules relying on the Java plugin. 
The class you mention and the example are using version of sonar-java-plugin version 3.1, so please make sure you are using at least this version of the plugin. 

1- Yes, those are the correct classes to use. Example is up to date and uses the correct apis.
2- I don't get your question: if you want to know the dependency to rely on, please look at example pom : https://github.com/SonarSource/sonar-examples/blob/master/plugins/java-custom-rules/pom.xml#L23  you have to depend on sonar-java plugin and SQ api. 

Cheers,


Nicolas PERU | SonarSource
Senior Developer
http://sonarsource.com


2015-04-29 19:13 GMT+02:00 Dorfman, Erik (NIH/OD) [C] <[hidden email]>:

(SonarQube 5.1)  I am trying to write a plugin that will be used to analyze a Java project for our very-enterprise-specific styles, code layout, etc.  I am looking at the “sonar-examples-master/plugins/java-custom-rules”.  It seems to make use of “CheckRegistrar” and other classes in org.sonar.plugins.java.api.  

 

1.       Are these the correct classes for me to use?   I know there were a lot of changes recently with 5.x, and I want to avoid old APIs.

2.       I’m still getting used to Maven: what is the best Maven dependency for pulling them in?

 

Thanks!

Erik

 

 

 

 


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

Re: [sonar-dev] Question about correct API dependencies for Java plugin

Finhog
This post has NOT been accepted by the mailing list yet.
This post was updated on .
hi Nicolas,

I have an issue when deploying the sample plugin.
Attached please find the pom and log.

pom.xml

sonar.log

Can you pleas let me know the reason?

Thanks.
Loading...