Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Maven: a forty five minute crash course
Search
justin j. moses
November 16, 2011
Technology
6
1.5k
Maven: a forty five minute crash course
A look at how Maven, the Java project management tool, operates.
justin j. moses
November 16, 2011
Tweet
Share
More Decks by justin j. moses
See All by justin j. moses
The Sound of Music
justin
0
80
Intro to NoSQL & MongoDB
justin
1
74
StackUp: MongoDB Cloud Manager
justin
0
180
Robotlegs 2.0
justin
1
140
Other Decks in Technology
See All in Technology
Building Products in the LLM Era
ymatsuwitter
10
5.4k
トラシューアニマルになろう ~開発者だからこそできる、安定したサービス作りの秘訣~
jacopen
2
2k
TAMとre:Capセキュリティ編 〜拡張脅威検出デモを添えて〜
fujiihda
2
240
偶然 × 行動で人生の可能性を広げよう / Serendipity × Action: Discover Your Possibilities
ar_tama
1
1.1k
関東Kaggler会LT: 人狼コンペとLLM量子化について
nejumi
3
580
(機械学習システムでも) SLO から始める信頼性構築 - ゆる SRE#9 2025/02/21
daigo0927
0
110
個人開発から公式機能へ: PlaywrightとRailsをつなげた3年の軌跡
yusukeiwaki
11
3k
Cloud Spanner 導入で実現した快適な開発と運用について
colopl
1
650
The Future of SEO: The Impact of AI on Search
badams
0
200
Goで作って学ぶWebSocket
ryuichi1208
0
280
プロダクトエンジニア構想を立ち上げ、プロダクト志向な組織への成長を続けている話 / grow into a product-oriented organization
hiro_torii
1
190
クラウドサービス事業者におけるOSS
tagomoris
1
770
Featured
See All Featured
Making Projects Easy
brettharned
116
6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
We Have a Design System, Now What?
morganepeng
51
7.4k
Adopting Sorbet at Scale
ufuk
74
9.2k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Navigating Team Friction
lara
183
15k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
410
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.1k
Being A Developer After 40
akosma
89
590k
The World Runs on Bad Software
bkeepers
PRO
67
11k
Statistics for Hackers
jakevdp
797
220k
Transcript
MAV EN a forty five minute crash course
1. definition
Maven is a build automation tool.
It’s built in Java and lives under the Apache umbrella,
(∴ still new to Flex developers)
it promotes convention over configuration
and, it is hierarchical.
Everything builds via a Project Object Model (POM): aka the
blueprint.
A build generates one or more artifacts. (Typically one artifact
per POM)
Artifacts are classified by groupId, artifactId, packaging (type) and version.
Versions stamped with SNAPSHOT are treated as such.
Artifacts are filed away in repositories using: /[groupId]/[artifactId]/[version]/[artifactId]-[version].[ext] eg. /org/sonatype/flexmojos/4.0-SNAPSHOT/flexmojos-4.0-SNAPSHOT.swc
2. building
A goal is a single action.
A phase is a collection of goals. [M:M]
A lifecycle is a sequence of phases (upto & including).
The odd couple: clean & install. > mvn clean install
The packaging (JAR, SWC, etc) typically defines the goals within
each phase.
In general, the default lifecycle involves the following phases: ▪
validate ▪ compile ▪ test ▪ package ▪ integration-test ▪ verify ▪ install ▪ deploy
In addition, plugins provide goals and can bind them to
phases. eg. > mvn compiler:compile compiler:testCompile
Plugins include compiler, install, scm, release, javadoc, eclipse, etc.
3. dependencies
Dependencies are hosted in repositories.
Each install of Maven has a repository. (~/.m2 is your
new best friend).
In order to add new dependencies to your repository, you
can simply > mvn install:install-file
You add references to repositories either in your POM or
in your settings.xml file.
When building, if a dependency is missing, Maven will try
to download it from an upstream repository.
How are dependencies shared across repositories? Nexus.
Nexus allows an organisation to share artifacts both internally and
externally.
It has out-of-the-box support for both snapshot and release repositories.
So, what about dependencies on teh internez?
Nexus will proxy to other external Nexus repositories.
If the dependency isn’t hosted - there’s a 3rd Party
repo that you can upload into.
4. configuration
In order to build multiple artifacts, create modules for each
artifact and one parent POM.
Maven can also create IDE projects from the POM. (never
check in a .project file or dependency again)
It also allows you to create archetypes as new project
templates.
You can use profiles to customize the build. They can
activate based on environment &/or set conditions.
5. denouement
Maven can be hours of endless frustration, yet somehow it’s
all worth it.
fin.