The normal way to deploy code to alfresco is via an "AMP" file. Which is a simply a zip file with some structure containg classes and config. The AMP files are processed by the MMT tool to be merged into the alfresco.war file.
However if you simply want to deploy a JAR then simply stick it onto tomcat's shared lib path. If you are using the alfresco installer then it will already be configured, if not then you need to configure the catalina.properties.
The only way anything should get into the exploded war file is by exploding the war. Don't change libraries or config there since it will simply get over-written the next time the war file explodes.