Developing with Eclipse and Maven

Developing with Eclipse and Maven

Developing with Eclipse and Maven

Tim O'Brien

Jason Van Zyl

Benjamin Bentmann

Igor Fedorenko

Brian Fox

Milos Kleint

Peter Lynch

Matthew Piggott

Dmitry Platonoff

Pascal Rapicault

Rich Seddon

Vlad Tatavu

Dan Yocum

Edited by

Tim O'Brien

Sonatype, Inc.

Sonatype, Inc.

Abstract

Sonatype's m2eclipse plugin provides first-class support for Maven projects in the Eclipse IDE.


Copyright
Foreword: 1.4-SNAPSHOT
1. Changes in Edition 1.3
1. Introduction to m2eclipse
1.1. Introduction
1.2. m2eclipse
2. Installing m2eclipse
2.1. Installing the Eclipse IDE
2.2. Installing m2eclipse in Eclipse 3.6 (Helios) with the Eclipse Marketplace
2.2.1. Installing Maven Integration for Eclipse (Core)
2.2.2. Installing Maven Integration for Eclipse (Extras) Prerequisites
2.2.2.1. Installing Subclipse in the Eclipse Marketplace
2.2.2.2. Installing Mylyn in the Eclipse Marketplace
2.2.3. Installing Maven Integration for Eclipse (Extras)
2.3. Installing m2eclipse in Eclipse 3.5 (Gallileo)
2.3.1. Installing m2eclipse Core Components
2.3.2. Installing m2eclipse Extras
2.3.3. Installing Optional Prerequisites
2.3.3.1. Installing Subclipse
2.3.3.2. Installing Mylyn
2.3.3.3. Installing the Web Tools Platform (WTP)
2.4. Uninstalling m2eclipse from Eclipse 3.6 (Helios) with the Eclipse Marketplace
3. Creating and Importing Projects
3.1. Creating a Maven Project
3.1.1. Checking Out a Maven Project from SCM
3.1.2. Creating a Maven Project from a Maven Archetype
3.1.3. Creating a Maven Module
3.2. Create a Maven POM File
3.3. Importing Maven Projects
3.3.1. Importing a Maven Project
3.3.2. Materializing a Maven Project
4. Running Maven Builds
4.1. Enabling the Maven Console
4.2. Running Maven Builds
5. m2eclipse Preferences
5.1. Maven Preferences
6. Working with Maven Repositories
6.1. Working with Maven Repositories
6.2. Searching For Maven Artifacts and Java classes
6.3. Indexing Maven Repositories
6.4. Browsing and Manipulating Maven Repositories
6.4.1. Opening the Maven Repository View
6.4.2. Browsing Global Repositories
6.4.3. Browsing Your Workspace Repository
6.4.4. Browsing a Project Repository
6.4.5. Browsing Your Local Repository
6.4.6. Manipulating a Repository Index
7. Using m2eclipse
7.1.
7.1.1. Adding and Updating Dependencies and Plugins
7.1.2. Downloading Source
7.1.3. Opening Project Pages
7.1.4. Resolving Dependencies
7.2. Analyzing Project Dependencies in m2eclipse
8. Using m2eclipse
8.1. Working with Maven Projects
8.1.1. Downloading Source
8.1.2. Opening Project Pages
8.1.3. Resolving Dependencies
8.2. Using the Form-based POM Editor
8.3. Summary
A. Creative Commons License
A.1. Creative Commons BY-NC-ND 3.0 US License
B. Contributing to the m2eclipse Book
B.1. Contributor License Agreement (CLA)
B.2. Contributors, Authors, and Editors
B.3. Tools Used to Build and Write this Book
B.4. How to Build the Book
B.5. Book Project Layout
B.6. Subscribing to the Book Developers List
C. Book Revision History
C.1. Changes in Edition 1.2
C.2. Changes in Edition 1.1
C.3. Changes in Edition 0.8
C.4. Changes in Edition 0.7
C.5. Changes in Edition 0.6
Index

List of Figures

2.1. Opening the Eclipse Marketplace
2.2. Selecting the Eclipse Marketplace
2.3. Selecting Maven Integration for Eclipse from Eclipse Marketplace
2.4. Selecting the Core m2eclipse Feature for Installation
2.5. Agreeing to Software License During m2eclipse Installation
2.6. Ignoring Warning During m2eclipse Installation
2.7. Restarting Eclipse after m2eclipse Installation
2.8. Selecting Subclipse from the Eclipse Marketplace
2.9. Selecting Mylyn from the Eclipse Marketplace
2.10. Selecting Maven Integration for Eclipse (Extras) from the Eclipse Marketplace
2.11. Selecting m2eclipse (Extras) Components to Install
2.12. Agreeing to Software License During m2eclipse (Extras) Installation
2.13. Ignoring Warning During m2eclipse (Extras) Installation
2.14. Restarting Eclipse after m2eclipse (Extras) Installation
2.15. Selecting Maven Integration for Eclipse Components to Uninstall
2.16. Selecting Components to Install for Maven Integration for Eclipse Installation
2.17. Selecting Maven Integration for Eclipse (Extras) Features to Uninstall
2.18. Restarting Eclipse after Uinstallation
3.1. Creating a New Project with m2eclipse Wizards
3.2. Checkout a New Project from Subversion
3.3. Creating a New Project with a Maven Archetype
3.4. Creating a New Maven Module
3.5. Selecting a Parent Project for a New Maven Module
3.6. Creating a New POM
3.7. Adding Dependencies to a New POM
3.8. Querying the Central Repository for Dependencies
3.9. Importing a Maven Project
3.10. Importing a Multi-module Maven Project
3.11. Materializing a Maven Project
3.12. Selecting Artifact to Materialize
3.13. Materializing Apache Camel
4.1. Enabling the Maven Console in Eclipse
4.2. Running an Eclipse build with Run As..
4.3. Configuring a Maven Build as a Run Configuration
5.1. Maven Preferences for Eclipse
5.2. Maven Goal Dialogs
5.3. Maven Installations Preference Page
5.4. Enabling the Maven Version Decorator
5.5. Package Explorer without Maven Version Decorator
5.6. Package Explorer with Maven Version Decorator Enabled
6.1. Searching for Artifacts and Classes
6.2. Searching for a POM
6.3. Searching the Repository for a Class
6.4. Show Maven Indexes View
6.5. Maven Indexes View
6.6. Locating a POM from the Indexes View
6.7. Opening a View in Eclipse
6.8. Selecting the Maven Repositories View in the Show View Dialog
6.9. Browsing a Global Repository
6.10. Browsing the m2eclipse Workspace Repository
6.11. Adding a Repository to a Project's POM
6.12. Project POM with a Custom Repository
6.13. Browsing a Project Repository
6.14. Browsing Your Local Maven Repository
6.15. Updating a Repository Index
7.1. Manually Adding a Dependency to the Project's POM
7.2. Updating Maven Dependencies
7.3. Searching for a Dependency
7.4. Dependency Tree Tab of the POM Editor
7.5. Locating Dependencies in the Dependency Tree
7.6. Viewing the Dependencies of a Project as a Graph
7.7. Radial Layout of Dependency Graph
8.1. Available Maven Features
8.2. Overview Tab of POM Editor for idiom-core
8.3. Overview Tab of POM Editor for idiom Parent Project
8.4. Effective POM for idiom-core
8.5. Dependencies Tab of the POM Editor
8.6. Build Tab of the POM Editor