12
Maven – The build paraphernalia [email protected]

Maven – The build paraphernalia

Embed Size (px)

DESCRIPTION

An introduction to maven

Citation preview

Page 1: Maven – The build paraphernalia

Maven – The build [email protected]

Page 2: Maven – The build paraphernalia

What’s Inside

• Why a build tool?• Maven• Advantages• Core Concepts – POM• Dependency Management.• Report Generation• Resources

Page 3: Maven – The build paraphernalia

Why a build tool?• Enables repeatable builds.• Embeds build knowledge in to the project.• Makes it possible for automated builds• Continuous Integration• Makes it easy for release management• ANT ,Make, Shell scripts………(Where is Maven .. ?)

Page 4: Maven – The build paraphernalia

Maven - “accumulator of knowledge”• A new approach to project development.• Based on the concept of XML Project Object Model (POM).• Configure your build don’t script it.• Define what to build not how to.• Superior dependency management.• Maven is not a build tool, It’s a development tool.• Coherent site of project information.

Page 5: Maven – The build paraphernalia

Advantages• Standardized project layout and project structure• Standardized dependency management.• Instant downloads of new plug-in and features as the developer

needs them. • Website generation for up-to-date project information. • Integration with source control: CVS and Subversion.

Page 6: Maven – The build paraphernalia

Core Concepts – POM• All Information about the project is contained in a single file called

pom.xml• Pom contains the detailed metadata information about the project.• An Average pom.xml contains:

– Project Management– Project Build– Project Dependency– Project reports– <see notes>

Page 7: Maven – The build paraphernalia

Dependency Management• Repository [local and remote]• Just define the dependency and forget about them – Maven will do

the rest.

Page 8: Maven – The build paraphernalia

Report [Site] Generation• Site generation is a key feature of maven. It contains:

– A reference to build server– Javadoc– Issue tracking reference– Test and quality reports– Copy paste dectetor [CPD]

• The reports are generated by the plugins that maven provides.• Maven uses the “mvn site” goal to create the site.• The site is usually a htm document and we can customize it using

CSS/XSLT

Page 9: Maven – The build paraphernalia

e.g. Coverage Report

Page 10: Maven – The build paraphernalia

day-to-day maven...• mvn clean• mvn install• mvn test• mvn install -Dmaven.test.skip• mvn eclipse:eclipse • mvn eclipse:clean• mvn eclipse:clean eclipse:eclipse • mvn site• mvn install:install-file -DgroupId=com.ireasoning -DartifactId=snmpv3 -Dversion=5.0

-Dfile=D:\subin_projects\jars\snmp\ireasoningsnmp.jar -Dpackaging=jar -DgeneratePom=true

<dependency>

<groupId>com.ireasoning</groupId>

<artifactId>snmpv3</artifactId>

<version>5.0</version>

</dependency>

Page 11: Maven – The build paraphernalia

ReferencesMaven getting started guide

http://maven.apache.org/guides/getting-started/index.html

Building web applications with maven-2

http://today.java.net/pub/a/today/2007/03/01/building-web-applications-with-maven-2.html

Frequently Asked Technical Questions

http://maven.apache.org/general.html

Page 12: Maven – The build paraphernalia

Thank You