Introduction to Maven 2

10
Introduction to Maven 2

description

Introduction to Maven 2. Basics. Convention over Configuration Declarative project management DRY. Build Lifecycles. Default Site Clean. Dependency Management. Declarative Transitive 3 qualifiers per dependency GroupId AritfactId Version Coping with Sun jars. Repositories. - PowerPoint PPT Presentation

Transcript of Introduction to Maven 2

Page 1: Introduction to Maven 2

Introduction to Maven 2

Page 2: Introduction to Maven 2

Basics

Convention over Configuration Declarative project management DRY

Page 3: Introduction to Maven 2

Build Lifecycles

Default Site Clean

Page 4: Introduction to Maven 2

Dependency Management

Declarative Transitive 3 qualifiers per dependency

GroupIdAritfactIdVersion

Coping with Sun jars

Page 5: Introduction to Maven 2

Repositories

Place where all jars are stored Local Network / proxy Central

Page 6: Introduction to Maven 2

Archetypes

Project templates Available for various project types DEMO – create sample JSF app mvn archetype:create -

DarchetypeGroupId=org.apache.myfaces.maven \ -DarchetypeArtifactId=maven-archetype-myfaces \ -DarchetypeVersion=1.0-SNAPSHOT \ -DgroupId=myAppId \ -DartifactId=testApp

Page 7: Introduction to Maven 2

Reports

Monitor code health Metrics Code Coverage View codebase as a webpage Track changes

Page 8: Introduction to Maven 2

Mavenizing your project

Modify build section: <build><sourceDirectory>srcDir</sourceDirectory><testSourceDirectory>testDir

</testSourceDirectory>…

</build>

Page 9: Introduction to Maven 2

Multi – module projects

Use <dependencyManagement> to make your life easier

mvn install needed w/ inherited test classes

Let’s look at Terracotta.org’s codebase

Page 10: Introduction to Maven 2

Resources

http://maven.apache.org http://del.icio.us/jimbethancourt/maven