sonarqube
How To Start With SonarQube
- sonarqube pricing? -
There is a free version, it is "community"
- it is not hard -?
Here is the Download Page for SonarQube:
https://www.sonarsource.com/products/sonarqube/downloads/
There is a community, free edition.
do you have any problem with installation?
I think you just have to download it and unzip. Then, in bin directory, find your operating system directory and go into. I'll talk further about windows-x86-64. There is StartSonar.bat file and that is how you'll launch SonarQube on your computer. Click on it.
Sometimes things are not smooth with starting of SonarQube. You might know some of the attempts to solve it:
- maybe antivirus is blocking start
- run as Administrator
- I have Java JDK set on. I'm not sure does SQ need particular Java version, but check is your Java set on, search about versions, you'll figure this out by error messages while SQ is going up
- run .bat file directly from the Command Agent. I use classic Command Prompt so I talk about it. Probably you can use some other
- once I had some issue about Classpath, check if something is there
- Elasticsearch module can make some problems. While you are starting, errors could be connected to Elasticsearch. This was happening to me when I had more versions of SonarQube, probably I didn't end one process and started another, I just got turned off Command prompt window with the first process without stopping it, but first SonarQube process was still running, so another couldn't start? You can somehow turn off this old one and try (Task Manager? I used even XAMMP). If you get this ElasticSearch errors and you are not otherwise able to resolve it, try with restarting of computer and starting wanted SQ then.
These explanations are maybe funny but I have spent few times some amount of time while it didn't start. Whatever error you have, try to Google it and let's hope it'll be resolved.
When SonarQube says that it is up and running or something (wait until you get definitive message) you are ready to turn it on in your browser. Default URL is "localhost:9000", and you can change this port (9000 value) in configuration file. Configuration file is in conf subdirectory.
When you open now SonarQube in your browser, I think you will be asked to create password and maybe some more credentials for admin. If you forget your password, it can be retrieved, but it's not in configuration file, this is more complicated. Password are hashed, so here is a manual from SonarQube's website how to retrieve forgotten password https://docs.sonarsource.com/sonarqube-server/latest/instance-administration/system-functions/security/. So, it's good to remember your password for admin.
Now you are logged in. Next time you start your SonarQube, you will go with you Admin account and its remembered password. We are talking here running it on your computer, in some other situation, there could be other users but I am not going into that. We'll use here Admin, I used it for my exercise.
OK, so we are logged in. In horizontal menu we can notice "Projects", and we should be there. Here you have button "Create project" and choose "Manually". We assume you have some project where you want to perform SQ analyses. We'll do it for Java + Maven project, preferably with tests, although SQ offers other languages and supporting software too. Then you will get some fields to fill in, like name of a project, project key and branch. We are going to keep this simple, so on the next screen choose "Use global setting".
I would have to read and to open SQ to see what are we doing here. I think it's not hard to establish, at least without JaCoco. JaCoco is not hard either but you have to add dependancy. And it can take some time until it works. I used it only on my computer, not in any CI/CD and similar installation. Was my English correct here? I could open comments, not now I think.
Comments