Friday, April 30, 2010

Advantage of Maven Transitive Dependency

Getting back to the Hibernate tutorial, now I understand the advantage of using Maven. Defining the dependency elements in the pom.xml is like asking Maven to take care of downloading the required files from the default repositories (repo1.maven.org by default) and paste those files in your repository so that they are accessible by your classpath.
Typing the "ibiblio.org maven2 hsqldb" in Google, you can find maven-metada.xml. This file gives you the groupId, the artifactId and the version number that you can use to have Maven retrieve an HyperSQL database server file that you can include in your project.
For Hibernate, you don't need to download Hibernate bundle as you'll have to manually include hibernate3.jar file and its related libraries in your project and create the correct folder layout for all those libraries to be included in your classpath. Maven relieves you of this burden; what you need to do is to specify the groupId (org.hibernate) and the artifactId (hibernate-core) and the last version available (3.3.1.GA). Those information can be found in either ibiblio.org or Hibernate tutorial book.

No comments: