Maven Sonar Plugin that generates HTML - maven

Possibly a ridiculous question. But I'm a total noob with maven and sonar...
I'm using the sonar plugin for maven. It works great.
Using the command "mvn sonar:sonar" it connects to my localhost and I can view everything on port 9000.
What I'm wondering is:
Is it possible to generate all the files (eg. html, css, etc) without connecting to the server at port 9000?
If so, is there a command to do it?
If not :(

No that is not possible. Sonar is designed to have a server with a database and a client pulling the configs from the server and writing the results back to sonar.
If you want a solution without the sonar server you need to configure the maven findbugs plugin, cobertura, pmd and so on by your own and include there output in the maven site.
How this is done for findbugs is explained here:
How to generate a html report for findbugs with Maven 3.x

Related

Java Springboot (Maven) - .jar doesnt package right in Jenkins pipeline

Very complex issue here I cannot figure out... For starters our corporate Jenkins instance has support for both Maven plugin style jobs and pipeline. They have a heavy push on pipeline jobs, and I'm creating a pipeline for our Java Springboot (maven) job.
When this job is executed in the maven plugin style job - it runs fine and produces a jar that is runable and has been working for years.
Upon moving this job to a pipeline configuration scripted job - it will build but is about 24mb smaller than the maven plugin built job. In doing a comparison using WinMerge tool - i find that there are several missing items from this packaged .jar (see screenshot). If a full list of these is requested I can provide, but TLDNR - i've tried several different images for the jenkins agent... which is a dockerized container agent on the Jenkins instance.
WinMerge directory comparison of good vs. bad
I have tried images such as - openjdk1_8, maven:3.6.3-openjdk-8, and several other images - all with the same outcome of the same missing files. This is beyond my experience level to figure out :/ so i'm at your guys mercy! Thanks in advance - let me know if you'd need more info to what would be needed for troubleshooting.

Configure Bamboo to call SonarQube to analyze Servlet Based Java Application

We have one old Servlet based application and we use bamboo for continuous integration and build. Is there any way to call sonarqube to analyze the code. There is one Sonar For Bamboo plug in but that's not for free.
You don't need it. The plugin just let you configure the Sonar steps in a more friendly way and put the configurations about the SonarQube server in the plugin configuration.
What you can do is to install in the Bamboo server (or where the agents are running) the SonarClient for the technology that you want to analyze. And you just need to configure in the properties of that client, the url and credentials of the SonarQube server.
Even you can do this last thing directly when you are running the analyze, using the client parameters.

don't see result on sonar server web page by analyzing eclipse plugin

im trying to analyze a maven project via sonar on eclipse.Everything works fine,but I don't see anything on sonar server web interface.
I checked window>preferences>sonar>servers and it seems
localhost:9000,
test connection:Successfully connected!
but why doesnt seem result on web interface?
As you can read it in the documentation of Sonar Eclipse, you must first make sure that your project has previously been analysed on Sonar (outside of Eclipse).

Bamboo doesn't recognize test in my Spring project

I have a Spring project (Apache CXF, Spring, Hibernate, Maven ...) hosted on BitBucket and I'm trying to use Bamboo as my CI server. My idea is deploying the code directly to Heroku from Bamboo so that deploying time is automated.
I made a plan with a couple of tasks to achieve this. First I have a Source Code Checkout task and a builder task. Both of them are working, code is compiling and test are passing, I can see that in the task log. The problem is that Bamboo doesn't seem to recognize the tests (it marks the task are testless).
I have also tried to create a new JUnit test task and it's even worst. Log shows that everything is working properly but Bamboo marks the plan as a failure after the test task is executed.
Any ideas?
Not sure which version of Bamboo you're using, but in the version that we have, you have to turn on unit test result evaluation on the Builder tab. Please see the attached screenshot, and make sure that this is enabled, and the directory setting is pointing to the directory where Maven Surefire creates the test results (in XML format).

Why use SonarQube plugin for Jenkins rather than simply use maven goal sonar:sonar?

I want to launch SonarQube analysis with Jenkins for a Maven 2 project. I first used the goal sonar:sonar in the build configuration.
But I just found the SonarQube plugin for Jenkins. Why use it? Is it a better practice and why?
You can of course do a simple mvn sonar:sonar, this will work.
On the other side, there's the SonarQube plugin for Jenkins that will make the configuration easier. For instance you will be able to define information about your SonarQube server (URL, DB user and password) or your multiple SonarQube servers in a single place (the configuration section of Jenkins) so that you don't have to repeat it everywhere.
The plugin also offers the ability to run a SonarQube analysis on the fly (without Maven): you just have to provide some mandatory properties (like sonar.projectKey and sonar.projectVersion for instance) and the plugin will start the Java Standalone Runner transparently for you (this is helpful mostly for other languages than Java which don't rely on Maven for their build).
So if you're just making some tests, you don't really need this plugin. But if you're setting up a production instance of Jenkins, then it's best to use the SonarQube plugin.

Resources