SlideShare ist ein Scribd-Unternehmen logo
1 von 55
Downloaden Sie, um offline zu lesen
Apache Maven
Dev.2015
AirconChen
Apache Maven
• project
• POM.xml
build( ), Dependencies( ),
SCMs( ),Release( ),Documentation( ),
Reporting( )
• build project
• project , ,
Apache Maven
• project
• plugin tools
JDK
Maven Java JDK
Apache Maven Download Site
2015/11/24 LastVersion:Apache Maven 3.3.9
Maven
• M2_HOME=C:Program FilesApache Software
Foundationapache-maven-3.2.5
• M2=%M2_HOME%bin
• MAVEN_OPTS=-Xms256m -Xmx512m
• “;%M2%” “Path”
POM
Project Object Model (POM)
• Maven
• project build project
• Maven POM Project
dependencies, plugins, goals, build profiles,
project version, developers, mailing list
• POM groupId, artifactId, version
Project repository Unique
Key
key
groupId com.fpg.ec
artifactId
authority, bid, j2sp
groupId+artifactId repository project
version
project
groupid+artifactid repository
com.fpg.ec:authority:1.0
com.fpg.ec:authority:1.1
• project POM.xml
• POM groupId, artifactId,version
• repository groupId:artifactId:version
Super POM
• POM POM
• Effective POM
Project Object Model (POM)
project project
mavenDependencies
Maven Build Lifecycle
Maven Build Lifecycle
1. validate
2. initialize
3. generate-sources
4. process-sources
5. generate-resources
6. process-resources
7. compile
8. process-classes
9. generate-test-sources
10.process-test-sources
11.test-compile
12.process-test-classes
13.test
14.prepare-package
15.package
14.prepare-package
15.package
16.pre-integration-test
17.integration-test
18.post-integration-test
19.verify
20.install
21.deploy
• mvn compile,
compile run
• package (JAR, WAR, EAR)
maven lifecycle
Repositories
Maven Repositories
• Local Repositories
Maven
local repository default: C:Users{Login Account}.m2repository
• Central Repositories
Maven
• Remote Repositories
Maven
1. Local repositories, 2
2. Central repositories,
Remote repositories 4
3. Remote repositories
4. Remote repositories
Plugin
• Maven plugin framework,
task plugin
• plugin jar, WAR, EAR , javac ,
, project project report
• mvn [plugin name]:[goals name]
• maven-compiler-plugin
compile goal . mvn compiler:compile
• Maven plugin
• build plugins
pom.xml <build>
• reporting plugins
pom.xml <reporting>
plugin
Create project
• Maven archetype project
• Archetype maven plugin PG
• cmd mvn archetype:generate
• eclipse maven project
• JavaPath JDK JRE, package
• mvn clean package
• jar target
• target/surefire-reports
• comile test
• snapshot
•
maven build repository
snapshot
• authority:1.0 authority
maven
snapshot
Snapshot( )
• Authority package
• WAR package
Authority
1.0
WAR
Authority1.0-SNAPSHOT
WAR
Authority1.0-SNAPSHOT
Auto Build
Dependencies
Scope
Lib1:1.0
Lib2:1.0
Lib3:1.0
Root:1.0 App-Core-lib:1.0
App-Data-lib:1.0
App-UI-WAR:1.0
• App-UI-WAR App-Core-lib App-Data-lib
• Root App-Core-lib App-Data-lib parent
• Root Lib1 lib2 Lib3
• archetype:generate
• maven-archetype-webapp
your artifactId
Webapp
Eclipse IDE + Maven
m2eclipse plugin
Run Web Project
by Maven
1.New Maven Project
2.default workspace location
3. archetype webapp
4.Define your coordinate
5. project
servlet-api.jar
6. servlet-api dependance
7. tomcat maven plugin
http://tomcat.apache.org/maven-plugin-trunk/index.html
8.Run as > Maven build
9.Tomcat run
Module
Web layer project project,
web layer project POM.xml
<modules>
<module> project name 1</module>
<module> project name 2</module>
…
<module> project name N</module>
</modules>
But
Maven
•
•
•
• Maven (Gitbook)

