Maven Basics

Maven Basics

Course: Learning Maven

Last updated on April 22, 2020 - +

What is this module about?

The goal of this module is to teach you the very Maven basics, that all other chapters build upon:

  • How to install Maven on various operating systems.

  • How to create new Maven projects from scratch.

  • How to handle Maven projects on the command line (the basics).

  • How to handle Maven in your IDE (IntelliJ).

  • A first look at Maven’s directory layout.

You can skip this chapter if all of the above are already familiar to you, but make sure to have a working Maven 3.6.3 installation, before continuing to the next module.

How to install the latest Maven

There are a couple of different ways to install Maven and I would like you to learn the generic, manual approach, first.

It has two advantages:

  • Depending on your corporate environment, you need admin rights or special installation rights to install Maven as a OS package. Doing it manually, you don’t need those admin rights.

  • You can make sure to always use the very latest Maven version, instead of having to wait for a new OS package.

Even better, Maven is just a .zip file that you need to download to your machine and unzip, to install it. Hence here’s your first exercise:

Checkpoint: Downloading & Extracting Maven

  • Go to https://maven.apache.org/download.cgi

  • Depending on your operating system, download either apache-maven-3.6.3-bin.zip (Windows) or apache-maven-3.6.3-bin.tar.gz (Unix/macOS).

  • Unzip (Windows) or tar -zxvf (Unix/macOS) the archive to any folder on your machine.

I like to keep my development related software under c:\dev or ~\dev, so I’m going to extract it there. After extraction, you should have a directory structure that looks like this:

17.01.2020  17:36    <DIR>          .
17.01.2020  17:36    <DIR>          ..
17.01.2020  17:36    <DIR>          bin // (1)
17.01.2020  17:36    <DIR>          boot
17.01.2020  17:36    <DIR>          conf
17.01.2020  17:36    <DIR>          lib
07.11.2019  12:32            17.504 LICENSE
07.11.2019  12:32             5.141 NOTICE
07.11.2019  12:32             2.612 README.txt
               3 Files,         25.257 Bytes
               6 Directories, 27.046.400.000 Bytes free

C:\dev\apache-maven-3.6.3>
  1. This is the folder where all important Maven executables live in.

Putting Maven on your PATH

You’ll primarily be going to use Maven by running the mvn executable, that lives inside the /bin folder.

So, for now, you’d always have to switch to the /bin folder to 'mvn clean install' your projects. This is not what you really want, hence you’ll need to put the /bin directory on your PATH, so that you can execute mvn from anywhere on your machine.

Modifying PATH variables on Windows:

Open up a terminal window, and execute the following command to adjust your PATH variable on windows.

setx path "%path%;c:\dev\apache-maven-3.6.3\bin"

Modifying PATH variables on Unix/MacOS

There’s a variety of ways to set PATH variables on Unixes. One of them is to edit your .bashrc file in your home (~) directory and add the following line.

export PATH="/home/marco/apache-maven-3.6.3/bin:$PATH"

Then run 'source ~/.bashrc' in a terminal window for the changes to take immediate effect.

Checkpoint: Modifying Path Variable

Now, open up a new terminal window and go to any folder that is not your apache-maven/bin folder, and enter:

mvn -version

If you see output like the following, you successfully installed Maven.

C:\dev\someProject\mvn -version
Apache Maven 3.6.3 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Maven home: c:\dev\apache-maven-3.6.3\bin\..
Java version: 13.0.1, vendor: AdoptOpenJDK, runtime: c:\Program Files\AdoptOpenJDK\jdk-13.0.1.9-hotspot
Java version: 13.0.1, vendor: AdoptOpenJDK, runtime: c:\Program Files\AdoptOpenJDK\jdk-13.0.1.9-hotspot
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

How to install Maven as OS package

If, and only if, you know how to install Maven by hand, then feel free to alternatively install it as an OS package. It makes things a bit simpler and you’ll get updates automatically, but:

  • You need admin rights to install Maven.

  • You usually do not get the very latest Maven version, instead, you lag a couple of versions behind.

