3

Is there any way to deploy my Java application .war file at root on Tomcat 7 server, using the Deploy plugin for Jenkins?

Currently the app gets deployed at http://server/foo/ if it comes in a file named foo.war.

Jonik
  • 2,961
  • 4
  • 38
  • 48
  • (Also, is there a Stack Exchange site where this question would belong better?) – Jonik Jul 27 '11 at 12:24
  • For now, I used this workaround: move `webapps/ROOT` to another name; do the deployment via Jenkins by executing a shell script that copies the war file under webapps **with the name `ROOT.war`**. Anyway, I'll leave the question open; it would be nice (and less of a hack) to be able to do this with the Deploy plugin. – Jonik Jul 27 '11 at 17:53
  • 2
    Why don't you just generate a war file with the name ROOT.war? – DoubleMalt Jul 29 '11 at 21:29
  • @DoubleMalt: Good point... If that works with the Deploy plugin too, I'm going to feel a little stupid. I'll try it when back at work (in a few weeks). – Jonik Aug 01 '11 at 15:41
  • @Jonik Did you get this to work ? I am tryign to deploy my ROOT.war to tomcat using jenkins. And its not working. – NimChimpsky Jan 25 '12 at 13:36
  • @NimChimpsky, sorry, I still haven't tried deploying "ROOT.war" through the Jenkins Deploy plugin... – Jonik Jan 25 '12 at 13:52
  • @Jonik didn't work for me. And when I rename ROOT.war to something else it succeeds but then does not start the app http://stackoverflow.com/q/9002122/106261 ... ? But you did succesfully deploy with jenkins using FOO.war ? – NimChimpsky Jan 25 '12 at 13:54
  • It's been a while, but yeah, as I wrote in the question: "the app gets deployed at `http://server/foo/` if it comes in a file named `foo.war`" – Jonik Jan 25 '12 at 14:52
  • Why not allow it to sit at /foo/ then use apache to reverse-proxy it, and rewrite it to / – Tom O'Connor Mar 17 '12 at 10:42

1 Answers1

-2

Overly simple solution for any problem such as this:

Set your appBase for the host container to the path you want. (Make sure to turn off autodeploy, etc.)

Doug
  • 646
  • 3
  • 8
  • I changed appBase (with help from [here](http://tomcat.apache.org/tomcat-7.0-doc/config/host.html)) but that doesn't seem to work. That changes the dir under which Tomcat looks for apps to deploy, **but the app still gets deployed at `http://server/foo`**. Also, this breaks `http://server/manager/text/list` that the Deploy plugin depends upon. – Jonik Jul 27 '11 at 12:47