Cover image for Maven: A Developer's Notebook

Book description

Maven is a new project management and comprehension tool which provides an elegant way to share build logic across projects. In terms of capabilities, Maven is an improvement to Apache Ant-thanks to numerous plug-ins and built-in integration with unit testing frameworks such as JUnit. Tired of writing the same build logic for every project? Using Maven, you can leverage the experience of the community to avoid the tedious process of creating yet another build script for each new project. Maven: A Developer's Notebook begins by introducing you to the concept of project object model (POM), and then offers further details on the essential features of Maven. Like all titles in O'Reilly's Developer's Notebook series, this no-nonsense book skips the boring prose and cuts right to the chase. It's an approach that forces you to get your hands dirty by working through a series of poignant labs-exercises that speak to you instead of at you. Plus, Maven: A Developer's Notebook is the first book on the subject to hit the market, so you know the information is fresh and timely. If you're a Java programmer, you'll be armed with all the critical information you need to get up to speed on this powerful new build tool. You'll discover how Maven can help you:

  • manage a project's build, reporting, and documentation, all from a central piece of information

  • break a complex project into a series of smaller subprojects

  • report on code quality, unit tests, code duplication, and project activity

  • create a custom remote repository

  • build simple and complex plug-ins

In the end, you'll find yourself spending less time working on your project's build system and more time working on your project's code.

