Gradle 6.8 to 7 version update in a spring-boot application - spring-boot

d:\myProject>gradlew build --warning-mode all
> Task :compileJava UP-TO-DATE
Property 'options.compilerArgumentProviders.apt$0.name' is not annotated with an input or
output annotation. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0.
See https://docs.gradle.org/6.8/userguide/more_about_tasks.html#sec:up_to_date_checks
for more details.
Property 'options.compilerArgumentProviders.apt$0.publicType' is not annotated with an
input or output annotation. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0.
See https://docs.gradle.org/6.8/userguide/more_about_tasks.html#sec:up_to_date_checks
for more details.
I have tried removing the generic plugin (id "net.ltgt.apt") and the IntelliJ (id "net.ltgt.apt-idea") plugin as suggested by #Bjørn Vester(https://www.linkedin.com/in/bjornvester/), but the code is giving same error.
I am trying to update gradle from 6.8 to 7.5 version.
Can anyone help?

First things first,
As #Bjørn Vester said you need to remove the the below lines from build.gradle
id "net.ltgt.apt-eclipse" version "0.21"
id "net.ltgt.apt-idea" version "0.21"
id "net.ltgt.apt" version "0.21"
and add eclipse support by adding below line,
id "com.diffplug.eclipse.apt" version "3.36.2"
and also update the version of
id "com.diffplug.eclipse.apt" to latest.
As on the date of writing this answer the version was 3.36.2

Related

gradle upgrade from 4 to gradle 6.0 - Replacing an existing task that may have already been used by other plugins is not supported

Failed to apply plugin [id 'com.github.jacobono.wsdl']
Could not create task ':party-request-v2-ws:war'.
> Replacing an existing task that may have already been used by other plugins is not supported. Use a different name for this task ('war').
I get the above error for a subproject. May I please have some suggestions as to how to deal with these kind of issues. do I need to replace com.github.jacobono.wsdl plugin?
According to this answer, Gradle prior to 5.1.0 supported replacing tasks. Gradle 5 deprecated this feature and Gradle 6 removed it. I'm afraid you cannot use the com.github.jacobono.wsdl plugin with Gradle 6.

Corda - Gradle Error With Quasar When Upgrading to Corda 4.3

I've updated my build.gradle file to Corda 4.3, however applying this plugin...
apply plugin: 'net.corda.plugins.quasar-utils'
...causes the following error when trying to refresh gradle...
A problem occurred evaluating root project 'template'.
> Failed to apply plugin [id 'net.corda.plugins.quasar-utils']
> Could not create an instance of type net.corda.plugins.QuasarExtension_Decorated.
> No signature of method: org.gradle.api.internal.provider.DefaultPropertyState.convention() is applicable for argument types: (java.lang.String) values: [co.paralleluniverse]
Any ideas what is causing this?
I had the same problem executing Corda 4.4 release. Basically you have to update your gradle version to recognize some dependencies in gradle.
First of all, execute the comand: gradle -version
After that, you have to update your gradle version according to the gradle version supported by your current Corda version. In my case, It is supported by gradle version 5.4.1. So, to execute an upgrade, try this: ./gradlew wrapper --gradle-version 5.4.1
Next, check again your gradle version using ./gradlew --version (in the CorDapp directory)
Finally, you can execute your task. So, in my case I would like to execute a test with heap dump allocating more memory and check an OOM. I execute the follow command:
./gradlew test -Dlog4j.configurationFile=../config/test/log4j2.xml -Dcapsule.jvm.args=["-Xmx10G","-Xms512m","-XX:+UseG1GC","-XX:+HeapDumpOnOutOfMemoryError"]
That is it!
Have you tried with gradle-5.4.1?
Source : https://www.corda.net/blog/corda-version-upgrade-guide/

"unable to resolve class" error after upgrading gradle 3 to gradle 4

Grails version: 3.2.9
Gradle initial version: 3.4.1 (everything works fine with this version)
Gradle upgraded version:4.10.3
Plugin: org.grails.grails-gsp
When I run gradlew war after upgrading gradle version to 4.10.3 I start to get the following error during execution of compileGroovyPages task:
dashboard_gsp.groovy: 2: unable to resolve class com.abnd.CarStatusEnum
# line 2, column 1.
import com.abnd.CarStatusEnum
^
Location of class com.abnd.CarStatusEnum is src/main/groovy/com/abnd/CarStatusEnum in the same project where the build is being run and gradlew war task completes successfully with gradle version 3.4.1. However when I upgrade gradle version to 4.10.3 then I start to get this error. Same happens with gradle version 4.1.
1) Any clue what can be the problem ?
2) Is that a good idea to use gradle version 4.x.x or 5.x.x with grails version 3.x.x as with gradle 5.x.x I start to get even more issues as some grails plugins(like grails-gsp v3.3.2 which is latest stable version) use some features that have been deprecated in gradle 4.x.x and removed from gradle 5.x.x (see the error bellow)?
Failed to apply plugin [id 'org.grails.grails-gsp']
Could not get unknown property 'classesDir' for main classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput.
1) Any clue what can be the problem ?
Yes. The error message is a clue that the GSP compiler can't find the enum class. This is because our plugin isn't compatible with Gradle 4.10.3.
2) Is that a good idea to use gradle version 4.x.x or 5.x.x with
grails version 3.x.x
No. Those Gradle versions are not supported with the version of Grails you are using.
I hope that helps.

Change the version automatically using Gradle Release plugin

I would like to have a new version on every commit in the master branch.
Since I'm using gradle to build, I found 2 nice plugins, Release https://github.com/researchgate/gradle-release/issues/273 and Git Versioner https://github.com/passsy/gradle-gitVersioner-plugin.
I would like to manage daily commits with some version like 1.0.0.BuildNumber. This needs to create a tag in Git and push, but also I need to set the project.version tag with the right version because I need it for the springBoot buildInfo (I'm getting the BuildProperties in Spring to know the version I'm executing on).
When I try to run:
gradlew release -Prelease.useAutomaticVersion=true
It always fall back to 0.0.1 version.
I'm just using the default configuration of the plugin and I got lost ...
I still had the old project.version defined and the plugin was defaulting to that one.

Gradle plugin compatibility - how to find out?

Can Gradle plugins for 1.11+ be expected to work for 2.+, and if not, how can one find out the state of compatibility?
Specifically, I have had success using Gradle 1.11 in a project spring-boot project. When upgrading to Gradle 2.2, I noticed that the spring-boot plugin does not seem to be available, although I haven't found any references to a particular Gradle version in the Spring Boot Gradle documentation (http://docs.spring.io/autorepo/docs/spring-boot/1.2.0.BUILD-SNAPSHOT/reference/html/build-tool-plugins-gradle-plugin.html).
Using Gradle 2.2, I get:
* What went wrong:
A problem occurred evaluating root project 'NN'.
> Failed to apply plugin [id 'spring-boot']
> A problem occurred configuring project ':webapp'.
> Extension of type 'SpringBootPluginExtension' does not exist. Currently registered extension types: [DefaultExtraPropertiesExtension, DefaultArtifactPub
licationSet_Decorated, ReportingExtension_Decorated, DefaultProjectSourceSet_Decorated, DefaultBinaryContainer_Decorated]
It depends on the particular plugin, and would ideally be tested/documented there. 1.x to 2.x was a big jump in terms of the Groovy version used by Gradle, which can cause compatibility issues for plugins implemented in Groovy. Also, 1.x plugins using deprecated or internal APIs may not work in 2.x.

Resources