Sonar-Gerrit Plugin Not reporting Issues in Gerrit - jenkins

I am also facing the same issue with Sonar-Gerrit jenkins plugin. Downloaded it from Jenkins plugins site.Using Sonar-Gerrit plugin 2.2.1, and analysing sonar scan against jenkins workspace.
For a sample,have changed just one file and provided the project base directory to the path of that file, and ran the sonar analysis in issues mode.
Issues are not loaded in Gerrit and jenkins logs say
Report has loaded and contains 759 issues Issues to be commented: 0 Issues to be involved in score calculation: 0 Review has been sent
Have already referred the StackOverflow Page Sonar Gerrit plugin not reporting results. Kindly advice on this

I faced a similar issue and for me the resolution was to point the Project Base Directory to my source folder. If you're using sonar to scan all of your source files then pointing the Project Base directory at only one file I don't think it will like that.

There is a bug in 2.2.1. If you have custom sub-project settings, the filter option "affect changed lines only" is not working correctly and removes all the files from the result. This issue will be fixed in the next release.
For now you can use the plugin without this option (all the issues satisfying severity and is new criteria will be posted to the changed files)
If this does not help, make sure that you have your project settings being set up correctly.
UPD: a new version of plugin with the fix was released

Related

Has the TFS plugin for Jenkins been removed?

I have been using Jenkins with the TFS plugin for several years but after installing Jenkins on a new machine, it seems that the TFS plugin cannot be found in the update center. All the other plugins that I could search for seem to work but not TFS, as if it had been deleted from there. I have tried using both jenkins-lts and jenkins weekly on two separate machines (both macs).
This is the plugin I am talking about: https://github.com/jenkinsci/tfs-plugin
The old wiki page for it also seems to have been removed (I get a HTTP 403 Forbidden reply when trying to access that): http://wiki.jenkins-ci.org/display/JENKINS/Team+Foundation+Server+Plugin and the newer plugin index doesn't seem to know about this plugin: https://plugins.jenkins.io/
I have tried to look on the Jira issue tracker but couldn't find anything that seemed relevant.
Could anyone assist?
Okay so after struggling with this for a while, I figured out what had happened.
There was a security issue for the TFS plugin that hasn't been fixed: https://www.jenkins.io/security/advisory/2020-09-01/#SECURITY-1506
On top of that, it was found that the TFS SDK that is bundled with the plugin is not open source, which goes against Jenkins policy (see INFRA-2751 for more details).
This means that the plugin has been removed from the update center in this commit at the end of October 2020.
If the security issue is acceptable, the plugin can still be installed by downloading the .hpi from Github and then manually install the plugin in Jenkins: Manage Jenkins > Manage Plugins > Advanced > Upload Plugin and select the plugin file downloaded previously (Make sure to have git-plugin installed normally first so all additional dependencies are in place).
Thanks to the people on Jenkins Gitter that reminded me of the security issue as well as #ian-w on here that pointed at the actual problem.
Edit: I edited my answer to include Ian's comment.
2021-08-31: See additional details in this S/O response.

source code management setting not saved in jenkins job configuration

I Installed locally Jenkins 2.224 using war file.
I am trying to set a job to pull files from git as on the screenshot below.
but when I save my job and then click configure again - None radiobutton is selected and all git settings are lost. Did it happen to anyone else? I cannot find what is the reason for this issue.
This is a bug in v2.224 that has been fixed in the subsequent version. Upgrading to the latest version should fix your issue.

Jenkins putting '$' characters in file/folder names, breaking automatic backups

