I tried to repeat the approach above, but it didn't work for me in this case, maybe I did smth wrong.
I still don't understand you reason of not using "Deploy to container" plugin in order to deploy war files since it offers easier way to deploy war files directly to Tomcat server, but the only reason I see so far, is that maybe you want to deploy a war file to Tomcat 10 or higher versions, because "Deploy to container" plugin supports only versions up to Tomcat 9 version
Anyways, what I did instead was that I used Publish over SSH plugin
Once you install this plugin on Jenkins, you should go to Settings -> System (System Configuration) -> then find configurations of Publish over SSH
In there you should input values according to your Tomcat configuration setups like in this image. Also, if your Tomcat uses password to authenticate via username, don't forget to tick Use password authentication, or use a different key option and enter password. So, if your Tomcat username is admin, password is pass and IP address is 10.2.39.40, it will do ssh [email protected] and pass password behind the scene. Also, don't forget to enter port (default 22) where your server is running.
Next, go to your job (in my case it was Maven project job), then add Send files or execute commands over SSH option in Post Steps. Then enter values like in this image. So, it means that once your war file is built, it will output it to target folder by default and this plugin will search for all war files in target folder and will send it to the server.
BONUS
If this job builds only one war file, then you might need to add the following shell command
mv target/{your war file}*.war target/{your war file}.war
This is needed for file to be renamed from file-1.0.0.war to file.war, removing unneccessary version, so file.war will be delivered to Tomcat server, but make sure to add this execute shell command before executing send over ssh step.
Tutorial right here can give you more details.
Sorry, I can't attach images :/ , because I don't have rights to do so. I hope that this solution can help someone out there.