Debian/Ubuntu

Open up a terminal window and enter the following command.

sudo apt-get install maven

Redhat

Open up a terminal window and enter the following command.

sudo yum install maven

MacOSX with Homebrew

Open up a terminal window and enter the following command.

brew install maven

Checkpoint: Installing Maven OS Package

Now, open up a new terminal window and go to any folder that is not your apache-maven/bin folder, and enter:

mvn -version

You successfully finished this exercise, if you see output like this:

ubuntu@DESKTOP-168M0IF:~$ mvn -version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Maven home: /mnt/c/dev/apache-maven-3.6.0
Java version: 11.0.5, vendor: Private Build, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-18362-microsoft", arch: "amd64", family: "unix"

How to create empty Maven projects by hand

The next question is: How to create new Maven projects. That’s rather simple, because any directory which includes a valid pom.xml file, is a valid Maven project.

A pom.xml file is an XML file describing your Java (or Kotlin, or Scala) project: What 3rd party libraries it needs, against which Java version to build etc.

Have a look at this very simple pom.xml file.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.marcobehler</groupId> (1)
  <artifactId>my-app</artifactId> (2)
  <version>1.0-SNAPSHOT</version>

  <properties>
    <maven.compiler.source>14</maven.compiler.source> (3)
    <maven.compiler.target>14</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> (4)
  </properties>

  <dependencies>
         (5)
  </dependencies>

  <build> (6)
    <plugins>
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-compiler-plugin</artifactId>
       <version>3.8.1</version>
     </plugin>
    </plugins>
  </build>
</project>
  1. I like to think of groupId as an identifier for my company, domain or parent project. So, I have com.marcobehler, Twitter would have com.twitter, Spring has org.springframework for all its projects, etc. This doesn’t really match a 100% with the official naming conventions, but you’ll find the majority of Java projects use it like this.

  2. ArtifactId is the name of my project, so e.g. marcobehler-website or marcobehler-payroll.

  3. This is how you set your project’s minimum Java version in Maven. Put the version in here that you have installed on your machine - in my case that’s Java 14. It might read a bit weird, but you’ll have to specify both properties, even though they match in almost every case. One property specifies with what version your Java source will be compiled, the other with what version your code is expected to run.

  4. When your project contains resources like .properties or other text files, you explicitly need to instruct Maven to read/copy them with UTF-8 encoding. This could be a sane default, which Maven, unfortunately, does not have. Instead, it falls back to the default operating system encoding, which could mess up files that contain umlauts or special characters.

  5. Your project does not yet have any dependencies, hence this section is empty. That will change later on. You could also choose to leave out this tag entirely.

  6. A <build> tag where you can specify plugins. Here you are specifying a specific version of the maven-compiler-plugin and you’ll find out why you need to do this in the next paragraph.

Why do you need to specify a plugin section in an empty Maven project?

Here’s the deal. You don’t need to specify that plugin section, but it is good practice to do it anyway. Why?

Maven uses the maven-compiler-plugin to compile your Java sources, and if you don’t specify an explicit version, Maven will, by default, use a version that comes bundled with your Maven distribution. And oftentimes, that’s an older version, even if you are using the latest Maven.

And to be able to use Java 9+ in your projects (like we do here) without any problems in Maven projects, you must make sure to use the 3.8.x+ versions of the compiler plugin. By specifying an explicit version in the plugins block you are essentially locking down the version of the plugin, independently of your local Maven installation.

Checkpoint: Creating a pom.xml

Create a directory of your liking, for example c:\dev\ my-first-maven-project and create an empty pom.xml file inside. Copy the above content to the file and run the following command in a terminal window:

mvn validate

This command validates your pom.xml file. Does it have any errors? Are the tags closed properly? Dependencies declared correctly? I.e. is it a valid Maven project?

You should see output like this:

