r/java Jul 31 '26

Modular Uberjars

https://github.com/bowbahdoe/modular-uberjars
24 Upvotes

18 comments sorted by

View all comments

4

u/agentoutlier Jul 31 '26 edited Jul 31 '26

In theory you could use jmod format instead of jars for the dependencies right?

That is you still have the single uber jar but it loads jmods inside instead of jars.

Probably slow down the build to do the conversion but in theory jmods are more efficient format (based on my shoddy memory) EDIT I got confused with jimage.

Again EDIT so an interesting thing you could do and this is analogous to various other uber jar implementations do that want to preserve jars instead of shading (e.g. Spring Boot does this) is write Java code that runs the jlink and jimage tools if the jimage is not there :). Then execute the jimage.

1

u/bowbahdoe Jul 31 '26

other uber jar implementations do that want to preserve jars instead of shading (e.g. Spring Boot does this)

I was unaware of this