没有合适的资源?快使用搜索试试~ 我知道了~
maven-user-guide.pdf
资源详情
资源评论
资源推荐
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Why a Book? 1
Maven... What is it? 1
Convention over Configuration 1
A Brief History of Build Tools 2
Why not just use Ant? 3
Summary 4
2. A Simple Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Introduction 5
Installation 6
Maven Coordinates 12
Repositories and the POM 13
Site 14
First Run 16
Tips and Tricks 19
Summary 22
3. The POM and Project Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
The POM 25
Project Relationships 28
Tips and Tricks 38
Summary 39
4. The Build Lifecycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
A Structure for Goal Execution 41
Plugins and the Lifecyle 52
Tips and Tricks 57
Summary 58
5. Plugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Introduction 59
v
Configuring Plugins 60
Summary 76
6. Archetypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Using 77
Creating Your Own Archetypes 78
Tips & Tricks 81
Summary 81
7. Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
What Are They For? 83
POM Profiles 85
Settings Profiles 88
Tips and Tricks 89
Summary 92
8. Site Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Introduction 93
Hello World: Building A Simple Project Website 94
Publishing Project Documentation 94
Tuning Your Project Website 104
Tips and Tricks 113
Summary 116
Resources 117
9. Assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Introduction 119
Using Assemblies 119
Creating Assemblies 121
Assembly Tricks and Tips 130
Descriptors 135
Summary 136
10. Writing Plugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Introduction 137
The Mojo 140
Common Tools 144
Mojos in Other Languages 144
There are some important values above to note: 149
Summary 150
vi | Table of Contents
11. Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Introduction 151
A Quick Refresher: Building and Viewing a Project Website 152
Configuring Project-Info Reports 153
Configuring Additional Reports 163
A Quick Note on Additional Reports in the Project Website 164
Other Reports Available from the Maven Project (at ASF) 164
Additional Reports Available from the Codehaus Mojo Project 181
Assembling a Killer Report Suite for Your Project 190
Tips and Tricks 191
Summary 192
Resources 193
12. The Maven Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Discovering the Magic 195
Creating an In-House Repository 195
Repository Managers 200
Tips and Tricks 201
Summary 202
13. Java EE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
The Culmination 203
The Project 203
Running with Free Cargo 217
JBoss Example 218
Integration Testing 219
Tips & Tricks 224
Summary 225
14. Appendix: POM Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Introduction 227
The Basics 229
Build Settings 238
More Project Information 246
Environment Settings 249
Summary 257
15. Appendix: Settings Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Introduction 259
Settings Details 260
Summary 267
Table of Contents | vii
16. Appendix: Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Properties 269
Filtering 270
Tips and Tricks 271
17. Appendix: Plugin APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Plugin APIs 275
viii | Table of Contents
CHAPTER 1
Introduction
Life can only be understood backwards; but it must be lived forwards.
-- Soren Kierke-
gaard
Why a Book?
You may ask "Why a Maven book? There are plenty of documents online, right?". The
problem of diving into any new software project is the problem of where to begin. Yes,
there is a growing wealth of information pertaining to the Maven project - but it is
scattered and piecemeal. They make great reference materials (we even used some docs
for this book) - but many developers, myself included, desire a narrative - a jolly stroll
through the growing Maven metropolis - a place to see the grand sites without being
overwhelmed - where does the yellow-brick road begin? Here.
Maven... What is it?
This is a complex question, but a good one. Maven is a lot of things to a lot of people.
If you use Maven to its fullest extent, it is a build and deployment tool vis-a-vis Ant, a
dependency management tool like Ivy, a metric reporting tool, a documentation gen-
erator, a software project manager, a parent project, a build lifecycle, a project
repository, a convention, a concept, and a community. A user may utilize one or many
of these pieces, or use it for purposes hitherto undiscovered. At its core Maven is a
framework for managing various aspects of a project, providing its own conventions
and tools to meet this end and acting as glue for making existing disparate tools work
in a tractable and orderly manner.
Convention over Configuration
Convention is at the heart of Maven. Convention over configuration is a popular
aphorism these days, and Maven fully embraces this concept. Convention over con-
figuration is at the central philosophy of frameworks such as Ruby on Rails, and more
1
剩余279页未读,继续阅读
winterlion
- 粉丝: 0
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0