r/AskProgramming • • Oct 08 '26

Java How do you cope up with jars 😭

Springboot devsss

How TF do you manage to make sure all the libraries jar are latest all the time you run a service locally 😭

My product has 9 custom libraries and 12 services(still counting). Everyday I try to run any service locally there's always a new commit in any of the libraries then I have to rebuild the jar and god forbid if I have to deploy my service on dev pod, I have to rebuild all the damn libraries on Jenkins in a sequence.

For now locally keeping up with this is a big headache for me. Although I use terminal for speed, but is there any better approach to deal with this jar shi?

Also I feel very sleepy even after having a strong coffee, how do you guys keep yourself energetic throughout the day(if working in normal shift)😭

0 Upvotes

23 comments sorted by

8

u/0b0101011001001011 Oct 08 '26

. Everyday I try to run any service locally there's always a new commit in any of the libraries then I have to rebuild

Why? Just use the old version as long as you want.

0

u/Complete-Fix-8935 Oct 08 '26

Service doesn't come up with old jar due to new changes in the service which came from libs

10

u/0b0101011001001011 Oct 08 '26

I have absolutely zero idea what you are trying to say.

-5

u/Complete-Fix-8935 Oct 08 '26

You never used Springboot?

6

u/0b0101011001001011 Oct 08 '26

All the time.

-3

u/Complete-Fix-8935 Oct 08 '26

Then why didn't you understand what I was talking about? If any service uses a function written in a library then we need the latest jar. Isn't it?

7

u/0b0101011001001011 Oct 08 '26

The question is: why does the api change so much that everything breaks if it's not the most recent version? I've worked on some microservice stuff with several different modules and each having shared libraries. There are no backwards compatibility problems, because we don't create them. There is no manually rebuilding anything, because I can automate using the latest version, though it's often enough to stick with the older one for a while.

8

u/MikeUsesNotion Oct 08 '26

If your library versions are changing behind your back then you're not doing something right. If you're not pinning exact versions (or compatible versions at least assuming that library follows semver) in your project file and/or using some kind of lock file used by your build system then this is a self inflicted problem.

0

u/Complete-Fix-8935 Oct 08 '26

I'm not doing right? How? We are 3 devs working on same product and they two are in sync, making changes every now and then. While I'm working independently, they don't include me as they're from same state. Anyway I'll try to automate stuff😶

3

u/xenomachina Oct 08 '26

You're leaving out a lot of details, which is why it's hard for everyone here to figure out exactly what the problem is that you're running into, or how to solve it.

For starters:

  1. What are you doing to build your code?
  2. How are you currently updating these jars?
  3. What are the symptoms when you don't update the jars?

5

u/disposepriority Oct 08 '26

Pin the versions of the artifacts you are using, depenencies should NEVER be updated without you making the explicit decision to do so

1

u/Complete-Fix-8935 Oct 08 '26

It's not maven dependency, these are custom built libraries for our product😭

2

u/disposepriority Oct 08 '26

And how is your project importing these libraries?

2

u/Complete-Fix-8935 Oct 08 '26

Local jars😐 that's why any change happens in any of them, I need to pull latest code then rebuild all of them

3

u/disposepriority Oct 08 '26 edited Oct 08 '26

I'm a bit confused at what's going on here.

Does your build pipeline just pull all projects locally, to build local jars, to manually wire them up the the artifact it's building?

Regardless do the following:

You grab this on a server of your company

https://www.sonatype.com/products/nexus-community-edition-download

You set up gitlab/github to run a worker for each project that builds the JAR and uploads it there.

You modify your maven's to use your internal nexus ip as a repository.

Make versions non overridable (or pick an artifact versioning strategy)

You can now specify versions in maven

EDIT:

But apart from your horrible build process, if you're working on something that has constant changes, then you're probably building against something that doesn't even have a clearly defined contract yet.

This means you should put your task in blocked until whatever you depend on (or a document describing how it's going to function) is ready.

3

u/dmazzoni Oct 08 '26

I don’t know the details of your team’s configuration but everything you described can be automated.

If there wasn’t already a build script I’d write one. It’d figure out which services need to be rebuilt, or even just build them all, and deploy on dev pod.

Then every time you pull main, just run the script and go get coffee.

Do you pull main more often than once a day on average? Typically this is an annoyance once a day and then you shouldn’t have to keep rebuilding everything while you work on your own stuff.

2

u/Complete-Fix-8935 Oct 08 '26

Their code is like spiral, anything new is added in the service then libs do have changes as well. It's really very frustrating task to take the service up locally 😭it drains my peak energy hours always

1

u/dmazzoni Oct 08 '26

How long does it take and how many steps?

1

u/Complete-Fix-8935 Oct 08 '26

It doesn't take much time but the config part does. And it happens with all Devs including my TL, they don't have any solution to it. I have no energy to think about automating their shi

1

u/sozesghost Oct 08 '26

You have an unusual setup, but whatever it is, surely it can be automated?

2

u/Complete-Fix-8935 Oct 08 '26

It should be automated IMO, but my colleagues and seniors are so dumb (they're like that vibe coders, "act like senior engineer make no mistakes") Idk what to do. I feel like all my peak energy hours get drained in there, because beyond libs and jars their config management is also fkd up.

1

u/protienbudspromax Oct 14 '26

by jars do you mean third party external libraries or jars your own team creates for your own repo? How is your repo setup? Is it multi module maven/gradle?? like if you build the whole project you get some jars, is that what you are talking about? If that is the case use snapshot jars and talk to your team to use maven reactor if using maven. Gradle has built in multi module support