It took me few days to come up with a fully functional pipeline which can build a Spring Boot app and deploy it over SSH.
Especially when there are tutorials for scripted and declarative pipelines which can be pretty confusing for beginners. Here is a simple Jenkins declarative pipeline, set up as a shared library, which deploys Spring Boot application to a target node over SSH.
Feel free to modify it to suit your needs.
Star the gist if I saved you from few head injuries :o)