Method to prevent copying all jar files in the Global Libraries for web apps?

I have a number of web apps that all use a large set of global libraries. Everything from simple things like commons-cli (used for command-line and config utilities) to large 3rd party libraries like JDBC drivers, Documentum access, and so on. I like using the Global Libraries feature to manage these, but what I don't like is that, every time I build, IJ copies the jar and class files from these libraries into the WEB-INF/lib directory of my web app.

The problem is that I share these libraries across many web applications. So I've modified the classpath of my app server (Tomcat) to include the jar files there, pointing to jar files located outside of the Tomcat directory structure (e.g., Documentum libs are stored in C:\Program Files\Documentum\Shared). I don't NEED the Global Libraries feature to copy the jars over into the WEB-INF/lib directory, and in fact it causes me lots of problems (it's much more difficult to upgrade, is really the biggest, but there's also space concerns when 20 or more MB gets installed with EVERY web app on the server).

Is there any way to specify that the files for a particular global library should NOT be copied over at build time but will be referenced from its indicated location? This would be a huge help for me.

2 comments
Comment actions Permalink

Rick Herrick wrote:

I have a number of web apps that all use a large set of global libraries. Everything from simple things like commons-cli (used for command-line and config utilities) to large 3rd party libraries like JDBC drivers, Documentum access, and so on. I like using the Global Libraries feature to manage these, but what I don't like is that, every time I build, IJ copies the jar and class files from these libraries into the WEB-INF/lib directory of my web app.

The problem is that I share these libraries across many web applications. So I've modified the classpath of my app server (Tomcat) to include the jar files there, pointing to jar files located outside of the Tomcat directory structure (e.g., Documentum libs are stored in C:\Program Files\Documentum\Shared). I don't NEED the Global Libraries feature to copy the jars over into the WEB-INF/lib directory, and in fact it causes me lots of problems (it's much more difficult to upgrade, is really the biggest, but there's also space concerns when 20 or more MB gets installed with EVERY web app on the server).

Is there any way to specify that the files for a particular global library should NOT be copied over at build time but will be referenced from its indicated location? This would be a huge help for me.


Go to Settings/Path, choose your module and J2EE Build Settings there. You should find various options of each inlcuded
library deployment including "do not deploy" one.

--
Maxim Shafirov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Comment actions Permalink

Actually, in 4.5, this is not the way to do it, although trying to do it this way helped me discover how to do it :)

The J2EE Build Settings actually have nothing like what you're talking about. But the Web Module Settings tab does. There's a panel entitled Modules and Libraries to Package. This lists each library included in the application, its packaging method, and its relative path. It's not immediately obvious, but the packaging message column actually consists of drop-down lists. It simply looks like data in a list, but clicking on (e.g.) the defauly Copy files to gives you two other options, Do not package and Link via manifest and copy files to. What I wanted was the Do not package option. That does the trick right there.

Thanks!

0

Please sign in to leave a comment.