r/ProgrammerHumor • • 10d ago • Regret 1 Bravo 1

Meme inANutShell

Post image
7.1k Upvotes

134 comments sorted by

View all comments

0

u/[deleted] 9d ago

[deleted] β€” view deleted comment

13

u/JoshDM 9d ago edited 9d ago

Centralize dependency management across projects with a unified Parent POM.

Assuming you, like most, are using Spring Boot. Apply maven and create a common parent pom all your projects will use. Your parent should have spring-boot-dependencies as its parent. Open spring-boot-dependencies.pom and review how it is laid out and how it uses properties to manage versions and dependencyManagement to define dependencies. Do similar in your parent for items Spring does not manage in its parent. Override properties declared in the Spring pom in your pom for items (like netty) which have higher release versions.

Create a baseline project which uses the parent and call mvn versions:display-dependency-updates (and use params which exclude major and minor) to search Nexus / Maven Central for updated versions; don't always trust it. Override properties accordingly. This will save you time searching maven manually for updated versions, but it's fallible.

Organize your properties into "spring overrides" for properties declared in the spring parent, "general overrides" (for dependencies declare that Spring does not manage) and "custom dependencies" (for your in-house jars). Define your general dependencies in the dependencyManagement; this is where you can pre-exclude some dependencies from inclusion.

Keep on top of when Spring Boot Dependencies releases a new version. Save down a copy of that pom and review changes. Update/remove properly overridden "spring overrides" when this happens.

This should get you started.

Remember this is dependencyManagement section, not dependencies. It declares how the dependency is declared, it does not include the dependency.

When you update the parent you update all dependencies on projects you use which refer to the parent version. Reduces overall updates. If a specific project needs a specific version not managed by the parent, either move it to the parent to manage or handle it in the same way locally be separating version as a property. If parent does manage and you need a different version, override the property locally with your declaration of the version.

Remember also mvn dependency:tree exists to track where dependencies come from.

9

u/Desperate-Tomatillo7 9d ago

We don't even have time for CVEs. We are still solving technical debt from the past 5 years.

13

u/AcanthisittaKooky987 9d ago

Create a skill to do all of it for you. Smoke test once in dev. Monitor deploys closely and rollback if shit is whack

8

u/Yodo9001 9d ago

How do you create a skill? Is this some kind of AI stuff?

1

u/LegacyCrew 9d ago

And every day with IA we get more CVEs.

1

u/SquidVischious 9d ago

What language?

1

u/oVtcovOgwUP0j5sMQx2F 9d ago

it needs to be built to handle them in the first place...

0

u/[deleted] 9d ago

[deleted] β€” view deleted comment

1

u/Nedsel 6d ago

Get out of there while you still can, that SS CVE is sinking fast!

1

u/CeeMX 8d ago

Oh boy, my team is only me…

1

u/chaudhary-theodore9 7d ago

Group by advisory, package, and resolved version; retain repo IDs so deduping doesn't hide affected builds.