SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Apache Maven
Volodymyr Ostapiv
2014
Agenda
▪ What is Maven
▪ Getting and installing
▪ Basics: POM, GAV, Archetype
▪ pom.xml contents
▪ Some useful plugins
What is Maven
▪Maven is a build automation tool used
primarily for Java projects.
▪ Maven addresses two aspects of building
software:
1. it describes how software is built
2. it describes its dependencies
Maven LifeCycle
•Default lifecycle
–generate-sources/generate-resources
–compile
–test
–package
–integration-test (pre and post)
–install
–Deploy
•Separate “clean” lifecycle
History
– Maven 1 (2003)
– Maven 2 (2005)
▪ Not backwards Compatible
– Maven 3 (2010)
▪ Same as Maven 2 but more stable and with some
additional features
Get it!
Configure
%MAVEN_HOME%confsettings.xml
/usr/local/maven/conf/settings.xml
UserProfile.m2
~/.m2/
Create simple project
mvn archetype:generate
-DgroupId=[myGroup]
-DartifactId=[myArtifact]
-DarchetypeArtifactId=maven-
archetype-archetype
OR
mvn archetype:generate
Arche-who? O_o
An archetype is defined as an original pattern or model
from which all other things of the same kind are made.
Archetype is a Maven project templating toolkit.
Maven + IDE
mvn idea:idea mvn eclipse:eclipse
Generate project files for the most popular IDEs
Path Conventions
Maven Project Object Model (POM)
▪ Describes a project
– Name and Version
– Artifact Type
– Source Code Locations
– Dependencies
– Plugins
– Profiles (Alternate build config.)
▪ Uses XML by default
Project Name (GAV)
▪ Maven uniquely identifies a project using:
– groupID: project grouping identifier (no spaces
or colons)
▪ Usually loosely based on Java package
– artfiactId: name of project (no spaces or
colons)
– version: Version of project
▪ Format {Major}.{Minor}.{Maintanence}
▪ Add ‘-SNAPSHOT ‘ to identify in development
Project Name (GAV)
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.lds.training</groupId>
<artifactId>maven-training</artifactId>
<version>1.0</version>
<name>Windows 8</name>
<description>The best OS ever!</description>
<packaging>jar</packaging>
<properties>
<java.version>1.6</java.version>
<properties>
</project>
Dependencies
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.5</version>
<scope>compile</scope>
</dependency>
<dependencies>
Dependency scope
• compile (default)
• provided (by JDK or a container at runtime)
• runtime (not required for compilation)
• test (used only during tests)
• system
• import (only available in Maven 2.0.9 or later)
Properties
<properties>
<jdk.version>1.6</jdk.version>
<spring.version>3.1.2.RELEASE</spring.version>
<spring.batch.version>2.1.8.RELEASE</spring.batch.version>
</properties>
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-infrastructure</artifactId>
<version>${spring.batch.version}</version>
</dependency>
mvn install -Dmyproperty=my property from command line
Exclusions
<exclusions>
<exclusion>
<groupId>org.softserve.sse</groupId>
<artifactId>softserve-sse</artifactId>
</exclusion>
</exclusions>
Profiles
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
(mvn install -Pprofilename)
Profile activation
Operating System based:
<activation>
<os>
<family>unix</family>
</os>
</activation>
<activation>
<os>
<name>Windows XP</name>
<family>Windows</family>
<arch>x86</arch>
<version>5.1.2600</version>
</os>
</activation>
JDK based:
<activation>
<jdk>1.4</jdk>
</activation>
<activation>
<jdk>[1.3,1.6)</jdk>
</activation>
Profile activation
System property based:
<activation>
<property>
<name>environment</name>
<value>test</value>
</property>
</activation>
File system state based:
<activation>
<file>
<missing>
target/maven/somefile
</missing>
</file>
</activation>
Plugins
Here real magic starts
maven-surefire-plugin
surefire:test
jetty-maven-plugin
mvn jetty:run
tomcat-maven-plugin
mvn tomcat:run
maven-antrun-plugin
mvn antrun:run
maven-compiler-plugin
mvn compiler:compile
mvn compiler:testCompile
maven-assembly-plugin
mvn assembly:single
maven-shade-plugin
mvn shade:shade
maven-dependency-plugin
mvn dependency:analyze
mvn dependency:tree
That’s all

Weitere ähnliche Inhalte

Was ist angesagt?

Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenGeert Pante
 
Maven for Dummies
Maven for DummiesMaven for Dummies
Maven for DummiesTomer Gabel
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to MavenVadym Lotar
 
Introduction to Apache Maven
Introduction to Apache MavenIntroduction to Apache Maven
Introduction to Apache MavenRajind Ruparathna
 
