This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Starting and stopping tomcat6 with maven before/after deploy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Starting and stopping tomcat6 with maven before/after deploy" Watch "Starting and stopping tomcat6 with maven before/after deploy" New topic
Author

Starting and stopping tomcat6 with maven before/after deploy

Rebecca Hopper
Ranch Hand

Joined: Aug 19, 2001
Posts: 38

I am a maven newbie, and it's going fairly well, except that I have been unable to get maven to start tomcat after deploying. I see in the documentation that you can do it with the tomcat-maven-plugin, but that uses the Tomcat Manager, which we don't use in our shop. Is there some way to just call the tomcat start.bat directly via maven?

Here's the relevant portion of my pom.xml, which is getting the error that it can't connect to the Tomcat Manager, probably because it is not configured correctly. Do I really need Tomcat Manager to do this?



SCJP 1.4
Uli Hofstoetter
Ranch Hand

Joined: Nov 24, 2006
Posts: 57
Maybe the Maven exec plugin can do the job.

Regards,
Uli


SCEA5, Certified ScrumMaster
Rebecca Hopper
Ranch Hand

Joined: Aug 19, 2001
Posts: 38

That worked perfectly. I guess it might seem obvious when you have been using maven for awhile, but I still don't know all the plugins.

I bound start-tomcat to the pre-clean phase and stop-tomcat to the deploy phase.



Thanks, Uli for the quick response!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Starting and stopping tomcat6 with maven before/after deploy
 
Similar Threads
Strange problem - works on maven glassfish but not on Tomcat
Build problem with maven and eclipse web project
Filtering problem using maven-read-properties plugin in pom.xml file
how do i send a email test report from maven
Could not resolve dependencies for maven project