Maven

mvn Maven: Start The problem Maven solves, the version and offline mode, a first project from the archetype and the standard layout. Open mvn Maven: The POM The pom.xml element by element, the coordinates, the properties and help:effective-pom. Open mvn Maven: The build The lifecycles and their phases, compile, test, package, install and the switches of a build. Open mvn Maven: Dependencies Declaring a dependency and its scope, transitive dependencies, version conflicts, BOMs and the local repository. Open mvn Maven: Plugins and goals Plugin against goal, the compiler plugin, resource filtering and surefire with JUnit 5. Open mvn Maven: Project structure A parent POM, the multi-module reactor, a module in another project, snapshots and profiles. Open mvn Maven: Around the build settings.xml and mirrors, the wrapper and a fat jar, CI and Docker, IntelliJ and three failures. Open mvn Maven: A finishing project A word-count library built, tested, packaged and run from the first command to the last. Open

All articles

About the course

Maven describes a Java build in one file and runs it with one command: it compiles the code, runs the tests, copies the resources, writes the jar and puts the result where the next project can find it. The course below is a set of articles, each with the number of its part and its place in it: each one takes a piece of the tool, shows the file it lives in, runs the commands and prints what they printed. They are meant to be read in the order of the list, and each article links to the previous and the next one.

Every command was run in this container with Apache Maven 3.9.16 on Java 21.0.13, with no network: the local repository was seeded when the image was built and the settings file switches offline mode on, so a command either works from that repository or fails at once and says what is missing. Both outcomes are shown. Where a build log holds the folder the build ran in, the command line that produced it rewrites the folder to <project>; the times in the log are the ones of the run that wrote the page and differ on your machine.

Maven in IntelliJ IDEA

This folder began with one page about an IntelliJ IDEA error: plugin 'org.apache.maven.plugins:maven-compiler-plugin:3.7.0' not found intellij. The page kept its text and moved to its own article, Maven in IntelliJ IDEA, which shows the settings steps that fix the error and the same failure reproduced from the command line.

Related