According to the Java EE Spec, your .jars are supposed to be deployed to WEB-INF/lib
within your WAR file. I have seen some folks hack the Tomcat classloader to pull from an external directly (especially after Tomcat 5+ removed support for CATALINA_HOME/shared/lib
), but that has its obvious downsides.
I'd suggest looking at changing your deployment process instead of changing the code. You can actually do an "exploded WAR" deployment to appBase
(see Tomcat docs), and only transfer the files that have changed.
I work for Inedo, and I've seen a lot of users do this with BuildMaster. The workflow looks something like this:
- Get Latest from $/MyApp
- Run Ant (build.xml)
- Unzip MyApp.war
- Create Build Artifact
- Stop Tomcat Service
- Deploy Build Artifact to SERVER (/path/appBase)
- Start Tomcat Service
The last step (Deploy Build Artifact) will only deploy the files that changed, which will greatly reduce the time it takes to deploy your 50MB artifact.