View RSS Feed

Maven

Maven is the Apache build manager for Java projects

  1. Maven (intro)

    by , 11-22-2011 at 06:02 PM (My Java Tips)
    Maven is a software project management tool, based on project object model. It aims at reducing the load of developer by making in software build process simple and faster.


    Following are worth mentioning features of Maven:

    - Provides a uniform build system
    - Provides quality project information
    - Provides guidelines for best practices development
    - Allows transparent migration to new features

    When to use Maven is an interesting question. ...
  2. Pom

    by , 11-07-2011 at 06:01 PM (My Java Tips)
    Maven uses an XML project descriptor to generate the object model for project. This file is POM.XML and should be located at the top level directory of the project.




    The XML file contains all the needed information for the project. Apart from core information, it also contains groupid, version, name and all the libraries needed for the project.

    <dependency>
    <groupid>junit</groupid>
    <artifactid>junit</artifactid> ...
    Categories
    Maven , XML
  3. POM (groupId:artifactId:versi on)

    by , 11-07-2011 at 05:22 PM (My Java Tips)
    A project object model (POM.xml) contains all necessary information about a project like configurations of plugins involved. You might be thinking about Ant build file. You may embed ant tasks inside the POM. A build.xml tells Ant precisely what to do when it is run, a POM states its configuration.



    A POM in simplest form is given below:


    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 ...
    Categories
    Maven , XML
  4. Using Maven - Unit Tests

    by , 11-05-2011 at 07:00 PM (My Java Tips)
    You want Maven to compile your unit tests. Simply place you unit tests in a directory and mention the director under
    unitTestSourceDirectory´tags.

    src/test




    Once that is done, specify the unit tests which you want to run in unitTest XML element. You may use includes and excludes tags to include or exclude the classes.



    Java Code:
             **/*Test*.java 
           
           
             **/BaseTestCase.java
    ...
    Categories
    Maven
  5. Documenting projects

    by , 11-05-2011 at 06:58 PM (My Java Tips)
    Everyone know how important it is to document the project. I wont be shedding light on this. But the aim of this post is
    to introduce how Maven can help you generate project documentation.




    Maven can actually generate a website for your project. Use following command to generate documentation:
    Run the site:generate goal for your project with this command:

    maven site:generate

    Maven will generate html documentation in the docs ...
    Categories
    Maven
  6. Managing dependencies using Maven

    by , 11-05-2011 at 06:42 PM (My Java Tips)
    Maven can manage all jar file dependencies for the build machines. Let me explain how to do this.




    We use dependency element to refer to a jar file which reside in a remote repository. It is said that in near future, the dependencies will extend beyond jar files. Maven places the jar files (fetched from remote repository) on the local repository. The element has three child elements, , , and . Maven looks in the remote repository for a directory with the same name as ...
    Categories
    XML , Maven
  7. M2Eclipse (Tycho)

    by , 11-03-2011 at 06:35 PM (My Java Tips)
    Maven can be integrated in to Eclipse my using M2Eclipse (Tycho). Is is true to say that it is the most mature of the Eclipse integration projects.


    Worth mentioning features of M2Eclipse include:

    - Launching Maven builds from within Eclipse
    - Dependency management for Eclipse build path based on Maven's pom.xml
    - Resolving Maven dependencies from the Eclipse workspace without installing to local Maven repository
    - Automatic downloading of the required ...
    Categories
    Eclipse , Maven
  8. Repositories

    by , 10-30-2011 at 04:48 PM (My Java Tips)
    In Maven, projects can share dependencies which means that different project can use common jar files.


    These jar files will be updated over time and Maven keeps each project current with the latest jar file. These jar files will be placed in a repository on a remote server and are accessed by the projects. These files will be mirrored in a local repository under the Maven installation. The remote repository location is given in the driver.properties file which is located in your Maven ...
    Categories
    Maven , XML