Part II. Maven Reference

Table of Contents

9. The Project Object Model
9.1. Introduction
9.2. The POM
9.2.1. The Super POM
9.2.2. The Simplest POM
9.2.3. The Effective POM
9.2.4. Real POMs
9.3. POM Syntax
9.3.1. Project Versions
9.3.1.1. Version Build Numbers
9.3.1.2. SNAPSHOT Versions
9.3.2. Property References
9.4. Project Dependencies
9.4.1. Dependency Scope
9.4.2. Optional Dependencies
9.4.3. Dependency Version Ranges
9.4.4. Transitive Dependencies
9.4.4.1. Transitive Dependencies and Scope
9.4.5. Conflict Resolution
9.4.6. Dependency Management
9.5. Project Relationships
9.5.1. More on Coordinates
9.5.2. Multi-module Projects
9.5.3. Project Inheritance
9.6. POM Best Practices
9.6.1. Grouping Dependencies
9.6.2. Multi-module vs. Inheritance
9.6.2.1. Simple Project
9.6.2.2. Multi-module Enterprise Project
9.6.2.3. Prototype Parent Projects
10. The Build Lifecycle
10.1. Introduction
10.1.1. Clean Lifecycle (clean)
10.1.2. Default Lifecycle (default)
10.1.3. Site Lifecycle (site)
10.2. Package-specific Lifecycles
10.2.1. JAR
10.2.2. POM
10.2.3. Maven Plugin
10.2.4. EJB
10.2.5. WAR
10.2.6. EAR
10.2.7. Other Packaging Types
10.3. Common Lifecycle Goals
10.3.1. Process Resources
10.3.2. Compile
10.3.3. Process Test Resources
10.3.4. Test Compile
10.3.5. Test
10.3.6. Install
10.3.7. Deploy
11. Build Profiles
11.1. What Are They For?
11.1.1. What is Build Portability
11.1.1.1. Non-Portable Builds
11.1.1.2. Environment Portability
11.1.1.3. Organizational (In-House) Portability
11.1.1.4. Wide (Universal) Portability
11.1.2. Selecting an Appropriate Level of Portability
11.2. Portability through Maven Profiles
11.2.1. Overriding a Project Object Model
11.3. Profile Activation
11.3.1. Activation Configuration
11.3.2. Activation by the Absence of a Property
11.4. External Profiles
11.5. Settings Profiles
11.5.1. Global Settings Profiles
11.6. Listing Active Profiles
11.7. Tips and Tricks
11.7.1. Common Environments
11.7.2. Protecting Secrets
11.7.3. Platform Classifiers
11.8. Summary
12. Maven Assemblies
12.1. Introduction
12.2. Assembly Basics
12.2.1. Predefined Assembly Descriptors
12.2.2. Building an Assembly
12.2.3. Assemblies as Dependencies
12.2.4. Assembling Assemblies via Assembly Dependencies
12.3. Overview of the Assembly Descriptor
12.4. The Assembly Descriptor
12.4.1. Property References in Assembly Descriptors
12.4.2. Required Assembly Information
12.5. Controlling the Contents of an Assembly
12.5.1. Files Section
12.5.2. FileSets Section
12.5.3. Default Exclusion Patterns for fileSets
12.5.4. dependencySets Section
12.5.4.1. Customizing Dependency Output Location
12.5.4.2. Interpolation of Properties in Dependency Output Location
12.5.4.3. Including and Excluding Dependencies by Scope
12.5.4.4. Fine Tuning: Dependency Includes and Excludes
12.5.4.5. Transitive Dependencies, Project Attachments, and Project Artifacts
12.5.4.6. Advanced Unpacking Options
12.5.4.7. Summarizing Dependency Sets
12.5.5. moduleSets Sections
12.5.5.1. Module Selection
12.5.5.2. Sources Section
12.5.5.3. Interpolation of outputDirectoryMapping in moduleSets
12.5.5.4. Binaries section
12.5.5.5. moduleSets, Parent POMs and the binaries Section
12.5.6. Repositories Section
12.5.7. Managing the Assembly’s Root Directory
12.5.8. componentDescriptors and containerDescriptorHandlers
12.6. Best Practices
12.6.1. Standard, Reusable Assembly Descriptors
12.6.2. Distribution (Aggregating) Assemblies
12.7. Summary
13. Properties and Resource Filtering
13.1. Introduction
13.2. Maven Properties
13.2.1. Maven Project Properties
13.2.2. Maven Settings Properties
13.2.3. Environment Variable Properties
13.2.4. Java System Properties
13.2.5. User-defined Properties
13.3. Resource Filtering
14. Maven and Eclipse: m2eclipse
14.1. Introduction
14.2. m2eclipse
14.3. Installing the m2eclipse Plugin
14.3.1. Installing Prerequisites
14.3.1.1. Installing Subclipse
14.3.1.2. Installing Mylyn
14.3.1.3. Installing AspectJ Development Tools (AJDT)
14.3.1.4. Installing the Web Tools Platform (WTP)
14.3.2. Installing m2eclipse
14.4. Enabling the Maven Console
14.5. Creating a Maven Project
14.5.1. Checking Out a Maven Project from SCM
14.5.2. Creating a Maven Project from a Maven Archetype
14.5.3. Creating a Maven Module
14.6. Create a Maven POM File
14.7. Importing Maven Projects
14.7.1. Importing a Maven Project
14.7.2. Materializing a Maven Project
14.8. Running Maven Builds
14.9. Working with Maven Projects
14.9.1. Adding and Updating Dependencies and Plugins
14.9.2. Creating a Maven Module
14.9.3. Downloading Source
14.9.4. Opening Project Pages
14.9.5. Resolving Dependencies
14.10. Working with Maven Repositories
14.10.1. Searching For Maven Artifacts and Java classes
14.10.2. Indexing Maven Repositories
14.11. Maven Preferences
14.12. Summary
15. Site Generation
15.1. Introduction
15.2. Building a Project Site with Maven
15.3. Customizing the Site Descriptor
15.3.1. Customizing the Header Graphics
15.3.2. Customizing the Navigation Menu
15.4. Site Directory Structure
15.5. Writing Project Documentation
15.5.1. APT Example
15.5.2. FML Example
15.6. Deploying Your Project Website
15.6.1. Configuring Server Authentication
15.6.2. Configuring File and Directory Modes
15.7. Customizing Site Appearance
15.7.1. Customizing the Site CSS
15.7.2. Create a Custom Site Template
15.7.3. Reusable Website Skins
15.7.4. Creating a Custom Theme CSS
15.7.5. Customizing Site Templates in a Skin
15.8. Tips and Tricks
15.8.1. Inject XHTML into HEAD
15.8.2. Add Links under Your Site Logo
15.8.3. Add Breadcrumbs to Your Site
15.8.4. Add the Project Version
15.8.5. Modify the Publication Date Format and Location
15.8.6. Using Doxia Macros
16. Repository Manager
16.1. Introduction
16.1.1. History of Nexus
16.2. Installing Nexus
16.2.1. Downloading Nexus from Sonatype
16.2.2. Installing Nexus
16.2.3. Running Nexus
16.2.4. Startup Scripts for Redhat/Fedora/CentOS
16.2.5. Upgrading from a Previous Version
16.3. Configuring Maven to Use Nexus
16.3.1. Using the Nexus Central Proxy Repository
16.3.2. Using Nexus for Snapshot Repositories
16.3.3. Adding Repositories for Missing Dependencies
16.3.4. Adding a New Repository
16.3.5. Adding a Repository to a Group
16.4. Configuring Nexus
16.4.1. Customizing Server Configuration
16.4.2. Managing Repositories
16.4.3. Managing Groups
16.4.4. Managing Routes
16.4.5. Network Configuration
16.5. Maintaining Repositories
16.6. Deploying Artifacts to Nexus
16.6.1. Deploying Releases
16.6.2. Deploying Snapshots
16.6.3. Deploying Third-party Artifacts
17. Writing Plugins
17.1. Introduction
17.2. Programming Maven
17.2.1. What is Inversion of Control?
17.2.2. Introduction to Plexus
17.2.3. Why Plexus?
17.2.4. What is a Plugin?
17.3. Plugin Descriptor
17.3.1. Top-level Plugin Descriptor Elements
17.3.2. Mojo Configuration
17.3.3. Plugin Dependencies
17.4. Writing a Custom Plugin
17.4.1. Creating a Plugin Project
17.4.2. A Simple Java Mojo
17.4.3. Configuring a Plugin Prefix
17.4.4. Logging from a Plugin
17.4.5. Mojo Class Annotations
17.4.6. When a Mojo Fails
17.5. Mojo Parameters
17.5.1. Supplying Values for Mojo Parameters
17.5.2. Multi-valued Mojo Parameters
17.5.3. Depending on Plexus Components
17.5.4. Mojo Parameter Annotations
17.6. Plugins and the Maven Lifecycle
17.6.1. Executing a Parallel Lifecycle
17.6.2. Creating a Custom Lifecycle
17.6.3. Overriding the Default Lifecycle
18. Writing Plugins in Alternative Languages
18.1. Writing Plugins in Ant
18.2. Creating an Ant Plugin
18.3. Writing Plugins in JRuby
18.3.1. Creating a JRuby Plugin
18.3.2. Ruby Mojo Implementations
18.3.3. Logging from a Ruby Mojo
18.3.4. Raising a MojoError
18.3.5. Referencing Plexus Components from JRuby
18.4. Writing Plugins in Groovy
18.4.1. Creating a Groovy Plugin

Creative Commons License
Maven: The Definitive Guide by Sonatype, Inc. is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.
Based on a work at www.sonatype.com.

Favicon Report Typos, Errors, Ask Questions, Discuss, Share Your Ideas with us at Get Satisfaction