From the course: Introducing Maven

Introduction to Apache Maven

From the course: Introducing Maven

Start my 1-month free trial

Introduction to Apache Maven

- [Instructor] Apache Maven isn't the new kid on the block, but a look at Maven Central will let you understand why it is still very relevant and popular in today's Java development shops. In the Apache Foundation's own words, Apache Maven is a software project management and comprehension tool. The project management comes from a single touchpoint from Maven, the POM file, or Project Object Model. For better or worse, Maven is still mainly known for its original core purpose, software builds. It was developed to streamline builds and it does a very good job of doing that today. I have built more projects, projects that are still in use, both publicly and privately today, using Apache Maven. In my opinion, Maven is the single easiest tool to use to build your software, maintain and publish your artifacts, report on your software, and publish documentation on your software, just to name a few. Apache lists some of its core objectives for Maven on their website, and I want to talk about them as part of the foundation of this course, as we will touch them all. The first is to make the build process easier. Maven aims to extract you from the build process so you don't need to know all of the details. Maven also aims to provide a uniform build system. Because it is based on a POM file that contains plugins, you get consistent behavior for every single artifact build, as well as across many artifacts. Furthermore, once you can understand how a single project builds under Maven, you can use that knowledge on every project build by Apache Maven. Maven almost prides itself on documentation about your build, and to be honest, it is still one of my favorite features. With Apache Maven, you get a wealth of information, much of it with very little work about your project, just by using Maven as a tool. Now, we will talk about many of these data, but things like dependency list, change logs, test execution reports, Java docs, et cetera, are just a couple characters away. Maven also has some strong opinions about project structure that they force you as a developer, but these are aimed at giving you some of the basic best practices to follow when writing your code. Maven is designed to be passive to change. While upgrading to the latest features is trivial in most cases, and that is what they specify as the goal, the fact is they do a very good job of not breaking existing functionality as well when they do an upgrade. With all of this said, you may wonder why I choose Apache Maven as my build system of choice and why you should as well. I've already alluded to this, but Maven just works. I have done everything from basic builds to complex projects, all of which using Apache Maven. And from that perspective, it is an amazing system. In addition, Apache Maven is super easy to use. You have a single touchpoint for what you want to do. There's no languages to learn, there's no digging in for examples. Maven's website and plugin sites have great examples of what you as a developer actually want to do. Because Apache Maven is so common and there is such a strong user base, finding answers to your questions is pretty easy. And finally, from a Java perspective, especially when building hundreds of artifacts for distributed microservices platform, Maven has never failed me. Now there are always certain aspects that another build system may do better. However, from a feature perspective and operations perspective, Maven just works.

Contents