How to configure Maven local calling Sonar server? - maven

I have a hudson server.
Everytime I build my project on Hudson, It triggers Sonar on other server to building too.
I checked the configuration on Hudson.
I am following some instructions in here , but seems it is not enough.
I have my setting.xml
And I have this issue:
What is wrong with my configuration or I missing something?
Thank.

Related

SonarQube analysis works in IDE but not in Jenkins Pipeline

Which versions am I using (SonarQube, Scanner, Plugin, and any relevant extension):
SonarQube 7.9.1 (on a remote server)
Sonar maven plugin 3.7.0.1746 (in my pom.xml file)
Jenkins 2.222.1 (local server)
Maven 3.6.0
What am I trying to achieve:
I want to perform an analysis with a Jenkins Pipeline with my remote server
What have I tried so far to achieve this :
I have succeed to do an analysis with my IDE (intelliJ) and it works with the command :
mvn -B sonar:sonar
After that, the server note the last analysis with the Quality Gate.
Nevertheless, it does not work with my Jenkins Pipeline.
I do not understand why it works with the IDE and not with Jenkins.
I have put in my pom.xml a sonar.login which is a specific user token. This user has the right to execute an analysis on this particular project. In my ~/.m2/settings.xml, I have put the sonar.host.url.
I also tried to set up manually a SonarQube server in Jenkins (in system configuration). I put there the url and my token thanks to a secret text but it does not work to.
I have also generated a Webhook but this is for the qualitygate variable in the pipeline and I don’t think it matters here.
I don’t know what to test now…
Any idea ?
Thanks
It is ok now : I have added on a sonar installer in the settings. In addition I move the sonar.host.url from ~/.m2/settings.xml to my pom.xml file.

SSH.NET compile Errors through jenkins

I have some issues when try to compile the project using Jenkins. Locally it works fine using SSH.NET, but when I put my code to the windows server 2012R2 and using Jenkins build there. It shows me an error:
"SSH.NET" has already has a dependency defined for "SshNet.Security.Cryptography".
and build fail. Anyone knows what happened in the server side? Why it works locally but has compile errors in the server side?
Thanks
Please check whether your Jenkins installed SSH related plugins. Following screenshot shows the SSH related plugins installed in my Jenkins.
Then please check your Jenkins Configurations whether you configure any SSH related build configurations. In my successful build, I don't choose any SSH related options in build configurations. Please check your Build Configurations based on following screenshot. My project also installed SSH.NET package and it clone from GitHub. Except the project Url and Repositories Url, other options are in the default value.

Unable to get sonar-fortify plugin configured with Jenkins and SonarQube

I have scoured the forums and cannot seem to quite understand the config for the fortify plug-in with Sonar.
I understand it simply builds a widget based on data from a previously generated .fpr file.
My setup:
Maven 3 project
Jenkins 1.606
SonarQube 5.0.1
Sonar-Fortify plug-in 2.0
Prerequisites:
.fpr file is in Jenkins workspace
Sonar is added to pom.xml
sonar-fortify-plug-in v2.0 added to pom.xml - (wasn’t sure this was needed or not)
Sonar server configured in Jenkins
sonar fortify plug-in v2.0 added to Sonar – (only see a dropdown to ‘enableReportLink’ under ‘Configure widgets’
should there be more config somewhere?
Questions:
Where should this property be set? Jenkins Sonar config, Sonar, pom file?
sonar-runner -Dsonar.fortify.reportPath=/path/to/project.fpr
Is that path to the .fpr file where it is within the Jenkins workspace?
The setup instructions on Github seem short and I feel I am missing something specific in my understanding.
Any help or direction to additional documentation is great appreciated.
First of all as documented version 2.0 can not be used anymore. Version 2.1 is going to be released soon. Vote for release will be started this week. Meanwhile you can:
download 2.1-SNAPSHOT version and copy it in extensions/plugins of your SonarQube server installation
restart server. The Fortify rules should be available in the page "Rules".
execute Fortify command "sourceanalyzer", independently from SonarQube. It generates a report file suffixed by .fpr.
execute a standard SonarQube analysis of your project by adding the property sonar.fortify.reportPath, for example:
mvn sonar:sonar -Dsonar.fortify.reportPath=/path/to/project.fpr
sonar-runner -Dsonar.fortify.reportPath=/path/to/project.fpr
If everything works, then you can automate these steps in Jenkins.

Can Jenkins issue a "maven jboss-as:deploy" on my project?

I am trying to use Jenkins and Selenium for CI with my Spring Project that I will be running in AS7.
I would like to know if I can get Jenkins to issue a "maven jboss-as:deploy" command line on my project to deploy it to my AS7 server.
Can someone please let me know if this can be done..
No need to involve Jenkins here. Just add the jboss-as:deploy plugin to your pom.xml, bound to the pre-integration-test phase of your build. Then when you run mvn install (either locally or on Jenkins), your war will be deployed to the AS7 server.

hudson cobertura sonar integration error

I integrate sonar into hudson, but when I build a project using hudson, an error occured
log:
does anyone know how to avoid this error?
thanks in advance~
You have to change the location of you locale maven repository into a different location like c:.m2\ instead c:\Document Settgins etc........This can be done by changing the settings.xml file.
You have reached the limit in Windows...

Resources