I'm new to Java EE web development. I've created a JAX-RS based web application in Eclipse which I'm running on Tomcat. The project has dependencies managed by Maven. Everything is working fine. However now if I have to ship this project, I'd assume I would have to provide a .war file to the user.
So here's my questions:
Eclipse deploys WAR to the tomcat. Exact place depends on your tomcat settings. See details here: Where does Tomcat in Eclipse store the expanded WAR? You mentioned a pom.xml file so you probably use some maven plugin (like this https://maven.apache.org/plugins/maven-war-plugin/) to build the war file. Refer the plugin documentation to understand how to configure the war artifact creation.
Everything is inside (in your case the project is properly configured in maven). You should just deploy to the server.
You should not right click or whatever. Just place into the webapps folder in the tomcat installation or deploy via manager app. I gues you should read the documentation here https://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html to understand what is deployment and how to do it.
One more useful link:http://www.codejava.net/ides/eclipse/eclipse-create-deployable-war-file-for-java-web-application
right click in project > export > web project > .war Then copy the .war file into webapp directory of your apache tomcat.
If you use maven and you configured it properly the easiest way to create your war is to call:
$ mvn clean install
in your project directory, in the location of pom.xml. After that you will find generated war in: path_to_your_project/targe/your_application.war
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With