An Introduction to Maven Part 1
An Introduction to Maven Part 1An Introduction to Maven Part 1
An Introduction to Maven Part 1MD Sayem Ahmed
 
Using Maven 2
Using Maven 2Using Maven 2
Using Maven 2andyhot
 
Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01rhemsolutions
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - ExplainedSmita Prasad
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with MavenSid Anand
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 OverviewMike Ensor
 

Was ist angesagt? (20)

Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in Maven
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
Maven for Dummies
Maven for DummiesMaven for Dummies
Maven for Dummies
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to Maven
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Introduction to Apache Maven
Introduction to Apache MavenIntroduction to Apache Maven
Introduction to Apache Maven
 
Apache Maven In 10 Slides
Apache Maven In 10 SlidesApache Maven In 10 Slides
Apache Maven In 10 Slides
 
Maven ppt
Maven pptMaven ppt
Maven ppt
 
An Introduction to Maven Part 1
An Introduction to Maven Part 1An Introduction to Maven Part 1
An Introduction to Maven Part 1
 
Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
 
Maven basics
Maven basicsMaven basics
Maven basics
 
Using Maven 2
Using Maven 2Using Maven 2
Using Maven 2
 
Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01
 
Maven Overview
Maven OverviewMaven Overview
Maven Overview
 
Maven
Maven Maven
Maven
 
Maven Basics - Explained
Maven Basics - ExplainedMaven Basics - Explained
Maven Basics - Explained
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with Maven
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 Overview
 
Apache maven 2 overview
Apache maven 2 overviewApache maven 2 overview
Apache maven 2 overview
 

Ähnlich wie Apache Maven for SoftServe IT Academy

Ähnlich wie Apache Maven for SoftServe IT Academy (20)

Apache Maven for AT/QC
Apache Maven for AT/QCApache Maven for AT/QC
Apache Maven for AT/QC
 
Apache Maven basics
Apache Maven basicsApache Maven basics
Apache Maven basics
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Introduction To Maven2
Introduction To Maven2Introduction To Maven2
Introduction To Maven2
 
maven
mavenmaven
maven
 
P&MSP2012 - Maven
P&MSP2012 - MavenP&MSP2012 - Maven
P&MSP2012 - Maven
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Jdc 2010 - Maven, Intelligent Projects
Jdc 2010 - Maven, Intelligent ProjectsJdc 2010 - Maven, Intelligent Projects
Jdc 2010 - Maven, Intelligent Projects
 
Ordina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - MavenOrdina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - Maven
 
Note - Apache Maven Intro
Note - Apache Maven IntroNote - Apache Maven Intro
Note - Apache Maven Intro
 
Maven
MavenMaven
Maven
 
Java, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorialJava, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorial
 
Learning Maven by Example
Learning Maven by ExampleLearning Maven by Example
Learning Maven by Example
 
Mavennotes.pdf
Mavennotes.pdfMavennotes.pdf
Mavennotes.pdf
 
Apache Maven at GenevaJUG by Arnaud Héritier
Apache Maven at GenevaJUG by Arnaud HéritierApache Maven at GenevaJUG by Arnaud Héritier
Apache Maven at GenevaJUG by Arnaud Héritier
 
Geneva Jug (30th March, 2010) - Maven
Geneva Jug (30th March, 2010) - MavenGeneva Jug (30th March, 2010) - Maven
Geneva Jug (30th March, 2010) - Maven
 
Intro to Maven.ppt
Intro to Maven.pptIntro to Maven.ppt
Intro to Maven.ppt
 
Embrace Maven
Embrace MavenEmbrace Maven
Embrace Maven
 

Kürzlich hochgeladen

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 

Kürzlich hochgeladen (20)

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 

Apache Maven for SoftServe IT Academy

