Maven Intro
What is Maven
Maven is a build automation tool. Think of it as a Makefile but instead of you writing the Makefile yourself, it writes that Makefile for you automatically to run and produce the final executable.
Maven also handle external third party dependency for you, meaning if you have another library that you would like to use and is available in the Maven repository, you can include it in the pom.xml file, and when you are writing your Maven project, you can just install those dependency and on your way to write your application with those dependency.
Maven + Vscode
Keep in mind that Maven doesn't actually do auto compiling for you, you would have to run mvn compile
everytime when you make changes to your code. Or any other way of compiling depending on other plugins you use.
Maven compiles the .class
files under the target
directory!
For Spring boot and maven-compiler-plugin you would have to compile it yourself everytime you make code changes.
However, if you use Vscode along with the Java language support then it will compile those classes for you. For projects without build tool the .class
files are under ~/.vscode-server
, for those projects with build tool then it is under bin
folder by default in your project root. You can change that by editing your pom.xml file.
No Comments