gradle pact not working after upgrade to gradle 4.8 - gradle

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"

Related

Grails Example applications not working for Angular, Vue and React

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/

Failed to resolve Gradle Mail dependency

The following error comes every time I try to build my Spring Boot Project (using Gradle 6.5):
Execution failed for task ':compileJava'.
Could not resolve all files for configuration ':compileClasspath'.
Could not resolve org.springframework.boot:spring-boot-starter-mail:2.3.0.RELEASE.
Required by:
project :
Could not resolve org.springframework.boot:spring-boot-starter-mail:2.3.0.RELEASE.
Could not parse POM https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-mail/2.3.0.RELEASE/spring-boot-starter-mail-2.3.0.RELEASE.pom
Content is not allowed in prolog.
Could not resolve org.springframework.boot:spring-boot-starter-mail:2.3.0.RELEASE.
Required by:
project : org.springframework.boot:spring-boot-starter-webflux:2.3.0.RELEASE > org.springframework.boot:spring-boot-dependencies:2.3.0.RELEASE
Could not resolve org.springframework.boot:spring-boot-starter-mail:2.3.0.RELEASE.
Could not parse POM https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-mail/2.3.0.RELEASE/spring-boot-starter-mail-2.3.0.RELEASE.pom
Content is not allowed in prolog.
I work in a team and nobody else has the same error an it seems like we all have done the same things. I tried manually setting a library to javax.mail.jar that I've downloaded from the Oracle website but it did not help. The following line is from the build.gradle file where the dependency is added:
implementation 'org.springframework.boot:spring-boot-starter-mail'
Can anyone help me with this?

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

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'

Resources