Using Jenkins plugin for SonarQube with two different installs and getting unexpected url for the new one - sonarqube

Got two SonarQube install behind a Nginx proxy, slowly upgrading.
Old 4.1 one and a new 4.5 LTS one.
For the 4.1 the url returned is the public facing url in the build result.
For the 4.5 the url is the internal url for the build result.
The Jenkins plugin seems to be configured the same so not sure why the new one is giving the internal url.

In both cases the Jenkins plugin is using the URL that is printed at the end of analysis logs.
Have you properly defined "sonar.core.serverBaseURL" in SQ Server settings?

Related

Jenkins Plugin Manager downloads one fails the rest

Jenkins 2.346.2
java.runtime.version 11+28
Plugin Manager Update Site URL: https://updates.jenkins.io/update-center.json
Since a couple of weeks ago, on Jenkins (running on windows), when trying to update the plug-ins, it always downloads the first one but fails the rest. If I restart Jenkins and try again, the first one that failed before downloads OK; the rest fail.
un.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)
at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380)
From the picture below, JWT for Blue Ocean would download fine after I reboot, and the rest would fail... and so and so...
What is your jenkins version? what is your java version? what url is in Plugin Manager -> advanced -> update site?
Welp, updating Java did the trick... I switched to Amazon Corretto 11.

spring-mvc-404 page not found error in maven project

I have been trying to understand and clone the spring mvc login and registration process. As far as I know I am following the same code and process. Only thing I have changed is database details.0 Which works fine I am able to insert the data into the MySQL (8.0.27) database using test file. I am getting the same error even when I am trying his code I am getting error.
here is my code: https://drive.google.com/drive/folders/1JNkZp_O1Lh0y_1NdZ-A85KI1gfgy0_Em?usp=sharing
here is GitHub code: https://github.com/javabyranjith/spring-framework-mvc/tree/master/springmvc-userlogin
Errors I am getting:
action keyword in form was giving error "element loginProcess is not found"-> so I changed it to the form action then it worked
The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
my questions are
can a different version of Apache Tomcat(10.0.13) server can cause the issue?
since I am using new Eclipse so I have updated the new libraries can this cause the issues?
Please suggest the changes so that I can run this project. Suggest the changes here or directly change it in the google drive folder.
Tomcat 10 does not work with Spring 5. Downgrade to Tomcat 9.
10th has jakarta packages renamed from javax, which spring 5 does not support.
Friendly advice, if you are using code from git, they left versions of stuff like java and tomcat for a reason, and the newest versions like Tomcat 10 and JDK17 went through a lot of changes, so always try with suggested versions and try to migrate them to higher ones. Except for Tomcat 10, you will have to wait for Spring 6 for that.
As for the new eclipse, it does not make any difference, the maven project is still the maven project, src, and pom.xml, the structure remained the same.
First try with suggested versions then you can ramp them up once you are sure that it is working.

Maven build uses an HTTP proxy.. that I haven't configured

I was able to build Maven projects from command line with no issue for as long as I can remember.. But this morning, I am getting some error like it's trying to use the company HTTP proxy to fetch dependencies and it requires authentication.
We have internal Nexus repositories, so I reallyt don't get why all of a sudden, it tries to go outside.
I checked my M2_HOM/conf/settings.xml, and no proxy is defined there. I checked my env variables, and I don't see anything declaring a proxy either.
Where can it possibly get configured then ?
Thanks
OK, after couple of hours of struggle, I found the problem.
2 weeks back, I needed to install locally a Logstash plugin that wasn't available internally. This required me to fiddle here and there with my config, to allow Logstash to actually go through the proxy and fetch the required dependency - and it involved Maven, as I used the ugly workaround given here : https://github.com/elastic/logstash/issues/2851
As explained in the link, I defined the proxy for logstash plugin in $HOME/.m2/settings.xml .. and forgot to remove it after ;-/
I found this by running the build in debug mode (-X option) and this file was referenced at the beginning.

Sonar analysis & report publishing permissions

Is it possible to restrict the publishing of new analysis on a sonar instance. My use case is I created new instance of sonar with the latest version. There are couple of projects configured with the old version. I want to make sure that no project team use old instance of sonar. At server level, is it possible to stop publishing new report.
Also what customization options sonar server gives for its home page. I want to display a custom message with Sonar 5.6 version
Atul
You seem to have stood up two different instances of SonarQube side by side. In doing so, you impose on your teams the requirement to update their CI configuration to point to the new instance.
You should instead replace the old version with the new one. See the Upgrading docs for details.

sonar not working with maven-2.0.9. is there a workaround for /batch_bootstrap error?

I installed sonar-3.7.2 without issue. I have it working properly with oracle. I can analyze maven-3 projects from a client machine on the same network as the sonarqube server.
The docs says it supports maven-3.x and maven-2.2.x. We are in the process of upgrading projects to maven-3 but many of our projects still use maven-2.0.9. I was hoping that the 2.2.x condition was merely due to what people were testing with and not a real limitation but some newly downloaded poms in my artifactory contain the property maven.min.version set to 2.2.1.
I need a version that will work with maven-2.0.9.
I saw a log from one of my coworkers also trying out sonar and it showed maven-2.0.9 was being used successfully. He is using defaults. I am setting up for production.
The error that I get (cleaned up of course):
Caused by: org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [http://myhost:myport/batch_bootstrap/properties?project=mygroupid:myartifactid]. Response code: 400
I have tried sonar 3.7.2, 3.6.3 and 3.5.1 and get the same error in each case. In each case
analyzing a maven-3 project works (to prove everything else is ok)
I have tried adding the webcontext /sonar instead of just /.
I have tried setting the Server base url in the sonarqube server even though I have not tested anything yet related to sending emails.
I saw something about corruption in the local .m2 on another thread. Removing it did not help either.
Any and all suggestions appreciated.
Best Regards, Gord Cody
I think the documentation is quite clear : http://docs.codehaus.org/display/SONAR/Installing+and+Configuring+Maven
SonarQube supports only Maven 2.2.x and 3.x
But my question is : What's the problem to upgrade from maven 2.0.9 to 2.2.x?

Resources