Weitere ähnliche Inhalte

Was ist angesagt?

Using Apache Camel connectors for external connectivity
Using Apache Camel connectors for external connectivityUsing Apache Camel connectors for external connectivity
Using Apache Camel connectors for external connectivity
Claus Ibsen
 

Was ist angesagt? (20)

Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDevTriple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
 
php[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Upphp[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Up
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
 
Apache Lucene for Java EE Developers
Apache Lucene for Java EE DevelopersApache Lucene for Java EE Developers
Apache Lucene for Java EE Developers
 
Learning chef
Learning chefLearning chef
Learning chef
 
Spring Framework 3.2 - What's New
Spring Framework 3.2 - What's NewSpring Framework 3.2 - What's New
Spring Framework 3.2 - What's New
 
Performance Testing using Real Browsers with JMeter & Webdriver
Performance Testing using Real Browsers with JMeter & WebdriverPerformance Testing using Real Browsers with JMeter & Webdriver
Performance Testing using Real Browsers with JMeter & Webdriver
 
BP-10 Keeping Your Sanity – Rapid Development & Deployment Tools
BP-10 Keeping Your Sanity – Rapid Development & Deployment ToolsBP-10 Keeping Your Sanity – Rapid Development & Deployment Tools
BP-10 Keeping Your Sanity – Rapid Development & Deployment Tools
 
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012
 
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
 
Getting Started with Apache Camel - Malmo JUG - March 2013
Getting Started with Apache Camel - Malmo JUG - March 2013Getting Started with Apache Camel - Malmo JUG - March 2013
Getting Started with Apache Camel - Malmo JUG - March 2013
 
Using Apache Camel connectors for external connectivity
Using Apache Camel connectors for external connectivityUsing Apache Camel connectors for external connectivity
Using Apache Camel connectors for external connectivity
 
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
 
Apache maven and its impact on java 9 (Java One 2017)
Apache maven and its impact on java 9 (Java One 2017)Apache maven and its impact on java 9 (Java One 2017)
Apache maven and its impact on java 9 (Java One 2017)
 
"Design First" APIs with Swagger
"Design First" APIs with Swagger"Design First" APIs with Swagger
"Design First" APIs with Swagger
 
Apache Camel workshop at BarcelonaJUG in January 2014
Apache Camel workshop at BarcelonaJUG in January 2014Apache Camel workshop at BarcelonaJUG in January 2014
Apache Camel workshop at BarcelonaJUG in January 2014
 
Getting started with Apache Camel - jDays 2013
Getting started with Apache Camel - jDays 2013Getting started with Apache Camel - jDays 2013
Getting started with Apache Camel - jDays 2013
 
The unintended benefits of Chef
The unintended benefits of ChefThe unintended benefits of Chef
The unintended benefits of Chef
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationIBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
 

Andere mochten auch

HomeIO - Aleksander Kwiatkowski (PRUG 2.0)
HomeIO - Aleksander Kwiatkowski (PRUG 2.0)HomeIO - Aleksander Kwiatkowski (PRUG 2.0)
HomeIO - Aleksander Kwiatkowski (PRUG 2.0)
ecommerce poland expo
 
Material Cristalino Y Paracristalino
Material Cristalino Y ParacristalinoMaterial Cristalino Y Paracristalino
Material Cristalino Y Paracristalino
ayquinax
 

Andere mochten auch (15)

Ionic
IonicIonic
Ionic
 
Seminario de vida en el espíritu santo semana-1
Seminario  de vida en el espíritu santo semana-1Seminario  de vida en el espíritu santo semana-1
Seminario de vida en el espíritu santo semana-1
 
The best miniature painting slieshare by le artique for corporate gifting
The best miniature painting slieshare by le artique for corporate giftingThe best miniature painting slieshare by le artique for corporate gifting
The best miniature painting slieshare by le artique for corporate gifting
 
teaching
teaching teaching
teaching
 
Spring
SpringSpring
Spring
 
Obi2014 full
Obi2014 fullObi2014 full
Obi2014 full
 
HomeIO - Aleksander Kwiatkowski (PRUG 2.0)
HomeIO - Aleksander Kwiatkowski (PRUG 2.0)HomeIO - Aleksander Kwiatkowski (PRUG 2.0)
HomeIO - Aleksander Kwiatkowski (PRUG 2.0)
 
Institutional Performance Case Study -- Humboldt State University, Arcata, Ca...
Institutional Performance Case Study -- Humboldt State University, Arcata, Ca...Institutional Performance Case Study -- Humboldt State University, Arcata, Ca...
Institutional Performance Case Study -- Humboldt State University, Arcata, Ca...
 
Climate zone group 5
Climate zone group 5Climate zone group 5
Climate zone group 5
 
Digital Marketing as Seen by Czech Digital Agencies
Digital Marketing as Seen by Czech Digital AgenciesDigital Marketing as Seen by Czech Digital Agencies
Digital Marketing as Seen by Czech Digital Agencies
 
L´accent diacrític
L´accent diacríticL´accent diacrític
L´accent diacrític
 
Acondicionamiento fisica en gimanasia artistica willy
Acondicionamiento fisica en gimanasia artistica willyAcondicionamiento fisica en gimanasia artistica willy
Acondicionamiento fisica en gimanasia artistica willy
 
Material Cristalino Y Paracristalino
Material Cristalino Y ParacristalinoMaterial Cristalino Y Paracristalino
Material Cristalino Y Paracristalino
 
How discovery keeps innovating
How discovery keeps innovatingHow discovery keeps innovating
How discovery keeps innovating
 
Bella belarus
Bella belarusBella belarus
Bella belarus
 

Ähnlich wie Apache Maven

Apache Continuum Build, Test, and Release
Apache Continuum Build, Test, and ReleaseApache Continuum Build, Test, and Release
Apache Continuum Build, Test, and Release
elliando dias
 

Ähnlich wie Apache Maven (20)

Maven.pptx
Maven.pptxMaven.pptx
Maven.pptx
 
Apache maven 2 overview
Apache maven 2 overviewApache maven 2 overview
Apache maven 2 overview
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
Apache Maven 4.0.0 - The Future
Apache Maven 4.0.0 - The FutureApache Maven 4.0.0 - The Future
Apache Maven 4.0.0 - The Future
 
Learning Maven by Example
Learning Maven by ExampleLearning Maven by Example
Learning Maven by Example
 
Session 2
Session 2Session 2
Session 2
 
Session 2
Session 2Session 2
Session 2
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 Overview
 
Использование maven для сборки больших модульных c++ проектов на примере Odin...
Использование maven для сборки больших модульных c++ проектов на примере Odin...Использование maven для сборки больших модульных c++ проектов на примере Odin...
Использование maven для сборки больших модульных c++ проектов на примере Odin...
 
C++ Windows Forms L01 - Intro
C++ Windows Forms L01 - IntroC++ Windows Forms L01 - Intro
C++ Windows Forms L01 - Intro
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web Applications
 
DevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and ProcessesDevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and Processes
 
Lorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - MavenLorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - Maven
 
DevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
DevOps on AWS: Accelerating Software Delivery with the AWS Developer ToolsDevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
DevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
 
Introduction in Apache Maven2
Introduction in Apache Maven2Introduction in Apache Maven2
Introduction in Apache Maven2
 
Maven
MavenMaven
Maven
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless World
 
AWS Code Services
AWS Code ServicesAWS Code Services
AWS Code Services
 
Apache Continuum Build, Test, and Release
Apache Continuum Build, Test, and ReleaseApache Continuum Build, Test, and Release
Apache Continuum Build, Test, and Release
 

Kürzlich hochgeladen

Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 

Kürzlich hochgeladen (20)

Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 

Apache Maven