Table of Contents

  1. Maven: A Developer's Notebook
    1. SPECIAL OFFER: Upgrade this ebook with O’Reilly
    2. The Developer's Notebook Series
      1. Notebooks Are...
      2. Notebooks Aren't...
      3. Organization
    3. Preface
      1. The Future: Maven 2
      2. How This Book Is Organized
      3. How This Book Was Written
      4. About This Book's Web Site
      5. About This Book's Examples
      6. About the Authors
      7. Conventions Used in This Book
      8. Using Code Examples
      9. How to Contact Us
      10. Safari® Enabled
      11. Acknowledgments
        1. Acknowledgments from Vincent
        2. Acknowledgments from Tim
    4. 1. Maven Jump-Start
      1. 1.1. Installing Maven
        1. 1.1.1. How do I do that?
        2. 1.1.2. What just happened?
        3. 1.1.3. What about...
      2. 1.2. Starting a New Project
        1. 1.2.1. How do I do that?
        2. 1.2.2. What about...
      3. 1.3. Using Maven Behind a Proxy
        1. 1.3.1. How do I do that?
      4. 1.4. Compiling and Testing a Project
        1. 1.4.1. How do I do that?
        2. 1.4.2. What just happened?
      5. 1.5. Working with the Project Object Model
        1. 1.5.1. How do I do that?
      6. 1.6. Listing Available Goals
      7. 1.7. Producing Debug Information
        1. 1.7.1. How do I do that?
        2. 1.7.2. What just happened?
      8. 1.8. Adding a Dependency
        1. 1.8.1. How do I do that?
        2. 1.8.2. What just happened?
        3. 1.8.3. What about...
      9. 1.9. Depending on Snapshots
        1. 1.9.1. How do I do that?
        2. 1.9.2. What just happened?
      10. 1.10. Performing an Offline Build
        1. 1.10.1. How do I do that?
        2. 1.10.2. What about...
      11. 1.11. Using the Maven Console
        1. 1.11.1. How do I do that?
        2. 1.11.2. What just happened?
      12. 1.12. Generating an Eclipse Project
        1. 1.12.1. How do I do that?
        2. 1.12.2. What about...
      13. 1.13. Using the Eclipse Maven Plug-in
        1. 1.13.1. How do I do that?
        2. 1.13.2. What about...
      14. 1.14. Generating an Ant Build File
        1. 1.14.1. How do I do that?
        2. 1.14.2. What about...
      15. 1.15. Migrating a Project from Ant to Maven
        1. 1.15.1. How do I do that?
        2. 1.15.2. What about...
      16. 1.16. Generating Project Documentation
        1. 1.16.1. How do I do that?
        2. 1.16.2. What just happened?
      17. 1.17. Telling Maven About Your Team
        1. 1.17.1. How do I do that?
        2. 1.17.2. What just happened?
      18. 1.18. Pointing Maven at Source Control
        1. 1.18.1. How do I do that?
        2. 1.18.2. What about...
      19. 1.19. Creating a Project Web Site
        1. 1.19.1. How do I do that?
        2. 1.19.2. What about...
      20. 1.20. Customizing Site Reports
        1. 1.20.1. How do I do that?
        2. 1.20.2. What just happened?
    5. 2. Customizing Maven
      1. 2.1. Installing a Plug-in from a Remote Repository
        1. 2.1.1. How do I do that?
        2. 2.1.2. What about...
      2. 2.2. Customizing Plug-in Behavior
        1. 2.2.1. How do I do that?
      3. 2.3. Writing a Custom Goal
        1. 2.3.1. How do I do that?
        2. 2.3.2. What just happened?
        3. 2.3.3. What about...
      4. 2.4. Defining a preGoal
        1. 2.4.1. How do I do that?
        2. 2.4.2. What just happened?
      5. 2.5. Defining Custom Properties
        1. 2.5.1. How do I do that?
        2. 2.5.2. What just happened?
        3. 2.5.3. What about...
      6. 2.6. Running the Program from a Custom Goal
        1. 2.6.1. How do I do that?
        2. 2.6.2. What just happened?
      7. 2.7. Defining the Default Goal
        1. 2.7.1. How do I do that?
      8. 2.8. Overriding Properties
        1. 2.8.1. How do I do that?
        2. 2.8.2. What just happened?
      9. 2.9. Enumerating Dependencies
        1. 2.9.1. How do I do that?
        2. 2.9.2. What just happened?
      10. 2.10. Customizing Site Look and Feel
        1. 2.10.1. How do I do that?
        2. 2.10.2. What just happened?
      11. 2.11. Using the FAQ Plug-in
        1. 2.11.1. How do I do that?
        2. 2.11.2. What just happened?
    6. 3. Multiproject Maven
      1. 3.1. Dividing and Conquering
        1. 3.1.1. How do I do that?
        2. 3.1.2. What about...
      2. 3.2. Using POM Inheritance
        1. 3.2.1. How do I do that?
        2. 3.2.2. What just happened?
        3. 3.2.3. What about...
      3. 3.3. Writing the Quote Generator
        1. 3.3.1. What just happened?
      4. 3.4. Sharing Artifacts Through the Local Maven Repository
        1. 3.4.1. How do I do that?
        2. 3.4.2. What just happened?
      5. 3.5. Using the WAR Plug-in
        1. 3.5.1. What just happened?
        2. 3.5.2. What about...
      6. 3.6. Using the Jetty Plug-in to Start a Web Application
        1. 3.6.1. How do I do that?
        2. 3.6.2. What just happened?
      7. 3.7. Executing HtmlUnit Tests
        1. 3.7.1. How do I do that?
        2. 3.7.2. What just happened?
        3. 3.7.3. What about...
      8. 3.8. Building All Subprojects Simultaneously
        1. 3.8.1. How do I do that?
      9. 3.9. Creating Custom Top-Level Goals
        1. 3.9.1. How do I do that?
        2. 3.9.2. What about...
      10. 3.10. Generating a Multiproject Web Site
        1. 3.10.1. How do I do that?
    7. 4. Project Reporting and Publishing
      1. 4.1. Reporting on Project Content
        1. 4.1.1. How do I do that?
        2. 4.1.2. What about...
      2. 4.2. Reporting Testing Status
        1. 4.2.1. How do I do that?
        2. 4.2.2. What about...
      3. 4.3. Reporting on Code Best Practices
        1. 4.3.1. How do I do that?
        2. 4.3.2. What about...
      4. 4.4. Reporting on Duplicate Code
        1. 4.4.1. How do I do that?
      5. 4.5. Generating a Quality Dashboard
        1. 4.5.1. How do I do that?
        2. 4.5.2. What just happened?
        3. 4.5.3. What about...
      6. 4.6. Tracking Project Activity
        1. 4.6.1. How do I do that?
      7. 4.7. Tracking Project Changes
        1. 4.7.1. How do I do that?
        2. 4.7.2. What about...
      8. 4.8. Publishing Maven Artifacts
        1. 4.8.1. How do I do that?
        2. 4.8.2. What just happened?
        3. 4.8.3. What about...
      9. 4.9. Announcing a Project Release
        1. 4.9.1. How do I do that?
        2. 4.9.2. What about...
      10. 4.10. Reporting Project Releases
        1. 4.10.1. How do I do that?
        2. 4.10.2. What about...
      11. 4.11. Publishing a Project Web Site
        1. 4.11.1. How do I do that?
        2. 4.11.2. What about...
    8. 5. Team Collaboration with Maven
      1. 5.1. Sharing a Maven Installation
        1. 5.1.1. How do I do that?
        2. 5.1.2. What just happened?
      2. 5.2. Creating Your Own Remote Maven Repository
        1. 5.2.1. How do I do that?
        2. 5.2.2. What just happened?
        3. 5.2.3. What about...
      3. 5.3. Setting Up a Continuous Integration Build
        1. 5.3.1. How do I do that?
        2. 5.3.2. What about...
      4. 5.4. Using Binary Dependencies
        1. 5.4.1. How do I do that?
        2. 5.4.2. What just happened?
    9. 6. Writing Maven Plug-ins
      1. 6.1. Writing a Simple JAR Execution Plug-in
        1. 6.1.1. How do I do that?
        2. 6.1.2. What about...
      2. 6.2. Installing a Plug-in from Its Sources
        1. 6.2.1. How do I do that?
        2. 6.2.2. What just happened?
      3. 6.3. Testing a Plug-in
        1. 6.3.1. How do I do that?
        2. 6.3.2. What just happened?
        3. 6.3.3. What about...
      4. 6.4. Writing a Complex Plug-in: The Logifier
        1. 6.4.1. How do I do that?
      5. 6.5. Writing a Logging Aspect Using AspectJ
        1. 6.5.1. How do I do that?
      6. 6.6. Using Plug-in Resources
        1. 6.6.1. How do I do that?
      7. 6.7. Implementing the Logifier Build Logic
        1. 6.7.1. How do I do that?
      8. 6.8. Executing the Logifier Plug-in
        1. 6.8.1. How do I do that?
      9. 6.9. Adding Dynamic Dependencies
        1. 6.9.1. How do I do that?
        2. 6.9.2. What just happened?
      10. 6.10. Writing a Plug-in That Generates Reports
        1. 6.10.1. How do I do that?
        2. 6.10.2. What just happened?
      11. 6.11. Creating an XDoc File Using JSL
        1. 6.11.1. How do I do that?
        2. 6.11.2. What just happened?
      12. 6.12. Publishing a Plug-in to a Remote Repository
        1. 6.12.1. How do I do that?
        2. 6.12.2. What just happened?
    10. A. Maven Plug-ins
      1. A.1. Plug-ins Reference
      2. A.2. Auto-Downloading a Plug-in
      3. A.3. Installing a Plug-in Manually
      4. A.4. Depending on a Plug-in
    11. Index
    12. About the Authors
    13. Colophon
    14. SPECIAL OFFER: Upgrade this ebook with O’Reilly