Grails4 getting out of memory while compiling groovy - groovy

I am getting below out of memory error in my grails4 application after adding more controllers in my workspace.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':cira:compileGroovy'.
GC overhead limit exceeded
so far i have total of 41 controller files in my grails application while adding 42 one i am getting this error while compiling if i remove it and run with existing 41 controllers its working.
Please let me know if you have any solution for this.
Thanks in Advance!

Modify bootRun block of build.gradle as follows
bootRun {
ignoreExitValue true
jvmArgs(
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx4096m')
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive,
System.getProperty(springProfilesActive)
}

Related

bootJar fails after upgrading to Gradle v7.6 (project is already evaluated)

I've updated Gradle to v7.6 and now the task bootJar does not work longer.
This is what I have configured in the past and what was working:
bootJar {
mainClass.set("com.dwiner.app.MainApplication")
from("$appDir/dist/angular/browser") {
into 'static'
}
}
bootJar.dependsOn 'npm_run_buildprod'
It seems that the dependsOn has some troubles now, as it the build keeps crashing with the following message:
org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':bootJar'.
...
Caused by: org.gradle.api.internal.tasks.DefaultTaskContainer$TaskCreationException: Could not create task ':npm_run_buildprod'.
...
Caused by: org.gradle.api.tasks.TaskInstantiationException: Could not create task of type 'NpmTask'.
...
Caused by: org.gradle.api.InvalidUserCodeException: Cannot run Project.afterEvaluate(Closure) when the project is already evaluated.
Update:
It seems that the issue occurs when executing npm_run_buildprod and is not dependent on the dependsOn config.
Any help is appreciated.

node build adding x86_64 and failing on M1 chip?

I am trying to build an application but it fails when setting up the node.
> Task :my-app:nodeSetup FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':my-app:nodeSetup'.
> Could not resolve all files for configuration ':my-app:detachedConfiguration22'.
> Could not find node-16.4.0-darwin-x86_64.tar.gz (org.nodejs:node:16.4.0).
Searched in the following locations:
https://nodejs.org/dist/v16.4.0/node-v16.4.0-darwin-x86_64.tar.gz
it looks like its adding x86_64 to the end of the artifact? and because of that its not finding it in the repository. Any ideas? Please let em know if you need more info.

Gradle task :app:createDebugAndroidTestCoverageReport fails, why?

When I run gradlew createDebugCoverageReport it fails with:
Task :app:connectedDebugAndroidTest
Starting 1 tests on Tablet_Sv2(AVD) - 12
Test results saved as file:/../app/build/outputs/androidTest-results/connected/flavors/app/Tablet_Sv2(AVD)%20-%2012/test-result.pb. Inspect these results in Android Studio by selecting Run > Import Tests From File from the menu bar and importing test-
result.pb.
Task :app:createDebugAndroidTestCoverageReport FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:createDebugAndroidTestCoverageReport'.
A failure occurred while executing com.android.build.gradle.internal.coverage.JacocoReportTask$JacocoReportWorkerAction
Unable to generate Jacoco report
Why?
EDIT:
According to this Answer the app level build.gradle would require
configurations.all{
resolutionStrategy {
eachDependency { details ->
if ('org.jacoco' == details.requested.group) {
details.useVersion "0.8.7"
}
}
}
}

nodejs download fails due to invalid link (Protocol switch unsafe) Liferay 7

failures using Gradle v.6 + Workspace / liferay 7.2 , Here is the stacktrace exception of the first build command ​​​​​:
Task :downloadNode FAILED
Trying to download http://mirrors.lax.liferay.com/nodejs.org/dist/v10.15.1/node-v10.15.1-linux-x64.tar.gz to /home/jenkins/.liferay/mirrors/nodejs.org/dist/v10.15.1/node-v10.15.1-linux-x64.tar.gz.tmp
Trying to download http://nodejs.org/dist/v10.15.1/node-v10.15.1-linux-x64.tar.gz to /home/jenkins/.liferay/mirrors/nodejs.org/dist/v10.15.1/node-v10.15.1-linux-x64.tar.gz.tmp
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':downloadNode'.
Redirection detected from http to https. Protocol switch unsafe, not allowed.
 
Any good FIX, thanks in advance..?
Edit :
problem solved by adding this to the build.gradle:
allprojects {
plugins.withId("com.liferay.node") {
node.global = true
node.nodeUrl = node.nodeUrl.replace("http:", "https:")
System.out.println(node.nodeUrl)
} }

Gradle - won't allow maxHeapSize to be set?

task test(type: Test, overwrite: true, dependsOn: [setupUser]) {
maxHeapSize "3000m"
allJvmArgs "-Xmx3000m"
}
Error:
* What went wrong:
A problem occurred evaluating root project 'myproject'.
> Could not find method allJvmArgs() for arguments [-Xmx3000m] on root project 'myproject'.
No matter what I try, I get heap issues when I run gradle test. I'm using 1.0-milestone-9
The second line (allJvmArgs "-Xmx3000m") is incorrect syntax which explains why Gradle complains. The first line (maxHeapSize "3000m") is fine and I'd be surprised if it didn't work. "3000m" might be too high a value though and could lead to an error when creating the JVM. In any case, look for the following debug output (-d):
[DEBUG] [org.gradle.process.internal.ProcessBuilderFactory] creating process builder for Gradle Worker 1
[DEBUG] [org.gradle.process.internal.ProcessBuilderFactory] in directory /xxx
[DEBUG] [org.gradle.process.internal.ProcessBuilderFactory] with argument#0 = -Xmx300m
...
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Started Gradle Worker 1.

Resources