Presentation is loading. Please wait.

Presentation is loading. Please wait.

Maven for building Java applications By Nalin De Zoysa

Similar presentations


Presentation on theme: "Maven for building Java applications By Nalin De Zoysa"— Presentation transcript:

1 Maven for building Java applications By Nalin De Zoysa http://nalin-blogging.blogspot.com/

2 Notes This is an interactive session Please ask questions Prerequisites – Introduction to the Java Stack

3 Outline Introduce maven Basic Maven Pom File and Project Structure Dependencies Maven Central Repository Maven Basic Operations

4 Introduce Maven What is maven – Apache Maven is a build tool to support the developer at the whole process of a software project. – Based on the concept of XML Project Object Model (POM). –Originally developed for building Turbine. – A small core with numerous plugins

5 Introduce Maven What it does - Automate the process of the creation of the initial folder structure - Performing the compilation and testing and the packaging and deployment - Convention over configuration(avoid as much configuration as possible, by supplying project templates (archtypes)) - Dependency management: - dependencies to other projects.(resolves the dependencies)

6 Introduce Maven Cont.. NameDescription groupIddefines a unique base name of the organization or group that created the project. This is normally a domain name. For the generation the groupId also defines the package of the main class. artifactIddefines the unique name of the artifact. In our case it's the same like the groupId, but it could also be a simple name like "SuperCalculator". The generation uses this value as name of the root folder for out project. packagingdefines the packaging method. This could be e.g. jar, war or ear. This setting has influence on the whole life cycle. versionThis defines the version of the artifacts generated from our project.

7 Maven Under the Hood forehead classloader util launcher maven core, jelly, werkz Maven plugins javajarwarejb eargumpxdocletjavadoc test jalopy cactusartifactxdoc sitejunitetc… ant

8 Maven Architecture Overview Build System Local Repo Remote Repo maven project.xml (pom) maven.xml (goals) http Site The Most Important Feature Remote Repository

9 Basic Operations - mvn install # default to run Maven #compiles, build and install the build result - mvn clean install -o # work off-line, i.e. use the local maven repository - mvn test Instead of running a full build with packaging it is also possible to just run single phases of a life cycle.

10 Demonstration... Lets use maven demo

11 Get More... http://maven.apache.org http://www.onjava.com/pub/a/onjava/2003/10/22/maven.html http://www-106.ibm.com/developerworks/java/library/j-maven http://www.javausergroup.at/events/maven.pdf http://www.theserverside.com/articles/article.jsp?l=MavenMagi c http://www.theserverside.com/articles/article.jsp?l=MavenMagi c http://blogs.codehaus.org/people/vmassol/archives/000080.ht ml http://blogs.codehaus.org/people/vmassol/archives/000080.ht ml http://www.javaworld.com/javaworld/jw-10-2002/jw-1011- maven.html http://www.javaworld.com/javaworld/jw-10-2002/jw-1011- maven.html

12 www.hSenidbiz.com www.hSenidbiz.com


Download ppt "Maven for building Java applications By Nalin De Zoysa"

Similar presentations


Ads by Google