37.3. Dependency Management using Maven
Maven supports transitive dependency management, and can be used to manage your project's dependencies. You can integrate Maven into your Ant build with Maven Ant Tasks, or use Maven to build and deploy your project.
This section will not tell you how to use Maven. Instead, we will show you some basic Project Object Models (POMs) you can use.
Released versions of Maven are available in http://repository.jboss.org/maven2 , and nightly snapshots are available in http://snapshots.jboss.org/maven2.
All Seam artifacts are available in Maven:
<dependency> <groupId>org.jboss.seam</groupId> <artifactId>jboss-seam</artifactId> </dependency>
<dependency> <groupId>org.jboss.seam</groupId> <artifactId>jboss-seam-ui</artifactId> </dependency>
<dependency> <groupId>org.jboss.seam</groupId> <artifactId>jboss-seam-pdf</artifactId> </dependency>
<dependency> <groupId>org.jboss.seam</groupId> <artifactId>jboss-seam-remoting</artifactId> </dependency>
<dependency> <groupId>org.jboss.seam</groupId> <artifactId>jboss-seam-ioc</artifactId> </dependency>
<dependency> <groupId>org.jboss.seam</groupId> <artifactId>jboss-seam-ioc</artifactId> </dependency>
The following sample POM will give you Seam, a JPA (provided by Hibernate), Hibernate Validator and Hibernate Search:
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.jboss.seam.example/groupId> <artifactId>my-project</artifactId> <version>1.0</version> <name>My Seam Project</name> <packaging>jar</packaging> <repositories> <repository> <id>repository.jboss.org</id> <name>JBoss Repository</name> <url>http://repository.jboss.org/maven2</url> </repository> </repositories> <dependencies> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>3.1.0.GA</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> <version>3.4.0.GA</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>3.4.0.GA</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-search</artifactId> <version>3.1.1.GA</version> </dependency> <dependency> <groupId>org.jboss.seam</groupId> <artifactId>jboss-seam</artifactId> <version>2.2.0.GA</version> </dependency> </dependencies> </project>