| Author |
Organizing jar files into folders within lib
|
John Schretz
Ranch Hand
Joined: Sep 10, 2008
Posts: 171
|
|
My web app is starting to contain a lot of jar files, I would like to add sub directories in the lib folder for my web app. However i am unsure of how to configure the class loader for my app so it reads the sub directories.
I read this: http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html
but i am unclear on how to create the entry so it is per webapp. I am also not sure on how to define the path to my lib directory so I can add the sub directories to the path.
Has anyone done this before?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56157
|
|
|
No. It seems like a waste of time to me. Just dump all the jars into the lib during the automated build and who cares if they're structured or not.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
John Schretz
Ranch Hand
Joined: Sep 10, 2008
Posts: 171
|
|
Bear Bibeault wrote:No. It seems like a waste of time to me. Just dump all the jars into the lib during the automated build and who cares if they're structured or not.
I do agree, i guess its more for my sanity. I have a habit of trying out new jars, then choosing to not use them and leaving them behind. Wouldn't want to bloat the app with jars not being used.
For now i just created a text file with a list of jars that belong to each other and what they are used for. Only thing is I have to now maintain it. I was able to at leas get rid of old jars when i created the list.
|
 |
William P O'Sullivan
Ranch Hand
Joined: Mar 28, 2012
Posts: 860
|
|
Not sure about Tomcat but in JBoss you can tell it in jboss-service.xml where to look for jars..
For instance:
this allows us to put jars and property files in the conf folder without affecting the war.
WP
|
 |
Jayesh A Lalwani
Bartender
Joined: Jan 17, 2008
Posts: 1263
|
|
John Schretz wrote:
Bear Bibeault wrote:No. It seems like a waste of time to me. Just dump all the jars into the lib during the automated build and who cares if they're structured or not.
I do agree, i guess its more for my sanity. I have a habit of trying out new jars, then choosing to not use them and leaving them behind. Wouldn't want to bloat the app with jars not being used.
For now i just created a text file with a list of jars that belong to each other and what they are used for. Only thing is I have to now maintain it. I was able to at leas get rid of old jars when i created the list.
So, you are having managing the jars that are the dependencies of the jars that you use?
It might help if you use maven as your build tool. In maven, you specify only the jars that you are dependent on. It automatically finds out the dependencies' dependencies and downloads them. That way, once you stop using a lib, just remove it from your build file, and it will automatically stop using it (and it's dependencies).
|
 |
 |
|
|
subject: Organizing jar files into folders within lib
|
|
|