Jenkins maven builds fail with 0ms - jenkins

We recently migrated jenkins to the LTS version 1.532.2. Ever since, we have been experiencing problems with maven builds failing frequently and claims the entire build took only 0ms as seen in the build trend.
The maven project plugin itself wasn't upgraded as he latest version had a different issue. The current maven project plugin in use is 2.0
Has anyone experienced this behavior?

Related

Does Maven 3.5.2 supports Java11 builds

In Jenkins, currently there is only JDK8 and maven 3.5.2 installed. I downloaded JDK11 to it. I ran a pipeline project to build a springboot Java11 project and it ran fine using maven 3.5.2. There is no reference to any maven source or target versions in the pom of the project. Currently I don't see any issues with JDK11 with maven 3.5.2 due to simplicity of the project. Any idea if it might cause issues with complex projects? Is it good to update Maven version in Jenkins and the spring boot projects?

Packaging nuget package on VSTS 'Newtonsoft.Json' already has a dependency defined for 'NETStandard.Library'

Packaging a build use Nuget Packager in VSTS and i get the error:
[error]'Newtonsoft.Json' already has a dependency defined for 'NETStandard.Library'.
Most of the hints that solves this involves updating nuget, but since I am building on Team Services I can't really do this.
It seems that the nuget used by nuget packager is not the latest. After testing locally with latest nuget.exe everything worked so I added a new powershell release step. This solution is appropriate for VSTS, for TFS where you have access to the server I recommend upgrading nuget.exe on the server itself:
This script downloads nuget.exe into the artifacts directory (and outputs the path to the nuget.exe so you can see where it is put.).
I then altered the Nuget Packager build step to use the freshly downloaded nuget.exe.
Had the same issue today.
Using your own build agent
If you are using your own build agents (rather than the hosted agent) you can manually update the version of NuGet to the latest version. In my case, this has resolved my problems.
e.g. C:\agent\externals\nuget\nuget.exe
Using the hosted agent
It's a bit messy but you could just upload the latest nuget.exe into the repo and set the NuGet Packager to use this.
To anyone getting this in 2018, Microsoft have created a new version of the NuGet task that fixes this issue. No need for powershell install steps.
Change the NuGet task version in your build step version to 2.*
This caused some breaking changes for me, that I resolved with the following advanced settings
Nuget Restore
Nuget Pack
Nuget push

Eclipse: An internal error occurred during: “Update Hierarchy”

While trying to run the Google cloud dataflow Wordcount example in eclipse referenced here https://cloud.google.com/dataflow/docs/quickstarts/quickstart-java-eclipse
I am getting the following error:
An internal error occurred during: "Update Hierarchy".
Tried to create a TypeHierarchyPipelineOptionsHierarchy for a Java Project 'my project name' where no PipelineOptions type exists
This issue was also faced by somebody else as per the following stackoverflow link:
Eclipse: An internal error occurred during: "Update Hierarchy"
I tried the solution above, the project compiles but it does not run even after Force Update of Snapshots/Releases as explained above.
Based on my research of the problem it looks like google-cloud-dataflow-java-sdk-all-2.0.0-beta1.jar does not have the PipelineRunner class, which is causing the error. The 1.9.0 version of the same jar had those classes.
I cannot use 1.9.0 version of the jar directly because it causes other compilation errors e.g. package change to 'org.apache.beam' instead of 'com.google.cloud.dataflow'
Indeed, there's an issue in the older versions of the Google Cloud Dataflow plugin for Eclipse -- older versions are not forward-compatible with Dataflow SDKs 2.x series, but the project generation may still automatically create a project using the newest 2.x SDK.
To solve the problem, please upgrade to the newest version of the plugin.
Projects generated with versions 1.1.2 of the Dataflow Plugin for Eclipse and earlier will generate projects using the most recent archetype. With the release of Dataflow 2.0.0-beta1, the generated project will use the Apache Beam SDK as an underlying dependency. Modifying the project version to 1.9.0 or earlier will not modify the generated code, which causes the compilation failures you're experiencing.
Version 1.1.3 of the plugin will ensure that any generated project remains within the Dataflow namespace. Future versions will also work forwards-compatibly with Apache Beam. Version 1.1.3 should be available - in Eclipse, go to Help -> Check for Updates (possibly running Perform Setup Tasks to clear the cached current version) should make the updated plugin available.
We have published version 1.1.3 of the Dataflow Plugin for Eclipse; the quickstart example should now function. The project you've generated will not work until a future release of the Dataflow Plugin for Eclipse. Updating the plugin and re-running the quickstart should succeed.

Fail to execute sonar PMD

We are using sonar 4.5.1 and sonar-pmd-plugin is 2.3. From last few days , I am facing issue of "too many open files " Fail to execute PMD. Following file is ignored. I found that issue is fixed in 2.4 but we cannot upgrade the plugin as it would also need upgrade to Sonar 4.5.2 version. Is there any fix or workaround for the issue ? Kindly help. We use Jenkins 1.580, Sonar 4.5.1,Maven 3.0.4.

Technical Debt showing Zero in Sonar

I am using Jenkins for CI and added the sonar plugins for Jenkins. After sonar scan Technical Debt shown Zero.
But actually its is not zero previously was using latest version of sonar there it was showing Technical Debt but after downgrading it is not shown .(Duplicate code ,Lines of code ,complexity are shown)
Below are the version of sonar used
Before Downgrading following version are used (Working fine)
sonar scanner 2.5.1 , Sonar Plugin 2.3 , SonarQube 5.4 , Jenkins version. 1.651
After Downgrading (Technical Debt not shown)
Sonar scanner 2.5, sonar plugin 2.1 , SonarQube 4.5 , Jenkins version 1.651
How this problem can be solved ?
Thanks
Ganesh
I found the reason for this , posting here so that it can be helpful for others.
In latest version of SonarQube 5.4 there is no need to refer to 'binaries' ,from 'src' only Technical Debt will be calculated.But in case of older version 4.5 need to refer binaries also for sonar scan(Because find-bugs requires binaries in new one find bugs are integrated to sonar way profile)
I had the same problem, I missed deleting data/es folder during upgrade process. After deleting the data/es folder and restarting the sonarqube server solved my problem. More information is here

Resources