I'm using Jenkins v1.546, hosted on a Windows Server 2008 R2 SP1 machine.
I've set up a fairly simple job for building a Maven Java project. It polls the SCM with no schedule and picks up remote build triggers, requiring an authentication token. It uses Subversion and performs clean checkouts with svn update. Additionally, it has a post-build step that archives some build artifacts (i.e., the resulting WAR and WSDLs).
The issue I'm experiencing is that the builds that it stores on the filesystem itself contain invalid characters in their filenames. This causes our automatic backup process to blow up, it being unable to alter or remove those directories/files with the '$'. I myself cannot move/delete those folders or files either, but if I rename it and remove the $, then things work fine. Oh, and if I try to follow one of these links with the $ in it, it doesn't resolve. None of the other jobs seem to do this - just my job, of course. Anyone know why this may be occurring and what I can do to resolve this?
I've attached multiple screenshots that show the bad filename and my Jenkins job setup. I had to white out some company information. If I can provide any additional information to help troubleshoot this, just let me know.
Also, as an update, I did some additional research, looking through the changelogs for each released version of Jenkins since my version (latest is 1.557). I saw three possible issues in the changelogs that could be related, but it's hard for me to tell. I cannot simply upgrade our Jenkins to test out this theory, since I'll need to provide a reason for upgrading beyond a hunch.
https://issues.jenkins-ci.org/browse/JENKINS-21023
https://issues.jenkins-ci.org/browse/JENKINS-20534
https://issues.jenkins-ci.org/browse/JENKINS-21958
The $ is a perfectly valid character in Windows directory name. You can manually make a folder with it, and delete it without any problems.
The com.company$moduleName syntax is used by Jenkins Maven-style job to separate modules of your build. If you don't see this structure for other people's jobs, it is because they are either not building a Maven job, or they don't have multiple modules in a single job.
What is strange though it that these are symlinks (I don't see that in my environment). It is possible that the location that is referenced by the symlink is deleted, but the link remains. In this case, you would not be able to navigate to that location through the link (this is what you are experiencing)
Is it possible that your backup software is deleting the target directories before deleting the links?
In any case, do a simple dir on the directory with the links to see what they link to. And then verify those target locations exists. If they don't, you need to figure out who/what is deleting the links' targets
Edit:
This seems to be more related to the issue that you are facing. Unfortunately, it's marked as "unresolved"
https://issues.jenkins-ci.org/browse/JENKINS-20725
The issue stems from the fact that the symlinks are referencing to targets with / instead of \
My Maven plugin (not Maven version) is 2.6. See if upgrading your Maven plugin in Jenkins will help you. Also, I am running Maven 3.2.2 from the automatic installers. Try with that, as I don't see symlinks in my modules.

jenkins missing jobs after removal of plugins

I have a Jenkins Server (1.510) on Win 2008 with ~100 jobs.
After installing and then uninstalling the CloudBees (Plugin_1, Plugin_2) set of plugins + restart I have the following issues:
half of the Jobs are now missing.
many plugins are not functioning well, for example the green-balls plugin is not working and also the entry to launch the backup plugin is missing
many built in Jenkins buttons such the new "Credentials" is missing from the "Jenkins Configure" Menu.
Looking at the FS, i still see all the jobs.
I already tried :
Using the reload configuration
Reinstalling the plugins
Reinstalling Jenkins with the same version once again
Still the jobs are missing
Any idea how to solve it?
Thanks,
Doron
When job is loaded, many of the related Java classes get instantiated. If instantiation fails, usually because some plugin has been removed and that class is no longer available at all, then the job is hidden.
I suspect you have accidentally removed some other plugin too.
Note: Before actually doing anything, take full backup! Easiest is to backup entire Jenkins folder, where the jobs, configuration etc reside.
Easiest solution might be to just install Jenkins from scratch, install the plugins you do need (see below for troubleshooting if you're missing some), then copy the jobs subfolder to the new Jenkins. It might be best to do any configuration under Manage Jenkins by hand, but you can also just try copying the related XML config files.
If you are missing a plugin and can't figure out which one, you should look at jenkins.out.log and jenkins.err.log log files and search for exceptions happening after Jenkins is started. That may give you a clue on what plugin you are missing.
You can also try editing the job XML files to remove build steps you identified from the exceptions (remember to take backups first!), then restart Jenkins or select Reload configuration from disk from Manage Jenkins page.
If not solved, but you find relevant-looking exceptions or something else interesting, please update the question with details.
After I upgraded Jenkins, one of my jobs disappeared. I found out that although my job directory still existed, the config.xml file inside had somehow gone missing.
I restored this file from a backup, after updating all the plugins that needed updating, and reloaded the configuration, and the job reappeared in Jenkins.

What does build automatically do for a maven project in eclipse?

We recently converted to maven, I'm really new to it. I've imported the project into eclipse, the "build automatically" by default is on, and I have no idea what it does. Is there a way for me to see the logging message, to configure it so I can make it not to, say, use the default goal, but a different goal every time? BTW, currently, building in CLI is fine, but the resource filtering is not working in eclipse with "build automatically" turned on.
Thanks in advance!
David
If a maven plugin will be executed in an incremental eclipse build depends on the "lifecycle mapping" configuration.
You will find (detailed) information about this topic on the "M2E plugin execution not covered" site.
A quote from this site:
We call these instructions "project build lifecycle
mapping" or simply "lifecycle mapping" because they define how m2e
maps information from project pom.xml file to Eclipse workspace
project configuration and behaviour during Eclipse workspace build.
There are several possibilities how the lifecycle mapping can be configured (in the pom, in m2e extensions, since m2e 1.1 (SNAPSHOT) in metadata provided by the plugin).
You should have a look at this site and hopefully you will be able to setup a configuration/installation that fits your needs.

Resources