-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify dependency locking and version def #1024
Conversation
dexamundsen
commented
Oct 3, 2024
•
edited
Loading
edited
- Simplify command for dependency locking by wrapping sub-project tasks within a root task
- Define plugin versions in build.gradle, ensures same version is used across projects
- use Buildscript variables instead of gradle variables. The former is build structure agnostic
- Bump spring boot version from 3.3.3 to 3.3.4; dep management from 1.1.5 to 1.1.6
@@ -3,8 +3,8 @@ plugins { | |||
|
|||
// These plugins are needed to resolve versions of spring dependencies | |||
// transitively added by terra-common-lib | |||
id 'org.springframework.boot' version '3.3.3' | |||
id 'io.spring.dependency-management' version '1.1.5' | |||
id 'io.spring.dependency-management' version "${vSpringDepMgt}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Versions defined as build script variables in build.gradle.
@@ -39,9 +39,9 @@ dependencies { | |||
implementation 'com.nimbusds:nimbus-jose-jwt:9.37.3' | |||
} | |||
|
|||
implementation "org.slf4j:slf4j-api:${gradle.vSlf4jApi}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build script variables do not need gradle qualifier, hence removed in all references
repositories { | ||
mavenCentral() | ||
} | ||
} | ||
|
||
gradle.ext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved up.
@@ -1,22 +1,35 @@ | |||
// Required by spotless. https://github.com/diffplug/spotless/issues/747 | |||
buildscript { | |||
ext { | |||
// plugin versions | |||
vSpringBoot = '3.3.4' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spring boot bumped from 3.3.3 to 3.3.4
dep management plugin bumped from 1.1.5 to 1.1.6
vSwaggerCodegen = '3.0.57' | ||
vPicocliVersion = '4.7.6' | ||
vJunit5 = '5.10.2' | ||
tasks.named('dependencies') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configures a root task dependencies that depends on below subtasks. hence auto triggered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good improvement. It's surprising to me that Gradle doesn't doesn't have a more automatic way to handle this but I don't have much experience with it.