Maven2 Tutorial

Maven is a high-level, intelligent project management, build and deployment tool provided by Apache?s software foundation group. Maven deals with application development lifecycle management. Maven was originally developed to manage and to minimize the co

Maven2 Tutorial

Maven2 Tutorial

     

Maven is a high-level, intelligent project management, build and deployment tool provided by Apache?s software foundation group. Maven deals with application development lifecycle management. Maven was originally developed to manage and to minimize the complexities of building the Jakarta Turbine project. But its powerful capabilities have made it a core entity of the Apache Software Foundation projects. Actually, for a long time there was a need to standardized project development lifecycle management system and Maven has emerged as a perfect option that meets the needs. Maven has become the de- facto build system in many open source initiatives and it is rapidly being adopted by many software development organizations. This tutorial provides you introduction to Maven 2, shifting from Ant to Maven, Maven basics, Installing and working with maven 2, Maven plugins etc.

  1. An introduction to Maven 2
    Maven2 is an Open Source build tool that made the revolution in the area of building projects. Like the build systems as "make" and "ant" it is not a language to combine the build components but it is a build lifecycle framework.
  2. Maven 2: Features
    Maven is a high-level, intelligent project management, build and deployment tool provided by Apache's software foundation group. Maven deals with application development lifecycle management. 
  3. Shifting from Ant to Maven
    Maven is entirely a different creature from Ant. Ant is simply a toolbox whereas Maven is about the application of patterns in order to achieve an infrastructure which displays the characteristics of visibility, reusability, maintainability, and comprehensibility.
  4. Common concerns to build a project
  5. Maven basics
    1.  Project Object Model
    A Project Object Model or POM is the fundamental unit of work in Maven. It is an xml file that contains information about the
    project and configuration details used by Maven to build the project. It contains default values for most projects. 

    2.  Repository
    Another concept in Maven is that of a repository. The repository holds the artifacts on which your project depends. There are two kinds of repository: local and remote.
    3.  Plugins
  6. Maven provides a plugin execution framework and all work is done by plugins. Maven plugins are available to execute any specific task.
  7. Installing and Getting Hands on Maven
    Now that we have sufficient understanding of the pom.xml file let us get on try something out. Download Maven from maven.apache.org, unzip the archive into your local directory.
  8. Setting Up A Maven2 Repository

    1. Maven2 Repository:  An introduction: 
    2. Learn to Set Up An Internal Private Repository For An Organization
      We have set up an internal Maven Repository  for our organisation so that the developers are not wasting time in searching and downloading the required project libraries. This also allows us to have a single company wide repository for project artifacts. 
    3. Directory Structure of Artifactory-1.2.2
    4. Deployment in Tomcat 6.0
      Deploy the 'war' file of your application in  ?<ARTIFACTORY_INSTALLATION _FOLDER>/webapp? to ?<TOMCAT_INSTALLATION_FOLDER> /webapps?.
    5. Navigating Artifactory
      Start Tomcat, open the browser and navigate http://localhost:8080/artifactory
  9. Maven2 Plug-ins
    Maven 2 Eclipse Plug-in

    Plugins are great in simplifying the life of programmers; it actually reduces the repetitive tasks involved in the programming. In this article our experts will show you the steps required to download and install the Maven Plugin with your eclipse IDE.

      
  10. Develop java persistence example with Maven2
    Getting Started with Maven2 : Download Maven2  from maven.apache.org, unzip the archive into your local directory. Here we are assuming that the local repository already exists.

  11. create web application using maven
    In this section, you will learn to create a web application using maven.

  12. maven jetty plugin
    In this section, you will learn about implementing jetty plugin of maven inside web applications.

  13. Maven Compiler Plugin
    In this section, you will learn about maven compiler plugin and how it can be configure in maven.

  14. Enable Proxy Setting

  15. Change Local Repository

  16. Maven remote repository

  17. Generate a documentation site for Maven project

  18. Convert Maven based web application to support eclipse

  19. Create project from Maven Template