Katie
Katie

Reputation: 11

How do Tomcat and Maven work when building a project?

I have been given a project to work on, and I know that in order to make efficient progress I need a good mental model of how things work together. I am supposed to be using an IDE of my choice, as well as Maven and Apache Tomcat to compile and build the project. I can do that, but the program is not fully functional, and because I don't understand how all the software works together, debugging is difficult. I have spent a lot of time researching how these things work, and what they do, but I am still not understanding. I know that Maven handles the dependencies, but I do not really understand what that means. I am confused by what Tomcat technically is, but I understand that it is needed to run dynamic programs. Beyond that, I do not understand how it works, or what it does. I also do not understand what happens between the IDE to the Tomcat server, as in, what is connecting them and how do I get my changes to affect what I see in my browser? Thank you!

Upvotes: 1

Views: 164

Answers (1)

Very short.

  • Maven builds your code by compiling the sources you write into byte code which the Java Virtual Machine can run, and include code written by others that your code needs. This is a good thing.
  • Tomcat has your compiled code (which needs to be in the form of a webapp) deployed to it, after which it can be run if appropriately invoked.

How the compiled code gets from your machine after Maven builds it, into Tomcat varies depending on the need of the team doing it, but during development this is often facilitated by your IDE - this typically also makes it easier to debug.

If at all possible, I would suggest finding a local mentor which can help you getting started because there is a lot of moving parts your need to have a basic understanding of.

Upvotes: 1

Related Questions