Maven in Action cover

Maven in Action

Rating 4.0
Word count
277 words
Chapters
21
Series
HZ Books · In Practice Series
ISBN
9787111321545

Tags

Summary

Maven in Action is the first technical monograph in China to systematically introduce Apache Maven. Its author, Xu Xiaobin (Juven Xu), is an active promoter of the Chinese Maven community and has participated in Nexus development and maintenance of the Maven Central Repository. The book is written against Maven 3.0 and compares its features with those of Maven 2.x, making it easier for users still on older versions to understand the migration. The book is divided into three parts: basic operations, core concepts, and advanced applications. Chapters 1–4 cover Maven's value, installation and configuration, writing a POM, generating a project skeleton, and the "account registration service" background case that runs through the book. Chapters 5–8 go deep into coordinates and dependencies, dependency scope, transitive dependencies and dependency mediation, repository categories (local, remote, central, and private), mirrors and snapshots, the three lifecycles, plugin binding and resolution, aggregation and inheritance, the reactor, and other core mechanisms. Chapters 9–16 cover practical scenarios: setting up a private repository with Nexus, organizing tests and coverage reports with Surefire, continuous integration with Hudson, building and deploying web applications with Jetty and Cargo, version management and automated releases, flexible builds through profiles and resource filtering, project site generation, and using m2eclipse. Chapters 17–18 extend to writing Maven plugins and custom Archetypes. Most of the knowledge points come with hands-on examples, and the case from Chapter 4 is carried through later chapters, making the book suitable for Java developers from first use up to team-level engineering standards.

Editor's review

很多 Java 团队引入 Maven,往往卡在一个很现实的地方:命令行能跑起来,但依赖冲突、私服、多模块聚合、发布流程一出问题就束手无策。这本书的价值,正是把 Maven 从“会敲 mvn 命令”带到“知道它为什么这么工作”。 作者的专业背景是本书的一大加分项:他翻译过《Maven 权威指南》,参与 Nexus 开发,也维护过中央仓库,因此讲仓库、插件解析、依赖调解这些底层机制时,能讲到设计意图,而不只是罗列配置样例。全书用“账户注册服务”作为贯穿案例,从单模块一路演进到多模块聚合、Web 构建和持续集成,读者跟着做一遍,基本就补齐了真实项目里的构建链条。 需要提醒的是,本书基于 Maven 3.0,书中提到的 Hudson、m2eclipse 等工具如今生态已有变化(如 Jenkins、Maven 的 IDE 集成方式)。把它当作理解 Maven 原理与工程实践的经典读物最合适,动手时再对照当前版本的官方文档即可。

Who it's for

A good fit for

  • 已能写 Java 代码、但构建流程依赖 IDE 菜单操作的初中级开发者
  • 需要为团队统一构建规范、搭建私服与持续集成的技术负责人
  • 想把多模块项目从 Ant 或手工脚本迁移到 Maven 的工程人员
  • 想理解依赖调解、插件解析等 Maven 底层机制的进阶读者

Not a good fit for

  • 完全零基础、尚未写过 Java 项目的编程新手
  • 只想查询某条最新配置写法、不需要原理讲解的读者
  • 主要使用 Gradle 等非 Maven 构建体系的开发者

Reading tips

  1. 第 1—4 章按顺序精读并动手敲一遍,先跑通最小项目再往下走
  2. 第 5—8 章是全书精华,建议配合自己的项目改写依赖与多模块结构
  3. 第 9—16 章可按团队现状选读,例如先补私服和持续集成两章
  4. 遇到工具版本差异时,以书中原理为主,配置细节查 Maven 官方文档

About the publisher

China Machine Press China · Founded in 1950

In addition to science and technology and professional publishing, the books in our catalog from China Machine Press also reflect a sustained focus on psychology, computing, management, finance and economics, and social sciences. In psychology, the catalog includes works by C. G. Jung and introductions to analytical psychology, as well as applied topics such as stress and health, and addiction and healing. In computing, it features Structure and Interpretation of Computer Programs (JavaScript Edition). Management and finance titles include Administrative Behavior (4th Edition), The Price of Inequality (Collector's Edition), and This Time Is Different: Eight Centuries of Financial Folly (Commemorative Edition). In the philosophy and history of science, there is The Worldview: The Third Edition. Relevant authors include C. G. Jung, William McGuire, Sonu Shamdasani, and Gabor Maté. Public information is limited; the above summarizes the publisher's profile based solely on the books in our catalog.

Contents

  1. Preface
  2. Acknowledgments
  3. Chapter 1: Introduction to Maven
  4. Chapter 2: Installing and Configuring Maven
  5. Chapter 3: Getting Started with Maven
  6. Chapter 4: Background Case
  7. Chapter 5: Coordinates and Dependencies
  8. Chapter 6: Repositories
  9. Chapter 7: Lifecycles and Plugins
  10. Chapter 8: Aggregation and Inheritance
  11. Chapter 9: Creating a Private Repository with Nexus
  12. Chapter 10: Testing with Maven
  13. Chapter 11: Continuous Integration with Hudson
  14. Chapter 12: Building Web Applications with Maven
  15. Chapter 13: Version Management
  16. Chapter 14: Flexible Builds
  17. Chapter 15: Generating Project Sites
  18. Chapter 16: m2eclipse
  19. Chapter 17: Writing Maven Plugins
  20. Chapter 18: Archetype
  21. Appendix (POM configuration and common plugin reference, etc.)

FAQ

这本书基于哪个 Maven 版本,现在还能用吗?
本书基于 Maven 3.0 编写,并对照 2.x 讲解差异。Maven 3.x 的核心机制(坐标、依赖、生命周期、插件、聚合继承)至今沿用,因此主体内容仍然有效;但 Hudson、m2eclipse 等工具章节需结合当前生态自行更新。
零基础学 Java 的人适合直接读吗?
不太建议。书中默认读者熟悉 Java 项目结构、编译打包和基本命令行操作,直接从安装配置讲到依赖与插件机制。建议先完成一两个可编译运行的 Java 小项目,再阅读本书收获更大。
书里的案例需要联网下载依赖吗?
需要。书中案例会从远程仓库获取构件,建议配置国内镜像或自建 Nexus 私服加速;第 9 章正好讲了私服搭建,可以边读边把自己团队的仓库环境搭起来。
和《Maven权威指南》相比该选哪本?
两本定位不同:作者翻译的《Maven权威指南》偏概念与机制的系统参考,本书更强调国内工程实践,涵盖 Nexus 私服、持续集成、Web 应用构建、版本发布等落地场景。想快速用于项目,可先读本书。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

More by the same author

Top rated in the same category