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

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?

Related

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.

Sonarqube is Dashboard issue

I have been experiencing one strange issue from past 2 days. I had to setup sonarqube for code analysis and so I did it firstly in my local and then after successfully configuring, I did the same on one remote server. We are using Gradle in between.
All the configuration of sonar on remote machine (where I finally have to setup sonar so everybody can see) are same as in my local sonar instance (Means MySQl DB, Java version, Sonar version ..everything). When I check any project in sonarqube, I can see a number of bugs for my localhost:9000 Sonar but 0 bugs for RemoteServerIP:9000 sonar.
One thing here is, % of Duplications are same on both the IPs, but the rest of the parameters are showing 0 on RemoteServerIP:9000 sonar.
Please check following images:
Sonar instance on my local system with same configuration:-
Sonar instance on my Remote system with same configuration:-
Please let me know what I can do here to resolve the issue.
Thanks in Advance :-)

How to use a certain sonar server in sonar-maven-plugin

I've successfully built up a SonarQube server, and I wrote several custom rules to review the code. Now, I can use the server and custom rule with Jenkins and with Maven only when the code is on the same server.
My question is when I develop maven project on another computer, and I want to use maven build or maven install, how can I still use the certain SonarQube server? Simply add plugins in the pom.xml can't use the SonarQube server I established, and the custom rules I developed are also not taken into effect.
As stated in the docs, you only need to make sure the address of your SonarQube server is available to the analysis. Beyond that, you should provide the token of a user with analysis permissions (and 'create project' permissions if the project doesn't already exist) and analyze away.
Of course, this pre-supposes that your SQ server is visible on your network.

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

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?

Resources