0

I am wondering if there is a simple wrapper class/library for the Tomcat Manager application. I am writing a script to deploy my war to a remote instance of Tomcat (hosted on AWS).

I know I can directly use HTTP to communicate with the manager script interface, but I thought this would be a common problem, so I do not want to re-invent the wheel. I found a python solution here, and this question talks about using curl, but I can't find a java solution (which is funny, Tomcat is used by Java developers, not bash developers!) Can someone please point me in the right direction?

4
  • is this what you're looking for? tomcat.apache.org/tomcat-7.0-doc/api/index.html Commented Jul 24, 2017 at 18:06
  • @KarlNicholas No, this is just the documentation for Tomcat source code. Not an actual API Commented Jul 25, 2017 at 3:33
  • Is it bad that one year later, I had the same question and found this post on google? =P Commented Mar 18, 2018 at 16:38
  • Stackoverflow is a knowledge repository, so, no, it's not bad. Might mean you're getting old though .. :) Commented Mar 18, 2018 at 17:12

1 Answer 1

0

I found what I needed in this answer. I can use the Tomcat Ant library. In order to do so, all I need is the catalina-ant.jar from $CATALINA_HOME/lib in my project's dependencies.

org.apache.catalina.ant.DeployTask task = new org.apache.catalina.ant.DeployTask(); task.setUrl("http://localhost:8084/manager"); task.setUsername("managerLogin"); task.setPassword("managerPassword"); task.setPath("/UrlToYourDeploadingProject"); task.setWar(new File("c:/Project.war").getAbsolutePath()); task.execute(); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.