Book description
Over 90 hands-on recipes to successfully build and automate development life cycle tasks following Maven conventions and best practices
In Detail
Apache Maven offers a comprehensive set of features to build, test, release, and deploy software projects and maintain enterprise development infrastructure.
This book is a hands-on guide that enables you to explore the vast potential of Apache Maven, the leading software build tool. You will start off by successfully installing Apache Maven on your favorite OS, and then you will create your first working project. Furthermore, the book walks you through setting up and using Maven with popular Java Integrated Development Environments (IDEs) so you can exploit Maven features to build standard Java applications. Above all, you will also learn to create site reports and documentation for your project along with handling typical build requirements and other advanced Maven usages.
What You Will Learn
- Install Apache Maven successfully on your preferred OS
- Explore the various features of Apache Maven to build efficient automation tools
- Discover when and how to use the various Apache Maven plugins
- Generate and publish your project documentation using Apache Maven
- Analyze and control code quality and code coverage using Apache Maven
- Build various types of Java projects as well as other binaries
- Set up complex projects using the concept of inheritance
Table of contents
-
Apache Maven Cookbook
- Table of Contents
- Apache Maven Cookbook
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Preface
-
1. Getting Started
- Introduction
- Installing Maven on Microsoft Windows
- Installing Maven on Mac OS X
- Installing Maven on Linux
- Changing the JDK used by Maven
- Creating a simple project with Maven
- Building a simple project with Maven
- Changing the location of the Maven repository
- Running Maven behind an HTTP proxy server
- Understanding the standard directory layout
- 2. IDE Integration with Maven
-
3. Maven Lifecycle
- Introduction
- Understanding the Maven lifecycle, phases, and goals
- Understanding the pom file
- Understanding Maven settings
- Understanding command-line options in Maven
- Understanding Maven profiles
- Adding a new Maven profile
- Activating/deactivating a Maven profile
- Using properties in Maven
- Specifying source encoding for platform-independent builds
-
4. Essential Maven Plugins
- Introduction
- Using the Maven Clean plugin
- Using the Maven Compiler plugin
- Changing the compiler used by the Maven Compiler plugin
- Specifying the Java version for the Compiler plugin
- Using the Maven Surefire plugin to run unit tests
- Using the Maven Failsafe plugin to run integration tests
- Using the Maven Resources plugin
- Filtering using resources
- Using Eclipse to run Maven goals
- Using NetBeans to run Maven goals
- Using IntelliJ IDEA to run Maven goals
-
5. Dependency Management
- Introduction
- Choosing the scope of dependency
- Getting a report of dependencies
- Getting into dependency and avoiding dependency hell
- Downloading dependencies into a folder
- Understanding SNAPSHOT dependencies
- Handling dependency download errors
- Detecting unused/undeclared dependencies
- Manually installing dependencies that are not available in a repository
- Dependency management using Eclipse
- Dependency management using NetBeans
- Dependency management using IntelliJ IDEA
-
6. Code Quality Plugins
- Introduction
- Analyzing code coverage with the Maven JaCoCo plugin
- Analyzing code coverage with the Maven Cobertura plugin
- Analyzing code with the Maven PMD plugin
- Analyzing code with the Maven Checkstyle plugin
- Analyzing code with the Maven FindBugs plugin
- Generating source references with the Maven JXR plugin
- Analyzing code with the Maven SonarQube plugin
-
7. Reporting and Documentation
- Introduction
- Documenting with the Maven Site plugin
- Generating Javadocs for a site
- Generating source cross-reference for a site
- Generating unit test reports for a site
- Generating code coverage reports for a site
- Generating code quality reports for a site
- Generating selective reports
- Deploying a site
-
8. Handling Typical Build Requirements
- Introduction
- Including and excluding additional resources
- Including and excluding source files and folders
- Configuring Maven to search for plugins
- Working in offline mode
- Controlling the verbosity of the Maven output
- Using the Maven Help plugin
- Using the Maven SCM plugin
- Generating changelogs for a site
- 9. Multi-module Projects
- 10. Java Development with Maven
- 11. Advanced Maven Usage
- Index
Product information
- Title: Apache Maven Cookbook
- Author(s):
- Release date: April 2015
- Publisher(s): Packt Publishing
- ISBN: 9781785286124
You might also like
book
Mastering Apache Maven 3
Enhance developer productivity and address exact enterprise build requirements by extending Maven In Detail Maven is …
video
Learning Apache Maven
In this Learning Apache Maven training course, expert author Kevin Bowersox will teach you how to …
video
Apache Maven: A Practical Introduction
In this course, we look at the Maven build tool, which is currently the number-one industry …
book
Maven: The Definitive Guide
For too long, developers have worked on disorganized application projects, where every part seemed to have …