[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.marcobehler:my-app >-----------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.088 s
[INFO] Finished at: 2020-01-17T18:07:04+01:00
[INFO] ------------------------------------------------------------------------

If it says BUILD SUCCESS, then you just successfully created your first Maven project!

A first look at Maven’s directory layout

Something is missing from your project directory, which at the moment only contains the pom.xml file. Yes, you guessed right: Your Java source code.

Maven expects a specific directory layout from your project, i.e. specific directories where you need to put your .java or .properties files. As a side note, all other build tools nowadays (like Gradle) use and expect the same directory layout.

Hence, you need to step into the directory containing your pom.xml and create the following directories:

Imagine you are inside the directory containing your pom.xml file, so c:\dev\ my-first-maven-project. It should contain at least these sub-folders:

└───c:\dev\ my-first-maven-project
    ├───pom.xml
    └───src
        ├───main
        │   ├───java
        │   ├───resources
        │   └───webapp (optional)
        └───test
            ├───java
            └───resources
  • src/main/java → This is where you need to put your .java classes.

  • src/main/resources → This is where you need to put your resources like .properties files, xml config, images, certificates etc.

  • src/main/webappIF you are building a web application (resulting in a .war file), this is where your web application resources go, like templates, html, css, js. If you are using modern frameworks like Spring Boot, using this folder is discouraged - instead, your resources should go in /src/main/resources.

  • src/test/java → This is where your .java classes used only for testing go.

  • src/test/resources → This is where your test resources (properties, certificates etc.) go.

There are even more directories-by-convention, but we are going to ignore them for now, as they will be covered in more detail later on.

Checkpoint: Creating Maven’s Minimal Directory Structure

Open up a terminal window and make sure to create the following directories:

## Linux
cd ~/dev/my-first-maven-project

mkdir -p src/main/java
mkdir -p src/main/resources
mkdir -p src/test/java
mkdir -p src/test/resources

## Windows

cd C:/dev/my-first-maven-project
mkdir src
cd src
MD main test
cd main
MD java resources
cd ..
cd test
MD java resources

How to handle Maven projects from the command line

You have a valid, empty Maven project and now there’s only one thing missing: your source code.

Creating a sample Application class

Let’s assume you want to build a very simple application, that comes with exactly one Java class and a .properties file. Your class simply prints out whatever’s inside that properties file, when you run it.

The class could look like this:

package com.first.pkg;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Application {
    public static void main(String[] args) throws IOException {
        try (InputStream is = Application.class.getResourceAsStream("/application.properties")) { // (1)
            Properties p = new Properties(); // (2)
            p.load(is);
            System.out.println(p);
        }
    }
}
  1. This is how you read in files, that you’ll need to put in the /src/main/resources folder, inside your Java project. We’ll do that in a second.

  2. This is how you turn the .property file into a Java properties object, before you print it out to the console.

Checkpoint: Creating an Application.java class

Create the file my-first-maven-project/src/main/java/com/first/pkg/Application.java and copy the contents from above inside it.

Creating a sample .properties file

Your properties file could look like this. It doesn’t matter how many properties are inside at the moment, these two will do just fine:

password=secret
hello=world

Checkpoint: Creating an Application.java class

Create the file my-first-maven-project/src/main/resources/application.properties and copy the contents from above inside it.

Building the project

It is now time to let Maven build your application. Given your pom.xml file and your two input files (the Application.java and application.properties), Maven should be able to build a .jar file that you can run on any operating system that has Java installed!

But instead of immediately going for the big bang, we’ll execute multiple Maven commands to get to that .jar file incrementally.

Mvn compile

Open up a terminal window, step inside your project directory and execute the following command:

C:\dev\my-first-maven-project> mvn compile

You should get output like this:

C:\dev\my-first-maven-project>mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.marcobehler:my-app >-----------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ my-app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource (1)
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ my-app ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\dev\my-first-maven-project\target\classes (2)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.173 s
[INFO] Finished at: 2020-04-13T19:37:01+02:00
[INFO] ------------------------------------------------------------------------
  1. Maven picked up 1 resource, living under src/main/resources: your application.properties file.

  2. It picked up 1 Java source file, living under src/main/java, your Application.java class.

Now what did Maven do with these files?

  1. It copied your application.properties file to my-first-maven-project/target/classes

  2. It compiled your .java source file and copied the resulting .class file to my-first-maven-project/target/classes/com/first/pkg

So, that is what the mvn compile command does: Compile your source code and copy your resources to the target folder.

Checkpoint: Mvn compile

Open up a terminal window and see that you have a target folder containing your .class file and .properties file.

Mvn clean

Now, let’s run another command, the mvn clean command.

mvn clean

Let’s see what happened:

C:\dev\my-first-maven-project>mvn clean
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.marcobehler:my-app >-----------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ my-app ---
[INFO] Deleting C:\dev\my-first-maven-project\target (1)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.230 s
[INFO] Finished at: 2020-04-13T19:38:04+02:00
[INFO] ------------------------------------------------------------------------
  1. Yes, the only thing that mvn clean does is to delete your complete target folder. So your .class file and your .properties file is gone.

Mvn package

Now run this command:

mvn package

Have a look at its output:

C:\dev\my-first-maven-project>mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.marcobehler:my-app >-----------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ my-app --- (1)
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ my-app --- (1)
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\dev\my-first-maven-project\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ my-app ---  (2)
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ my-app ---  (2)
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ my-app --- (3)
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ my-app --- (4)
[INFO] Building jar: C:\dev\my-first-maven-project\target\my-app-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.538 s
[INFO] Finished at: 2020-04-13T19:38:33+02:00
[INFO] ------------------------------------------------------------------------

There’s a whole lot of stuff happening. You can see that:

  1. Maven compiles your sources and resources again.

  2. It also tries to compile any existing tests and test resources.

  3. It would even try to run (unit) tests, but we don’t have any just yet.

  4. It puts all your code into a (not yet) runnable .jar file, the final build format for Java program.

So, package is the finish line for most Java projects, as it will generate the final build artifact for you. Furthermore, "mvn package" includes "mvn compile" and "mvn test" (though we haven’t covered that yet).

What’s important that the different Maven commands depend upon each other: A mvn package includes mvn compile test, mvn test would include a mvn compile etc. Two notes:

  1. Maven actually calls these commands lifecycle phases, though I will not use this terminology much throughout this course.

  2. You can see a graphic of how these phases depend on each other here.

Mvn clean install

The most popular and abused Maven command is mvn clean install. Let’s see what it does:

C:\dev\my-first-maven-project>mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.marcobehler:my-app >-----------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ my-app ---
[INFO] Deleting C:\dev\my-first-maven-project\target (1)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ my-app --- (2)
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ my-app ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\dev\my-first-maven-project\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ my-app ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ my-app ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ my-app ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ my-app ---
[INFO] Building jar: C:\dev\my-first-maven-project\target\my-app-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ my-app --- (3)
[INFO] Installing C:\dev\my-first-maven-project\target\my-app-1.0-SNAPSHOT.jar to C:\Users\marco\.m2\repository\com\marcobehler\my-app\1.0-SNAPSHOT\my-app-1.0-SNAPSHOT.jar
[INFO] Installing C:\dev\my-first-maven-project\pom.xml to C:\Users\marco\.m2\repository\com\marcobehler\my-app\1.0-SNAPSHOT\my-app-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.652 s
[INFO] Finished at: 2020-04-13T19:42:38+02:00
[INFO] ------------------------------------------------------------------------
  1. You delete all existing compiled sources, i.e. your /target dir. You only need to do that if you really want to make sure to start compilation from scratch.

  2. The rest looks very similar to the mvn clean package output from before, that is because an install triggers a package, which in turn triggers a compile and test etc.

  3. There’s one additional step. Your built .jar file will be copied to the local Maven repository, which, by default, lives under ~/.m2/, where ~ is your user home directory.

You’ll find out in later sections why you’d want to copy something to the local Maven repo, but for now, keep in mind that a mvn package (as compared to a mvn clean install) is sufficient to fully build your project.

That being said, let’s try and run your program!

Running your .jar file

Open up a terminal and step inside your /target folder. You should see a directory structure looking like this:

C:\dev\my-first-maven-project\target>dir
13.04.2020  19:42    <DIR>          .
13.04.2020  19:42    <DIR>          ..
13.04.2020  19:42    <DIR>          classes
13.04.2020  19:42    <DIR>          generated-sources
13.04.2020  19:42    <DIR>          maven-archiver
13.04.2020  19:42    <DIR>          maven-status
13.04.2020  19:42             2.733 my-app-1.0-SNAPSHOT.jar  # (1)
13.04.2020  19:42    <DIR>          test-classes
  1. The my-app-1.0-SNAPSHOT.jar file is your final .jar file, the one that includes your .class and .properties file. Let’s try and run it.

java -jar my-app-1.0-SNAPSHOT.jar

But instead of seeing your properties .file getting printed out, you should get the following error message:

No manifest, in my-app-1.0-SNAPSHOT.jar

Why is that? Because Java does not magically know which .class file inside your .jar it should run, unless you explicitly tell it the name of the .class file.

And one of the ways of doing that is by putting a MANIFEST file inside your .jar file that contains the class name and Maven can do that for you - but you have to explicitly create one with the help of a plugin.

A first Maven plugin

Open up your pom.xml file and modify the plugins section, so it looks exactly like this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

  <groupId>com.marcobehler</groupId>
  <artifactId>my-app</artifactId>
  <version>1.0-SNAPSHOT</version>

  <properties>
    <maven.compiler.source>14</maven.compiler.source>
    <maven.compiler.target>14</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
  </dependencies>

  <build>
    <plugins> (1)
      <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-compiler-plugin</artifactId>
       <version>3.8.1</version>
     </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId> (2)
        <version>3.2.0</version>
        <configuration>
          <archive>
            <manifest>
              <mainClass>com.first.pkg.Application</mainClass> (3)
            </manifest>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
  1. Plugins need to go to the <build> section and you can add as many as you want.

  2. The plugin that actually builds your final .jar file is the maven-jar-plugin. By specifying it here, you can configure it.

  3. One of these configurations is to add a manifest file with..you guessed it…​your Application class. Make sure it is the fully qualified name of your class, including the package!

Checkpoint 2: Running your .jar file

Open up a terminal window and inside your project directory run:

mvn package

This will re-build your .jar file for you. After that, go to your /target folder and run this command again:

java -jar my-app-1.0-SNAPSHOT.jar

You should see the following now:

C:\dev\my-first-maven-project\target>java -jar my-app-1.0-SNAPSHOT.jar
{password=secret, hello=world}

Which means that Maven packaged up your .jar file correctly and your Application.class gets executed, whenever you run java -jar. Congratulations, that is already a great start!

Now that you have handled your project entirely on the command line, let’s have a look at how the same project can be opened and handled with an IDE, IntelliJ Idea.

How to handle Maven from IntelliJ

There are a couple of important points you need to watch out for when using an IDE like IntelliJ IDEA together with Maven projects.

As it’s best to demonstrate this in a short screencast, watch the video below to get up to speed quickly with IntelliJ & Maven.

Note: The project imported in this video is not the project you are building in this course. This serves as a great exercise, so you do not just blindly copy&paste 1:1.

Checkpoint: Intellij & Maven

Open up IntelliJ and import your Maven project. Make sure to have auto-import enabled.

What you learned in this module

  • You learned the simplest way to create a Maven project from scratch

  • You learned how to handle that Maven project on the command line, eventually ending up with an executable .jar file.

  • You learned what Maven’s directory structure convention looks like and how to handle your Maven project with an IDE.

Congratulations, you successfully finished this module!

You can now proceed directly to the next module.

Discussion:

Buy for $120

Due to the Coronavirus pandemic all courses are 33% off.

Offer valid through June 1st. Regular Price: $180 .