Upload file from SonarQube dashboard - sonarqube

I am new to SonarQube and developing my own plugin. I am parsing an XML file in my plugin and I have hard coded it but now I want to upload that file from SonarQube dashboard. Is there any way to do this?

Assuming this file is used for user-supplied configuration use properties instead.
You can take a look at the Java plugin for plugin-level configuration, and at Widget Lab for widget-level config.

Related

Automatic OpenAPI YAML generation

I am working on the backend of a Spring Boot application that uses OpenAPI and Swagger to provide the interface for frontend application via an schema.yml file.
When a change is done on the controllers, we use the swagger-ui to get the api-docs JSON, convert it to yaml using the online swagger editor and paste the result in th schema.yml file
Now, I want to automate this so that we can just call a maven task that will automatically generate the yaml file, but I could not find any maven plugin that does this.
Is there a way to automate the generation of the yaml file or do I need to write my own plugin?

Maven Generate OpenAPI JSON for SpringBoot REST Controllers

Is there a Maven plugin which can generate an openapi.json file at build time for my SpringBoot RestControllers?
If not a Maven plugin, is there another simple package to generate the file at build time?
I only want the openapi.json file, I don't want Swagger UIs auto-integrated, etc.
I was able to get this working with SpringDoc.
I couldn't find a project which showed exactly my use-case (without all the swagger ui stuff), so I created an example project on GitHub for others to use as reference: springdoc-maven-plugin-demo
You can use Spring-doc which support OpenAPI 3
Look at the demos

How to configure analyzers in ElasticRay?

I was able to configure it through sense and through pure java... but haven't found any resources to do it using elasticray ... I am using Liferay 6.2
You simply need to change the template.json file located in webs/elasticray-web/docroot/WEB-INF/src/com/rknowsys/portal/search/elastic to suit your changes.
Then you can rebuild the WAR and redeploy it inside Liferay. That will do the job.

Updating KIE Execution Server container with updated rules file

This is where I am at:
I am using Drools 6.2 and calling drools engine remotely via KIE Execution Server running on jboss.
I used workbench to create my initial drl file and fact objects and then used Build & Deploy option of workbench to create and deploy the jar file. I then created the container using the jar file and got the end point that I am using to access the rule engine from my client application. At this point every thing is working fine and I am able to fire the rules remotely.
My requirement is to modify the rules file (.drl) outside the workbench, let's say in notepad and update the container with this new drl file. Is there an easy way to create the jar file programmatically that i can deploy to the central maven repository? I can then run the KIE scanner to look for the latest version of my jar file and automatically update my container. Or is there another recommended way to update the running container with an updated .drl file?
My client application is not in Java so I am not looking for an integrated solution where I can write java code to create the knowledge base and use kie builder to build the drl file.
Is there an easy way to create the jar file programmatically that i can deploy to the central maven repository?
2 options that I can think of, one "easy" and one not so much:
Option 1
Use Maven and the maven drools plugin (you don't have to write Java code, just create your maven project and run mvn package to get a jar. See here: https://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/KIEChapter.html#KIEModuleIntroductionBuildingIntroductionSection
Option 2
A JAR file is simply a zip file with a specified structure. That means that you should be able to update your whatever.drl file, put it in the directory structure that the KIE server expects and deploy it.
For instance, create a directory structure like:
META-INF/kmodule.xml
com/site/project/drools/rules/myrule/SomeRule.drl
Zip those files into somefile.jar and deploy it.

where to place the external java jar when deploy birt report?

I use some java code to retrieve data from database, and export the java code as runnable jar, placed the jar in eclipse\plugins\org.eclipse.birt.report.viewer_3.7.1.v20110905\birt\scriptlib, then in the birt report I can use the jar to get the data. In eclipse all goes smoothly, I can see the correct data in preview.
but when I upload the myreport.rptdesign to the server, I don't know where to place the jar then the report can refer to it. In our team, they use grails to deploy birt report, all I need to do is upload the rptdesign file to a specified server directory, when there's no java jar to refer, that's enough. but when I need to refer to a java jar, I do not know how to deploy.
Please help and thanks a lot.
=========================================================
here is answer of my question. Just put the jar in directory lib of grails. It works!
Did you try to put the jar file in the server/lib directory? What kind of application server are you currently using?

Resources