How to deploy a war to Tomcat? (either ssh or using Tomcat manager)

Does anyone have an example of putting a file (war file to tomcat webapps) via ssh? I followed this tutorial and it failed ( errors when running )

I found another article and using the code there failed as well. I have no clue why nothing works, this should be really simple.

Following this recipe failed as well ( error messages when running ), I can post comments but typically on developer forums there is no response from the author.

This does not work either:

I got error messages when trying this as well:

This does not work either ( something missing )

This should be really simple but there is something missing ( not tested ) in any of the above examples. If you copy it and replace with values relative to your env, it will fail. Why so many bad articles (dzone, stack overflow)?

There might be various reasons to why your deployment failed (also dependent on what kind of deployment method you are using). Can you provide us with a) the method you are using, b) your build code that implements it and c) what exactly is failing (error message, stack trace)?

sure, I tried five examples and none worked. I will have to supply the code for each of the above five failures separately.

It would be helpful to first find out which deployment method is the most suitable to your project before trying to find out why something is failing. The options you mention above all use different ways to deploy an artifact to different container types (embedded vs. managed vs. remote). What I gather from your postings is that you would like to use a managed Tomcat container (an installation on your local machine) that you want to deploy a WAR file to. You also would like to be able to start and stop the container. If that’s what you are trying to do, you might want to get started with the Cargo plugin. Please provide the code you have in place for that option and the error message you are experiencing. A example project on GitHub that we can have a look at would be helpful as well.