What’s your specific coding challenge in developing your plugin?
I’m developing a new plugin for JMeter/XML files and need the JMeter engine to be configured in order to access the XML files as POJO objects via JMeter’s own API and next perform analysis on the POJO representation.
I’m running Maven based scan and I’ve tried to provide access to the JMeter’s library folders with both -Dsonar.scanner.javaOpts="-Xbootclasspath/a: and -Dsonar.java.libraries= (although I doubt it can work as the plugin is not a Java one) but no success, I keep seeing java.lang.ClassNotFoundException. It’s strange as I’ve included in the Uber JAR most of the JMeter’s 3rd party dependencies but it doesn’t detect any.
Not sure how to move forward, looks like I’m stuck. Any options/suggestions?
thanks for the quick answer; indeed, there is that project but it does something else and doesn’t rely on the JMeter framework at all, as I understood it simply evaluates the results of a JMeter run based on the JTL file it produces, it aggregates some KPIs and extracts information from this.
So the question remains: is there a possibility to adjust the classpath of the Maven analysis plugin run so it includes additional dependencies? Only the Java Plugin allows this via sonar.java.libraries parameter?
Thanks for the answer; so with Sonar plugin one is tied to the Uber JAR which enforces everything to be under a lib folder inside (unfortunately JMeter has it’s own expected folder structure with lib and lib/ext).
Sorry to insist, but just for the sake of clarity: with Java plugin one has this choice via sonar.java.libraries but other plugins don’t. Is my understanding correct?
Uhm… Are you asking if the Java analyzer has access to the project’s library information needed to fully analyze the code? Yes. And not all of the Java analyzer’s APIs are public.
My communication skills show their limits
In the documentation I can see:
sonar.java.libraries Comma-separated paths to files with third-party libraries (JAR or Zip files) used by your project. Wildcards can be used: sonar.java.libraries=path/to/Library.jar,directory/**/*.jar
As I understand a plugin that relies/extends on/a Java plugin can use this parameter to add to the classpath of the analyzer when running sonar-maven-plugin. This implies those libraries are outside of the Uber JAR created with the help of sonar-packaging-maven-plugin which adds dependencies inside the Uber JAR META-INF/lib folder.
This would allow me to add in the classpath my local JMeter install folder (its lib & lib/ext sub-folders where JAR files can be found) while running the analysis.
I also understand that Java Plugin is the only one allowing such thing; default plugin infrastructure doesn’t allow specifying extra paths other than what’s inside the Uber JAR.
The sonar.java.libraries property tells analysis where to find the libraries of the project being analyzed in order for analysis to fully understand the classes referenced in the project. It is not a way to make additional resources available for use by your plugin.