Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a maven based application, and it references certain libraries that are marked as provided by my application server, such as:


Now obviously my application server needs to provide version 2.5 of the servlet api. Are there any strategies for ensuring the correct version of the library is being provided the app server (hopefully deployment tests would discover this as well, but I'm hoping to prevent the mismatch in the first place).

share|improve this question

If you are deploying on Linux, you could package your installation as PRM or DEB packages and give them dependencies. Then rpm/dpkg will refuse to install your application if the server is too old. There are good maven modules for creating such packages.

share|improve this answer
My issue here though is more how to ensure that the maven pom specifies the same dependencies that the server will actually be using (and to test it in an automated way). – Jeff Storey Apr 30 '12 at 12:47

The answer is in the question: the pom explicitly says that version 2.5 of the servlet api is "provided", which means pre-installed by someone/something. Maven has been removed from providing/ensuring these dependencies are met (more specifically, the check has been deferred to either runtime or the installer). In this case, the dependencies would be managed & provided by rpm/dpkg (...or macports "port", cygwin's "install.exe"...) or just a conscientious manual download/install. For example, assuming dpkg/rpm/port/etc, your app would be declared to depend on "tomcat-6.x" or "glassfish-3.x" (etc).

You actually could have maven download and package a servlet implementation with your app as a proper maven dependency, but (typically) that's not wanted, unless it is to create a small stand-alone server (e.g., bundled w/ winstone, like jenkins). In some cases, you may actually choose to provide both options: so, the end-user's package manager (yumex, synaptic) would show both your-app-standalone (bundled w/ a server) and your-app-war (just the web app) which would require some app server to also be installed.

share|improve this answer
(originally posted as a comment to the other answer (which I agree with), but my response became too long to fit as a comment.) – michael_n Mar 14 '13 at 5:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.