gradle jacocoTestReport task is failing - jenkins

gradle jacocoTestReport --info
The following error is causing jenkins build failure.
> Task :jacocoTestReport FAILED
Caching disabled for task ':jacocoTestReport' because:
Build cache is disabled
Task ':jacocoTestReport' is not up-to-date because:
Task has failed previously.
[ant:jacocoReport] Loading execution data file C:\Users\*\build\jacoco\test.exec
:jacocoTestReport (Thread[Execution worker for ':',5,main]) completed. Took 0.702 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':jacocoTestReport'.
> Error while creating report

See the documentation: You'll have to add org.gradle.caching=true into file gradle.properties.
And then build the whole project again, so that the previous task's output would have been cached.

Related

FAILURE: Build failed with an exception

I'm trying to run my app from inside Visual studio code, but every time I try i get this error:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:validateSigningDebug'.
java.util.concurrent.ExecutionException: com.android.builder.utils.SynchronizedFile$ActionExecutionException: java.io.IOException: com.android.ide.common.signing.KeytoolException: Failed to create keystore.
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 2s
Exception: Gradle task assembleDebug failed with exit code 1
Although I searched on Google, but I did not get a suitable solution to my problem

Execution failed for task ':website:buildDockerImage'. using gradlew build of apache beam

I need to build apache beam using gradle . ./gradlew build . However, I got the following error :
Execution failed for task ':website:buildDockerImage'. > A problem occurred starting process 'command 'docker''
java version : openjdk version "1.8.0_265"
gradle version : Gradle 5.4
By using --info , I got the following :
Caching disabled for task ':website:buildDockerImage' because:
Caching has not been enabled for the task
Task ':website:buildDockerImage' is not up-to-date because:
Task has not declared any outputs despite executing actions.
Starting process 'command 'docker''. Working directory: /home/namenode/beam/website Command: docker build -t beam-website .
:website:buildDockerImage (Thread[Daemon worker Thread 20,5,main]) completed. Took 0.018 secs.
Closing Git repo: /home/namenode/beam/.git
Closing Git repo: /home/namenode/beam/.git
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':website:buildDockerImage'.
> A problem occurred starting process 'command 'docker''
while --stacktrace outputs :
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':website:buildDockerImage'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:200)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:198)
at org.gradle.process.internal.ExecHandleRunner.startProcess(ExecHandleRunner.java:98)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:71)
... more
Caused by: java.io.IOException: Cannot run program "docker" (in directory "/home/namenode/beam/website"): error=2, No such file or directory
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 7 more
Caused by: java.io.IOException: error=2, No such file or directory
... 8 more
BUILD FAILED in 1s
1 actionable task: 1 executed
[root#namenode beam]# ./gradlew build
Watching the file system is not supported on this operating system.
Configuration on demand is an incubating feature.
> Task :website:buildDockerImage FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':website:buildDockerImage'.
> A problem occurred starting process 'command 'docker''
how can I proceed ?

Grails 3.2.11 plugin bintrayUpload missing grails-plugin.xml

I follow the grails 3 plugin tutorial. I create a project:
https://github.com/fabiooshiro/no-surprises
$ gradle bintrayUpload
> Configure project :
Gradle now uses separate output directories for each JVM language, but this build assumes a single directory for all classes from a source set. This behaviour has been deprecated and is scheduled to be removed in Gradle 5.0
at build_84d0cz3ffyc3w9ul7qh3qjt2t.run(/home/ivt/investtools/no-surprises/build.gradle:17)
The setTestClassesDir(File) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the setTestClassesDirs(FileCollection) method instead.
at build_84d0cz3ffyc3w9ul7qh3qjt2t.run(/home/ivt/investtools/no-surprises/build.gradle:17)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':publishMavenPublicationToMavenLocal'.
> Failed to publish publication 'maven' to repository 'mavenLocal'
> Invalid publication 'maven': artifact file does not exist: '/home/ivt/investtools/no-surprises/build/classes/java/main/META-INF/grails-plugin.xml'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED in 1s
11 actionable tasks: 2 executed, 9 up-to-date

Custom Ant Task Not Working On Build Server

I've got a custom Ant task that I'm using successfully from gradle on my local machine:
task fetchRelMod {
doLast {
println 'Fetching the RelMod'
ant.taskdef(name:'relmod',
classpath:'retrievePBSInfo.jar:hsjt400-4-9.jar',
classname:"com.myco.ant.tasks.RetrievePBSRelModString")
ant.relmod(user:project.ext.props.getProperty('fetchrelmod.username'),
password:project.ext.props.getProperty('fetchrelmod.password'),
prodCode:project.ext.props.getProperty('profile.pbs.product.code'),
branch:project.ext.props.getProperty('profile.pbs.branch'),
state:project.ext.props.getProperty('profile.pbs.relmod.selector'))
project.ext.set('iseries_relmod',ant.relmodStub)
project.ext.set('iseries_relmodAndDate', ant.relmod)
}
}
I've got the jar files sitting next to build.gradle for now, out of simplicity... they exist in the same location on the build server. Works great locally. When I run my build from my build server (either through Jenkins or going on the box and running Gradle directly), I get the following:
sudo /var/lib/jenkins/tools/hudson.plugins.gradle.GradleInstallation/gradle214/bin/gradle all -DisQUABuild=true
Building My App
Loading Properties files...
QUA Build. Using build-qua.props
:fetchRelMod
Fetching the RelMod
:fetchRelMod FAILED
FAILURE: Build failed with an exception.
* Where:
Build file '/var/lib/jenkins/workspace/MyApp/build.gradle' line: 141
* What went wrong:
Execution failed for task ':fetchRelMod'.
> taskdef class com.myco.ant.tasks.RetrievePBSRelModString cannot be found
using the classloader AntClassLoader[/var/lib/jenkins/workspace/myApp/hsjt400-4-9.jar]
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.104 secs
What concerns me is that there are two jar files in the classpath and it only mentions one in the error. Does anyone have any ideas as to what might be going on?

Passing command Line Arguments for grails run-app through gradle task

I have a grails 3 application for which I am trying to pass command line arguments to my application when I am running it through gradle bootRun task.
I want to read the arguments in my config file for runtime operations. As per the grails documentation for yml configration here I tried to add the following to my build.gradle file
run {
systemProperties = System.properties
}
When I add that configuration and run my task I get the following error:
3:11:20 PM: Executing external task 'bootRun -Dcolor=red -Dfruit=apple'...
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\docs\projects\jet\build.gradle' line: 85
* What went wrong:
A problem occurred evaluating root project 'jet'.
> Could not find method run() for arguments [build_6lnm3xriwcnri1zrvfit1niuu$_run_closure8#4446881a] on root project 'jet'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 8.892 secs
Could not find method run() for arguments [build_6lnm3xriwcnri1zrvfit1niuu$_run_closure8#4446881a] on root project 'jet'.
3:11:32 PM: External task execution finished 'bootRun -Dcolor=red -Dfruit=apple'.
Please let me know if there is anything I am missing here or if there is a better way of doing this.
So I find out what the issue was.
Grails 3.0 uses bootRun as target instead of run. Changing adding the below code fixed the issue.
bootRun {
systemProperties = System.properties
}
Hope this helps everyone.

Resources