How to run proguard on spring boot 3 application?

I would like to run proguard on a spring boot 3 application. My requirements:

  • I need to build an uber jar.
  • My current uber jar has as many as 200 dependencies. I don’t want to run proguard on each of these dependencies. I only want to run proguard on my main application and the dependencies that I have written.
  • I can either run proguard via Maven plugin or I can run stand-alone as well
  • I am using JDK 21
  • I want to build a Docker image eventually

Can anyone provide guidance with step by step instructions and code on how to accomplish this? When I looked at several sites like (one issue is that they are old):

I was intrigued by the libraryjars section. What is this? With JDK 21 I have many modules under jmods folder. DO I have to list all of them in pom.xml? Why?

Given that I want to build a Docker image, should I be running proguard inside Docker or is it okay to run proguard on the host and then just copy over the jar file to Docker image (as I would do if I were not using proguard)?