Hinweis der Redaktion

  1. http://maven.apache.org/
  2. Build automation is the act of scripting or automating a wide variety of tasks that software developers do in their day-to-day activities including things like:compiling computer source code into binary codepackaging binary coderunning testsdeployment to production systemscreating documentation and/or release notes
  3. mvn installInvokes generate* and compile, test, package, integration-test, installmvn clean Invokes just cleanmvn clean compileClean old builds and execute generate*, compilemvn compile installInvokes generate*, compile, test, integration-test, package, installmvn test cleanInvokes generate*, compile, test then cleans
  4. 1. Install JDK, set JAVA_HOME2. Download and extract Apache Maven (http://maven.apache.org/)3. Add MAVEN_HOME system variable4. Add MAVEN_HOME to PATH5.“mvn –version“.
  5. &lt;project&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.softserve.demo&lt;/groupId&gt; &lt;artifactId&gt;simple-web-project&lt;/artifactId&gt; &lt;packaging&gt;war&lt;/packaging&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;junit&lt;/groupId&gt; &lt;artifactId&gt;junit&lt;/artifactId&gt; &lt;version&gt;3.8.1&lt;/version&gt; &lt;scope&gt;test&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;build&gt; &lt;finalName&gt;simple-web-project&lt;/finalName&gt; &lt;/build&gt; &lt;/project&gt;
  6. mvnarchetype:generate-DgroupId={com.softserve.demo}-DartifactId={simple-web-project}-DarchetypeArtifactId=maven-archetype-webapp-DinteractiveMode=false
  7. Maven is opinionated about project structuretarget: Default work directorysrc: All project source files go in this directorysrc/main: All sources that go into primary artifactsrc/test: All sources contributing to testing projectsrc/main/java: All java source filessrc/main/webapp: All web source filessrc/main/resources: All non compiled source filessrc/test/java: All java test source filessrc/test/resources: All non compiled test source files
  8. &lt;dependency&gt; &lt;groupId&gt;net.lightbody.bmp&lt;/groupId&gt; &lt;artifactId&gt;browsermob-proxy&lt;/artifactId&gt; &lt;version&gt;2.0-beta-8&lt;/version&gt; &lt;scope&gt;test&lt;/scope&gt;&lt;exclusions&gt;&lt;exclusion&gt; &lt;groupId&gt;org.softserve.sse&lt;/groupId&gt; &lt;artifactId&gt;softserve-sse&lt;/artifactId&gt; &lt;/exclusion&gt; &lt;/exclusions&gt;&lt;/dependency&gt;
  9. &lt;profiles&gt;&lt;profile&gt;&lt;id&gt;default&lt;/id&gt;&lt;activation&gt; &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;&lt;/activation&gt; &lt;build&gt; &lt;finalName&gt;${name}&lt;/finalName&gt; &lt;plugins&gt; &lt;plugin&gt;…&lt;/plugin&gt; &lt;plugins&gt; &lt;/build&gt;&lt;/profile&gt;&lt;/profiles&gt;
  10. &lt;activation&gt; &lt;os&gt; &lt;family&gt;windows&lt;/family&gt; &lt;/os&gt;&lt;/activation&gt;
  11. Use –DskipTests to skip test
  12. http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html
  13. http://tomcat.apache.org/maven-plugin.html
  14. https://maven.apache.org/plugins/maven-antrun-plugin/
  15. &lt;plugin&gt; &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt; &lt;version&gt;2.3.1&lt;/version&gt; &lt;configuration&gt; &lt;source&gt;1.6&lt;/source&gt; &lt;target&gt;1.6&lt;/target&gt; &lt;compilerArgument&gt;-proc:none&lt;/compilerArgument&gt; &lt;/configuration&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;run-annotation-processors-only&lt;/id&gt; &lt;phase&gt;generate-sources&lt;/phase&gt; &lt;configuration&gt; &lt;compilerArgument&gt;-proc:only&lt;/compilerArgument&gt; &lt;!-- If your app has multiple packages, use this include filter to execute the processor only on the package containing your entities --&gt; &lt;!-- &lt;includes&gt; &lt;include&gt;**/model/*.java&lt;/include&gt; &lt;/includes&gt; --&gt; &lt;/configuration&gt; &lt;goals&gt; &lt;goal&gt;compile&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt;&lt;/plugin&gt;
  16. For Spring apps use onejar-maven-plugin&lt;plugin&gt;&lt;groupId&gt;com.jolira&lt;/groupId&gt;&lt;artifactId&gt;onejar-maven-plugin&lt;/artifactId&gt;&lt;version&gt;1.4.4&lt;/version&gt;&lt;executions&gt;&lt;execution&gt;&lt;configuration&gt;&lt;mainClass&gt;com.package.core.Main&lt;/mainClass&gt;&lt;!-- Optional, default is false --&gt;&lt;attachToBuild&gt;true&lt;/attachToBuild&gt;&lt;!-- Optional, default is &quot;one jar&quot; --&gt;&lt;classifier&gt;onejar&lt;/classifier&gt;&lt;/configuration&gt;&lt;goals&gt;&lt;goal&gt;one-jar&lt;/goal&gt;&lt;/goals&gt;&lt;/execution&gt;&lt;/executions&gt;&lt;/plugin&gt;
  17. http://maven.apache.org/plugins/maven-shade-plugin/
  18. &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt; &lt;version&gt;2.4&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;analyze&lt;/id&gt; &lt;phase&gt;verify&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;analyze-only&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;failOnWarning&gt;true&lt;/failOnWarning&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt;&lt;/plugin&gt;