Grails Example applications not working for Angular, Vue and React - spring-boot

I am in the learning process of Grails, and I have gotten the default example application HelloWorld work.
Running, building on Windows with WSL2 in OpenSUSE Leap 15.4.
Grails version 5.2.5
I then proceeded to try different profiles when creating the grails application, with Angular, React and Vue.
These did not go so well. Either something is missing from my configuration, JDK, Gradle, etc., and/or perhaps the generated projects need to be updated to use newer JDK and Gradle.
Perhaps I should report these problems on the Grails Profile GitHub.
https://github.com/grails-profiles/angular/issues
https://github.com/grails-profiles/react/issues
https://github.com/grails-profiles/vue/issues
Web
grails create-app grails-test-web --profile=web
Building and running the application works with both JDK-11/Gradle-7.2 and JDK-17/Gradle-7.6
Angular
grails create-app grails-test-angular --profile=angular
The project was created with Gradle-5.1.1, and I used JDK-11 to build it.
It will not build.
./gradlew bootRun --parallel
FAILURE: Build failed with an exception.
* Where:
Build file '/home/djviking/workspace/grails-test-angular/server/build.gradle' line: 19
* What went wrong:
A problem occurred evaluating project ':server'.
> Failed to apply plugin [class 'org.springframework.boot.gradle.plugin.SpringBootPlugin']
> Spring Boot plugin requires Gradle 6.8.x, 6.9.x, or 7.x. The current version is Gradle 5.1.1
Then I upgraded to Gradle 6.8.1, but that did not work either
> Configure project :server
Cannot resolve reloading agent JAR: Failed to resolve imported Maven boms: Cannot resolve external dependency org.springframework.boot:spring-boot-dependencies:2.7.5 because no repositories are defined.
Required by:
project :server
FAILURE: Build failed with an exception.
* Where:
Build file '/home/djviking/workspace/grails-test-angular/server/build.gradle' line: 19
* What went wrong:
A problem occurred evaluating project ':server'.
> Receiver class grails.util.Environment does not define or inherit an implementation of the resolved method 'abstract java.lang.Object getProperty(java.lang.String)' of interface groovy.lang.GroovyObject.
React
grails create-app grails-test-react --profile=react
The project was created with Gradle-6.9, and I used JDK-11 to build it.
It will not build/start
./gradlew server:bootRun
./gradlew client:start
Cannot resolve reloading agent JAR: Failed to resolve imported Maven boms: Cannot resolve external dependency org.springframework.boot:spring-boot-dependencies:2.7.5 because no repositories are defined.
Required by:
project :server
FAILURE: Build failed with an exception.
* Where:
Build file '/home/svmoe/workspace/grails-test-react/server/build.gradle' line: 20
* What went wrong:
A problem occurred evaluating project ':server'.
> Receiver class grails.util.Environment does not define or inherit an implementation of the resolved method 'abstract java.lang.Object getProperty(java.lang.String)' of interface groovy.lang.GroovyObject.
Vue
grails create-app grails-test-vue --profile=vue
The project was created with Gradle-6.9, and I used JDK-11 to build it.
It will not build the project.
./gradlew server:bootRun
./gradlew client:serve
> Configure project :server
Cannot resolve reloading agent JAR: Failed to resolve imported Maven boms: Cannot resolve external dependency org.springframework.boot:spring-boot-dependencies:2.7.5 because no repositories are defined.
Required by:
project :server
FAILURE: Build failed with an exception.
* Where:
Build file '/home/svmoe/workspace/grails-test-vue/server/build.gradle' line: 20
* What went wrong:
A problem occurred evaluating project ':server'.
> Receiver class grails.util.Environment does not define or inherit an implementation of the resolved method 'abstract java.lang.Object getProperty(java.lang.String)' of interface groovy.lang.GroovyObject.
Works with JDK 17, when I changed Gradle Wrapper to Gradle 7.6
./gradlew server:bootRun
I can access the URL, and I get a JSON structure.
Grails application running at http://localhost:8080 in environment: development
./gradlew client:serve
I can not access the URL from this. Neither on localhost.
App running at:
- Local: http://HOSTNAME:3000/
- Network: http://HOSTNAME:3000/

Related

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"
}

Intellij issue Failed to load script defintions by org.jetbrains.kotlin.idea.core.script.GradleScriptDefintionsContributor

I created a spring boot kotlin project on the spring boot generator page. When I install the project in Intellij none of the dependencies load and I see the error:
Failed to load script definitions by org.jetbrains.kotlin.idea.core.script.GradleScriptDefinitionsContributor
I have gradle and kotlin installed.

gradle issue after distribution 4.10.2

I follow all recommandation to make migration of androidX
but when I change distribution
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
I have this error
The Gradle project does not define a task suitable for the requested build.
Review the android/app/build.gradle file and ensure it defines a debug build type.
FAILURE: Build failed with an exception.
* What went wrong:
Task 'null' not found in root project 'android'.
I don't know what to do

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"

Gradle Plugin Test Project Build Failing

I downloaded the gradle plugin test project from their github here:
https://github.com/gradle/gradle/tree/master/subprojects/docs/src/samples/customPlugin
I also updated gradle to latest (4.7).
When I gradle build the consumer project, I get the following build error:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'consumer'.
Could not resolve all artifacts for configuration ':classpath'.
Could not find org.gradle:customPlugin:1.0-SNAPSHOT.
Searched in the following locations:
file:/C:/Code/gradle/subprojects/docs/src/samples/customPlugin/repo/org/gradle/customPlugin/1.0-SNAPSHOT/maven-
metadata.xml
file:/C:/Code/gradle/subprojects/docs/src/samples/customPlugin/repo/org/gradle/customPlugin/1.0-SNAPSHOT/custom
Plugin-1.0-SNAPSHOT.pom
file:/C:/Code/gradle/subprojects/docs/src/samples/customPlugin/repo/org/gradle/customPlugin/1.0-SNAPSHOT/custom
Plugin-1.0-SNAPSHOT.jar
Required by:
project :
What's the issue here? I guess I don't understand gradle plugins enough. Does the plugin need to be built somehow? I have no 1.0-SNAPSHOT pat or anything of the sort, which seems to be where its looking.
Does the plugin need to be built somehow ?
Yes, at first, otherwise the consumer project won't find it.
Inside the plugin project, just run gradle uploadArchive
And then retry a gradle build inside the consumer project

Resources