O'Reilly logo

Apache Maven 3 Cookbook by Srirangan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Compiling and testing a project

Let’s hope that you’ve read the previous recipe titled Creating a new project or that you have a Maven project available because now we’re entering the interesting part; compiling and testing the project using Maven.

If you’re new to Apache Maven, which is probably why you have this book in your hands, this will be your first introduction to the Apache Maven build lifecycle.

Getting ready

  • Start your command-line terminal window
  • Navigate to the project folder that contains the pom.xml file
  • Run the following command:
    mvn compile
    

How to do it...

Now Apache Maven begins to download dependencies, if they aren’t available in your local repository, and then proceeds to compile the project.

[INFO] ------------------------------------------- ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required