I am using Tomcat for hosting my Java Web and Web Service applications for a long time now. Mostly for Spring and Grails appli
Is there some best practice or official document that talks about this issue?
I doubt you will find official documents (from the Tomcat developers/community) to support this theory, although it is very valid. I had to prepare one in my previous job, so that the EAR file of the application could be deployed across multiple J2EE containers.
There is one thing in favour though. You can bring up the IBM Redbook titled "WebSphere Application Server V6.1: Classloader Problem Determination" (quite dated, given that WAS 7 is available) which demonstrates how to created shared libraries in WebSphere. On WebSphere, one can create multiple such libraries for applications that require differing versions. On Tomcat, you are the mercy of an administrator who may not know what a class loader is, given that all shared libraries is dumped into $CATALINA_HOME\lib.
The Redbook also has this bit of advice (replace utility file with utility JAR and you have your answer):
Where you should not place utility files
In deciding where best to place your utility files, it is important to recognize that these files should not be included in the WebSphere Application Server’s environment.
For example: app_server_root/lib, app_server_root/lib,/ext* , app_server_root/java (including any subdirectories), or the JVM classpath.
Adding utility files to those directories can cause problems with the WebSphere runtime environment and can cause unexpected results, including the overwriting of WebSphere classes that can be detrimental to the overall functionality of the server.