If you got a source code of the library, then add it as direct dependency of the microservice project. Either use a module dependency or classpath.
To add a JAR file to an IntelliJ IDEA project, navigate to File > Project Structure, then select Modules and the relevant module. In the Dependencies tab, click the "+" button and choose JARs or directories, select the JAR file, and click OK. You can then view the added JAR file in the "External Libraries" folder.
Detailed Steps:
Open Project Structure: Go to File > Project Structure (or press Ctrl+Alt+Shift+S).
Select Module: Navigate to the Modules section and select the module you want to add the JAR to.
Dependencies Tab: Open the Dependencies tab.
Add JARs or directories: Click the "+" button and choose JARs or directories.
Select JAR File: Locate and select the JAR file you want to add.
Confirm: Click OK to add the JAR file to the module's dependencies.