Junit failures related to cobertura with multi-module maven project in jenkins - maven

I am getting below test failures when building the multi-module maven project in jenkins.
JDK version - 1.8.51
junit - 4.12
org.codehaus.mojo/cobertura-maven-plugin - 2.7
powermock-easymock-release-full - 1.6.2
net.sourceforge.cobertura / cobertura - 2.1.1
All the above are latest plugins.
Test failures
Error 1
Error Message
net.sourceforge.cobertura.coveragedata.TouchCollector.registerClass(Ljava/lang/String;)V
Stacktrace
java.lang.NoSuchMethodError: net.sourceforge.cobertura.coveragedata.TouchCollector.registerClass(Ljava/lang/String;)V
Error 2
Error Message
Could not initialize class com.test.it.logging.EventLogHandler
Stacktrace
java.lang.NoClassDefFoundError: Could not initialize class com.test.it.logging.EventLogHandler
Error 3
Error Message
Failed to transform class with name com.test.it.ra.ReportArchiveConfProvider. Reason: cannot find net.sourceforge.cobertura.coveragedata.LightClassmapListener
Stacktrace
java.lang.IllegalStateException: Failed to transform class with name com.test.it.ra.ReportArchiveConfProvider. Reason: cannot find net.sourceforge.cobertura.coveragedata.LightClassmapListener
at
org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:266)
JFYI that it was working fine with JDK 7 and old version plugins. Have anyone faced this issue ? Please help.

I'm not on the same configurations as you, but ran into the same error around LightClassmapListener. I got past the issue by clearing my workspace.
In the jenkins job; click the workspace and select 'Wipe out Current Workspace'

Related

Looking into what's wrong with the Quarkus 1.2.Final and Kogito 0.7.1 project

I am forced not to use Kogito parent bom for reasons I can't explain.
So I got a Maven project which is based on Quarkus 1.2.Final and Kogito 0.7.1, and was able to resolve all the version mismatch issues. The code compiles but fails to run tests. It throws the following error and I do have kogito-ruleunits in my dependencies.
9:18:53,268 ERROR [io.qua.dev.DevModeMain] Failed to start Quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.kogito.deployment.KogitoAssetsProcessor#generateModel threw an exception: java.lang.NoClassDefFoundError: org/kie/kogito/rules/impl/AbstractRuleUnits
I have publish the project on github : https://github.com/mravi786/junk/tree/master/dingo-dmn
You have this issue because you use a version incompatible with Quarkus 1.2.1.
I don't know exactly why you can't use the Kogito BOM but there's definitely some artifact that is not the right version.
Update: Quarkus 1.2.x supports Kogito 0.6.x. Due to the tight integration between the two, you cannot upgrade Kogito like this. If you absolutely need Kogito 0.7.1, you can start playing with Quarkus 1.3.0.Alpha2. We will release CR1 soon and the Final a week after that.

I am getting build failed while running ant sonar. As my sonar server is up

I am getting build failed while doing ant sonar. Now I am working on sonarqube 6.4. I am working in Hybris. I have given my error msg with build.xml part were error I am getting
I have installed new version of Sonarqube but it didn't work for me.
I fetch my whole code again with git but again not work.
Error Message:
BUILD FAILED C:\DukeHybrisNew\hybris\bin\platform\build.xml:82: The following error occurred while executing this line:
C:\DukeHybrisNew\hybris\bin\platform\resources\ant\sonar.xml:89:
java.lang.IllegalStateException: Unable to blame file
src/com/duke/backoffice/service/DukeBackofficeService.java at
org.sonarsource.scm.git.JGitBlameCommand.blame(JGitBlameCommand.java:128) at
org.sonarsource.scm.git.JGitBlameCommand.access$000(JGitBlameCommand.java:44)

gradle pact not working after upgrade to gradle 4.8

I'm getting the below error after upgrading to gradle 4.8
Synchronize Gradle projects with workspace failed due to an error in the referenced Gradle build.
Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.8-bin.zip'.
A problem occurred configuring root project 'wag-doc-text2clip'.
**No signature of method: org.gradle.util.NameValidator.asValidName() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values: [pactVerify_text2clip]**
**org.gradle.tooling.BuildException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.8-bin.zip'.**
at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
Caused by: org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'wag-doc-text2clip'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:109)
at
Caused by: groovy.lang.MissingMethodException: No signature of method: org.gradle.util.NameValidator.asValidName() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values: [pactVerify_text2clip]
at au.com.dius.pact.provider.gradle.PactPlugin$_apply_closure1$_closure3$_closure4.doCall(PactPlugin.groovy:47)
at
Can someone help me please.
Resolved this issue by upgrading the pact plugin.
id "au.com.dius.pact" version "3.6.0-rc.0"
classpath "gradle.plugin.au.com.dius:pact-jvm-provider-gradle_2.12:3.6.0-rc.0"

Why is Gradle NUnit Plugin failing to execute unit tests?

We're using the NUnit plugin for Gradle "id 'com.ullink.nunit' version '1.8'". When we run the NUnit task that executes our unit tests for the project, we get the following error:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':unitTests'.
Lorg/gradle/logging/ProgressLogger;
Stack trace shows ClassNotFoundException for ProgressLogger.
Why are we getting this error and how can we fix it?
Thanks!
The problem was solved after upgrading the Gradle Nunut plugin to the latest version.

SonarRunner Failing in Java 8

I have a java project with build system as Gradle. Recently we migrated to Java 8. After this migration sonarRunner task started failing with the following error :
05:10:51.823 INFO - Execute Findbugs 2.0.3...
05:10:56.502 INFO - Findbugs output report: /pathtoproject/build/sonar/findbugs-result.xml
The following errors occurred during analysis:
Unable to get XClass for java/util/function/BiConsumer
java.lang.ArrayIndexOutOfBoundsException: 1792
I started googling it and found out Findbugs 2.0.3 does not support I need to upgrade it and it was recommended that I should use Sonar server 5.x.x (my current sonar server is 5.4.x). I have some constraints yet I want my sonarRunner to be successful. Here are my constraints :
I can not upgrade the sonar server version (not in my hand)
Can not downgrade Java version.
I tried to search how to just upgrade the findbugs version in SonarRunner plugin that also I could not find. Please help me.

Resources