Why is Gradle NUnit Plugin failing to execute unit tests? - gradle

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.

Related

CI cannot download gradle distribution snapshot

Our CI suddenly fails with the following error message:
$ ./gradlew clean jar --stacktrace -i --no-daemon
Downloading https://services.gradle.org/distributions-snapshots/gradle-6.8-20201019220035+0000-bin.zip
Exception in thread "main" java.io.FileNotFoundException: https://downloads.gradle-dn.com/distributions-snapshots/gradle-6.8-20201019220035+0000-bin.zip
I don't unterstand why the distribution file is not found anymore and how can we fix it? I tried clearing all caches but it fails with the same error.
There was a new gradle release on that day and upgrade the gradle wrapper solved the issue:
./gradlew wrapper --gradle-version 6.8.1
(remember to run this command twice to really update the complete wrapper)

Could not resolve all files for configuration ':_:detachedConfiguration1' when using node plugin on gradle kotlin dsl

I'm trying to integrate Java and npm Builds Using Gradle Kotlin DSL.
I was going through the example dzone article and github example code.
I'm in npm-app project folder and running the command gradle npm_run_build.
$ gradle npm_run_build
Task :npm-app:nodeSetup FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':npm-app:nodeSetup'.
Could not resolve all files for configuration ':npm-app:detachedConfiguration1'.
Could not find org.nodejs:node:10.14.1.
Searched in the following locations:
- https://nodejs.org/dist/v10.14.1/ivy.xml
Required by:
project :npm-app
BUILD FAILED in 810ms
1 actionable task: 1 executed
How can I fix this error?
try switching your node plugin:
plugins {
id "com.github.node-gradle.node" version "1.5.3"
}

Failed to capture snapshot of input files for task

I am newbee to Groovy, Gradle, IntelliJ IDEA, Gradle Plugin Development.
Whenever I click on the publishToMavenLocal, I am getting the following error,
Task :compileGroovy FAILED
FAILURE: Build failed with an exception.
What went wrong: Failed to capture snapshot of input files for task ':compileGroovy' property 'classpath' during up-to-date check. >
Failed to create MD5 hash for file content. Deprecated Gradle features
were used in this build, making it incompatible with Gradle 5.0. BUILD
FAILED in 11s 2 actionable tasks: 2 executed Data error (cyclic
redundancy check)
Can anyone help me resolve this ? This is a pure Gradle plugin developed using Groovy.

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

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'

Sonar runner Exception

While running sonarunner in gradle I am getting below exception:
Execution failed for task ':sonarRunner'.
Fail to request server version
I am running below command from command line:
gradle clean build sonarRunner -
Dsonar.host.url=http://srvsentdev01.lhs-systems.com:9000/
-Dsonar.jdbc.url=jdbc:mysql://srvsentdev01.lhs-systems.com/sonarqube -Dsonar.jdbc.driverClassName=com.mysql.jdbc.Driver -Dsonar.jdbc.username=xxxxx -Dsonar.jdbc.password=xxxxxxxx
where I am going wrong?

Resources