Skip to content

Commit 3e3779e

Browse files
authored
Fix Gradle deprecation warnings
Removed all deprecations from build.gradle so to remove clutter from gradlew runs Replace deprecated `task` syntax with `tasks.register()` throughout build configuration to address Gradle 9.1.0 deprecation warnings. This modernization enables lazy task configuration and improves build performance by only instantiating tasks when they're actually needed during the build execution. Additionally, update Maven repository declarations to use assignment syntax (`url = 'value'`) instead of the deprecated space-separated syntax in both build.gradle and settings.gradle files. The `generatePom` task has been refactored to use a configuration block with explicit `dependsOn()` method call for clarity.
1 parent f513738 commit 3e3779e

File tree

2 files changed

+37
-35
lines changed

2 files changed

+37
-35
lines changed

build.gradle

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ buildscript {
22
repositories {
33
mavenCentral()
44
gradlePluginPortal()
5-
maven { url 'https://repo.spring.io/milestone' }
6-
maven { url 'https://repo.spring.io/snapshot' }
5+
maven { url = 'https://repo.spring.io/milestone' }
6+
maven { url = 'https://repo.spring.io/snapshot' }
77
}
88
dependencies {
99
classpath 'io.spring.gradle:dependency-management-plugin:1.1.7'
@@ -31,8 +31,8 @@ allprojects {
3131

3232
repositories {
3333
mavenCentral()
34-
maven { url 'https://repo.spring.io/milestone' }
35-
maven { url 'https://repo.spring.io/snapshot' }
34+
maven { url = 'https://repo.spring.io/milestone' }
35+
maven { url = 'https://repo.spring.io/snapshot' }
3636
// maven { url 'https://repo.spring.io/libs-staging-local' }
3737
}
3838

@@ -65,7 +65,9 @@ subprojects { subproject ->
6565
}
6666
}
6767

68-
task generatePom(dependsOn: 'generatePomFileForMavenJavaPublication')
68+
tasks.register('generatePom') {
69+
dependsOn('generatePomFileForMavenJavaPublication')
70+
}
6971

7072
publishing {
7173
publications {
@@ -303,7 +305,7 @@ subprojects { subproject ->
303305
}
304306
}
305307

306-
task cleanTarget(type: Delete) {
308+
tasks.register('cleanTarget', Delete) {
307309
delete 'target'
308310
}
309311

@@ -386,13 +388,13 @@ project('cafe-scripted') {
386388
api "org.apache.logging.log4j:log4j-core:$log4jVersion"
387389
}
388390

389-
task runCafeDemoApp(type: JavaExec) {
391+
tasks.register('runCafeDemoApp', JavaExec) {
390392
mainClass = 'org.springframework.integration.samples.cafe.demo.CafeDemoApp'
391393
args project.hasProperty('lang') ? project.lang : ''
392394
classpath = sourceSets.main.runtimeClasspath
393395
}
394396

395-
task runControlBus(type: JavaExec) {
397+
tasks.register('runControlBus', JavaExec) {
396398
mainClass = 'org.springframework.integration.samples.cafe.demo.ControlBusMain'
397399
classpath = sourceSets.main.runtimeClasspath
398400
}
@@ -412,7 +414,7 @@ project('loan-broker') {
412414
api "org.apache.logging.log4j:log4j-core:$log4jVersion"
413415
}
414416

415-
task runLoanBrokerSharkDetectorDemo(type: JavaExec) {
417+
tasks.register('runLoanBrokerSharkDetectorDemo', JavaExec) {
416418
mainClass = 'org.springframework.integration.samples.loanbroker.demo.LoanBrokerSharkDetectorDemo'
417419
classpath = sourceSets.main.runtimeClasspath
418420
}
@@ -470,7 +472,7 @@ project('amqp') {
470472
runtimeOnly "org.slf4j:slf4j-jcl:$slf4jVersion"
471473
}
472474

473-
task runSimple(type: JavaExec) {
475+
tasks.register('runSimple', JavaExec) {
474476
mainClass = 'org.springframework.integration.samples.amqp.SampleSimple'
475477
classpath = sourceSets.main.runtimeClasspath
476478
standardInput = System.in
@@ -479,7 +481,7 @@ project('amqp') {
479481

480482
}
481483

482-
task runPubConfirmsReturns(type: JavaExec) {
484+
tasks.register('runPubConfirmsReturns', JavaExec) {
483485
mainClass = 'org.springframework.integration.samples.amqp.SamplePubConfirmsReturns'
484486
classpath = sourceSets.main.runtimeClasspath
485487
standardInput = System.in
@@ -510,7 +512,7 @@ project('barrier') {
510512
mainClass = 'org.springframework.integration.samples.barrier.Application'
511513
}
512514

513-
task run(type: JavaExec) {
515+
tasks.register('run', JavaExec) {
514516
mainClass = 'org.springframework.integration.samples.barrier.Application'
515517
classpath = sourceSets.main.runtimeClasspath
516518
}
@@ -586,12 +588,12 @@ project('helloworld') {
586588
api "org.apache.logging.log4j:log4j-core:$log4jVersion"
587589
}
588590

589-
task runHelloWorldApp(type: JavaExec) {
591+
tasks.register('runHelloWorldApp', JavaExec) {
590592
mainClass = 'org.springframework.integration.samples.helloworld.HelloWorldApp'
591593
classpath = sourceSets.main.runtimeClasspath
592594
}
593595

594-
task runPollerApp(type: JavaExec) {
596+
tasks.register('runPollerApp', JavaExec) {
595597
mainClass = 'org.springframework.integration.samples.helloworld.PollerApp'
596598
classpath = sourceSets.main.runtimeClasspath
597599
}
@@ -688,7 +690,7 @@ project('kafka') {
688690
mainClass = 'org.springframework.integration.samples.kafka.Application'
689691
}
690692

691-
task run(type: JavaExec) {
693+
tasks.register('run', JavaExec) {
692694
mainClass = 'org.springframework.integration.samples.kafka.Application'
693695
classpath = sourceSets.main.runtimeClasspath
694696
}
@@ -714,7 +716,7 @@ project('mqtt') {
714716
mainClass = 'org.springframework.integration.samples.mqtt.Application'
715717
}
716718

717-
task run(type: JavaExec) {
719+
tasks.register('run', JavaExec) {
718720
mainClass = 'org.springframework.integration.samples.mqtt.Application'
719721
classpath = sourceSets.main.runtimeClasspath
720722
}
@@ -862,12 +864,12 @@ project('mail') {
862864
api "org.apache.logging.log4j:log4j-core:$log4jVersion"
863865
}
864866

865-
task runGmailInboundPop3AdapterTestApp(type: JavaExec) {
867+
tasks.register('runGmailInboundPop3AdapterTestApp', JavaExec) {
866868
mainClass = 'org.springframework.integration.samples.mail.imapidle.GmailInboundPop3AdapterTestApp'
867869
classpath = sourceSets.main.runtimeClasspath
868870
}
869871

870-
task runGmailInboundImapIdleAdapterTestApp(type: JavaExec) {
872+
tasks.register('runGmailInboundImapIdleAdapterTestApp', JavaExec) {
871873
mainClass = 'org.springframework.integration.samples.mail.imapidle.GmailInboundImapIdleAdapterTestApp'
872874
classpath = sourceSets.main.runtimeClasspath
873875
}
@@ -882,12 +884,12 @@ project('mongodb') {
882884
api "org.mongodb:mongodb-driver-sync:$mongoDriverVersion"
883885
}
884886

885-
task runMongoDbInboundAdapterDemo(type: JavaExec) {
887+
tasks.register('runMongoDbInboundAdapterDemo', JavaExec) {
886888
mainClass = 'org.springframework.integration.samples.mongodb.inbound.MongoDbInboundAdapterDemo'
887889
classpath = sourceSets.main.runtimeClasspath
888890
}
889891

890-
task runMongoDbOutboundAdapterDemo(type: JavaExec) {
892+
tasks.register('runMongoDbOutboundAdapterDemo', JavaExec) {
891893
mainClass = 'org.springframework.integration.samples.mongodb.inbound.MongoDbOutboundAdapterDemo'
892894
classpath = sourceSets.main.runtimeClasspath
893895
}
@@ -901,12 +903,12 @@ project('oddeven') {
901903
api "org.apache.logging.log4j:log4j-core:$log4jVersion"
902904
}
903905

904-
task runCronOddEvenDemo(type: JavaExec) {
906+
tasks.register('runCronOddEvenDemo', JavaExec) {
905907
mainClass = 'org.springframework.integration.samples.oddeven.CronOddEvenDemo'
906908
classpath = sourceSets.main.runtimeClasspath
907909
}
908910

909-
task runIntervalOddEvenDemoTestApp(type: JavaExec) {
911+
tasks.register('runIntervalOddEvenDemoTestApp', JavaExec) {
910912
mainClass = 'org.springframework.integration.samples.oddeven.IntervalOddEvenDemoTestApp'
911913
classpath = sourceSets.main.runtimeClasspath
912914
}
@@ -966,7 +968,7 @@ project('tcp-broadcast') {
966968
mainClass = 'org.springframework.integration.samples.tcpbroadcast.TcpBroadcastApplication'
967969
}
968970

969-
task run(type: JavaExec) {
971+
tasks.register('run', JavaExec) {
970972
mainClass = 'org.springframework.integration.samples.tcpbroadcast.TcpBroadcastApplication'
971973
classpath = sourceSets.main.runtimeClasspath
972974
}
@@ -1267,27 +1269,27 @@ project('retry-and-more') {
12671269
api "org.apache.logging.log4j:log4j-core:$log4jVersion"
12681270
}
12691271

1270-
task runCircuitBreakerDemo(type: JavaExec) {
1272+
tasks.register('runCircuitBreakerDemo', JavaExec) {
12711273
mainClass = 'org.springframework.integration.samples.advice.CircuitBreakerDemo'
12721274
classpath = sourceSets.main.runtimeClasspath
12731275
}
12741276

1275-
task runFileTransferDeleteAfterSuccessDemo(type: JavaExec) {
1277+
tasks.register('runFileTransferDeleteAfterSuccessDemo', JavaExec) {
12761278
mainClass = 'org.springframework.integration.samples.advice.FileTransferDeleteAfterSuccessDemo'
12771279
classpath = sourceSets.main.runtimeClasspath
12781280
}
12791281

1280-
task runFileTransferRenameAfterFailureDemo(type: JavaExec) {
1282+
tasks.register('runFileTransferRenameAfterFailureDemo', JavaExec) {
12811283
mainClass = 'org.springframework.integration.samples.advice.FileTransferRenameAfterFailureDemo'
12821284
classpath = sourceSets.main.runtimeClasspath
12831285
}
12841286

1285-
task runStatefulRetryDemo(type: JavaExec) {
1287+
tasks.register('runStatefulRetryDemo', JavaExec) {
12861288
mainClass = 'org.springframework.integration.samples.advice.StatefulRetryDemo'
12871289
classpath = sourceSets.main.runtimeClasspath
12881290
}
12891291

1290-
task runStatelessRetryDemo(type: JavaExec) {
1292+
tasks.register('runStatelessRetryDemo', JavaExec) {
12911293
mainClass = 'org.springframework.integration.samples.advice.StatelessRetryDemo'
12921294
classpath = sourceSets.main.runtimeClasspath
12931295
}
@@ -1402,7 +1404,7 @@ project('tcp-async-bi-directional') {
14021404
mainClass = 'org.springframework.integration.samples.tcpasyncbi.TcpAsyncBiDirectionalApplication'
14031405
}
14041406

1405-
task run(type: JavaExec) {
1407+
tasks.register('run', JavaExec) {
14061408
mainClass = 'org.springframework.integration.samples.tcpasyncbi.TcpAsyncBiDirectionalApplication'
14071409
classpath = sourceSets.main.runtimeClasspath
14081410
}
@@ -1516,7 +1518,7 @@ project('kafka-dsl') {
15161518
mainClass = 'org.springframework.integration.samples.dsl.kafka.Application'
15171519
}
15181520

1519-
task run(type: JavaExec) {
1521+
tasks.register('run', JavaExec) {
15201522
mainClass = 'org.springframework.integration.samples.dsl.kafka.Application'
15211523
classpath = sourceSets.main.runtimeClasspath
15221524
}
@@ -1553,7 +1555,7 @@ project('file-split-ftp') {
15531555
mainClass = 'org.springframework.integration.samples.filesplit.Application'
15541556
}
15551557

1556-
task run(type: JavaExec) {
1558+
tasks.register('run', JavaExec) {
15571559
mainClass = 'org.springframework.integration.samples.filesplit.Application'
15581560
classpath = sourceSets.main.runtimeClasspath
15591561
}
@@ -1575,7 +1577,7 @@ project('dynamic-tcp-client') {
15751577
mainClass = 'org.springframework.integration.samples.dynamictcp.DynamicTcpClientApplication'
15761578
}
15771579

1578-
task run(type: JavaExec) {
1580+
tasks.register('run', JavaExec) {
15791581
mainClass = 'org.springframework.integration.samples.dynamictcp.DynamicTcpClientApplication'
15801582
classpath = sourceSets.main.runtimeClasspath
15811583
}
@@ -1598,7 +1600,7 @@ project('tcp-with-headers') {
15981600
mainClass = 'org.springframework.integration.samples.tcpheaders.TcpWithHeadersApplication'
15991601
}
16001602

1601-
task run(type: JavaExec) {
1603+
tasks.register('run', JavaExec) {
16021604
mainClass = 'org.springframework.integration.samples.tcpheaders.TcpWithHeadersApplication'
16031605
classpath = sourceSets.main.runtimeClasspath
16041606
}

settings.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ pluginManagement {
22
repositories {
33
gradlePluginPortal()
44
mavenCentral()
5-
maven { url 'https://repo.spring.io/milestone' }
6-
maven { url 'https://repo.spring.io/snapshot' }
5+
maven { url = 'https://repo.spring.io/milestone' }
6+
maven { url = 'https://repo.spring.io/snapshot' }
77
}
88
}
99

0 commit comments

Comments
 (0)