Take the 2-minute tour ×

It turns out to be pretty easy to get php running in my glassfish application. I've downloaded Quercus 4.0.18 from here: http://caucho.com/download/quercus-4.0.18.war, unpacked the war file and copied the 4 jar files from the WEB-INF/lib to my glassfish/domains/domain1/lib directory.

With the addition of a couple of lines to web.xml I have been able to serve a hello world php file:


My question is what do I need to add to the pom.xml in order to add the required dependencies to my maven project and avoid messing about with unpacking war files etc...? I've not been using maven for long and am generally boggle eyed at anything other than the simplest configuration, so the simpler the answer the better for me.


share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

It is a simple matter of your Maven project expressing a dependency on the 4 JARs that you manually copied into the WEB-INF/lib. Say the 4 JARs that you copied were

  • quercus-A-4.18.jar
  • quercus-B-4.18.jar
  • quercus-C-4.18.jar and
  • quercus-D-4.18.jar

In the dependencies section of your POM you would then add a dependency on these JARs. Something like:

  <groupId>com.caucho.quercus</groupId>    <-- Confirm the correct value
  <artitfactId>quercus-A<artifactId>       <-- Replace with artifacts A - D.

What you need to do is locate a Maven repository (at Caucho maybe) that hosts these 4 JARs. If this repository isn't already in your POM (or your settings.xml) you would add it:(From docs)

    <name>Quercus Maven repository</name>

On the other hand say a public repository is not available. Then -- as a last resort -- you can place these 4 JARs in your local repository (the one your home directory). This is a workaround if you are the only developer. If you are working with a team that will also need these JARs or you have a continuous integration server that is going to do a build you will want to host a repository on a shared (networked) location.

Of course if you go the route of hosting these JARs you are responsible for keeping them up-to-date.

share|improve this answer
Thanks, that's a good answer for me, I'll give it a try. –  Oversteer Dec 29 '11 at 21:41
add comment

Your Answer


