0

Package ZK Eclipse Tomcat Project For Deployment

asked 2018-05-16 00:26:21 +0800

ansancle gravatar image ansancle
317 9

GOAL : I want to be able to take the code built using a ZK Eclipse Project using Tomcat and Deploy it to any machine running only Tomcat.

I have a ZK project I created in Eclipse using File->New->Project->Other->ZK Project and tomcat 9.0 is my server. I have written some test code that allows me to set and get data from a zul via java to & from my MySql Database. This all works when running Tomcat via the Eclipse Servers Tab. I want to be able to package and deploy my app to any machine running only tomcat & mysql. I noticed my code is not being built and placed into the ../Program Files/Apache/Tomcat 9.0/webapps/ROOT directory. Instead I found it located under my eclipse workspace in this path :

  ...\ProjectName\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\

I want to be able to build a war file to deploy my app to any machine running tomcat. Is there a way to set that up inside my eclipse/ZK project? Or do I just create a .war manually via file manager & compression? That seems simple enough but I figure there has to be a way via Eclipse/ZK. The idea is any server, which does not have eclipse installed, can run my web app by me simply deploying the .war file to the directory

/tomcat/webapps/ROOT

If this is brutally obvious I apologize

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-05-28 10:17:03 +0800

MDuchemin gravatar image MDuchemin
1296 1 4
ZK Team

Hey Ansancle,

I'd say depends whether you are using any sort of build automation / dependency management. If you are using maven to manage your project, then you should build a War from the maven command. (same with gradle, ant, etc.)

Check out the quick start documentation if you want any info on those.

If you don't use any of that, right-click on your project and go "Export... > Web > WAR file". Should be enough to get an eclipse-free War file ready. Be very cautious of any server related library that might be around your project. For example you don't want a servlet-api.jar breaking everything in your production tomcat if you used it for dev on eclipse.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2018-05-16 00:26:21 +0800

Seen: 11 times

Last updated: May 28

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More