Mavenising seam projects [ part 2 ].

This part will continue the discussion started in part 1 [1].

We now come to the model and action modules which are of type ejb. Particularly in this example (Open18) they are just seam components i.e. pojos  annotated with @Name, but they could also have been ejbs.

Bellow is the pom.xml for model module. It contains all the entities (JPA)  and some helper classes. It shows jboss-seam as provided dependency which will be provided by the ear module which packages the artifact which will be deployed. This modules takes all the hibernate dependencies from the parent project.

<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">
  <parent>
    <groupId>com.hardik.seaminaction</groupId>
    <artifactId>Open18</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.hardik.seaminaction</groupId>
  <artifactId>model</artifactId>
  <packaging>ejb</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>model</name>
  <url>http://maven.apache.org</url>
  <dependencies>
      <dependency>
            <groupId>org.jboss.seam</groupId>
            <artifactId>jboss-seam</artifactId>
            <version>2.2.0.GA</version>
            <type>ejb</type>
            <scope>provided</scope>
        </dependency>
  </dependencies>
  <build>
  	<plugins>
  		<plugin>
  			<groupId>org.apache.maven.plugins</groupId>
  			<artifactId>maven-ejb-plugin</artifactId>
  			<configuration>
  				<ejbVersion>3.0</ejbVersion>
  			</configuration>
  		</plugin>
  	</plugins>
  </build>
</project>

Here the action module which is also of type ejb. It contains all the action classes which are in turn pojos annotated with @Name. The JSF dependency which we see is for the JSF message classes.

<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">
  <parent>
    <groupId>com.hardik.seaminaction</groupId>
    <artifactId>Open18</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.hardik.seaminaction</groupId>
  <artifactId>action</artifactId>
  <packaging>ejb</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>action</name>
  <url>http://maven.apache.org</url>
  <dependencies>
      <dependency>
          <groupId>com.hardik.seaminaction</groupId>
          <artifactId>model</artifactId>
          <version>1.0-SNAPSHOT</version>
      </dependency>

      <dependency>
            <groupId>org.jboss.seam</groupId>
            <artifactId>jboss-seam</artifactId>
            <version>2.2.0.GA</version>
            <type>ejb</type>
            <scope>provided</scope>
        </dependency>
      <dependency>
            <groupId>javax.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>1.2_02</version>
            <scope>provided</scope>
        </dependency>

  </dependencies>
  <build>
  	<plugins>
  		<plugin>
  			<groupId>org.apache.maven.plugins</groupId>
  			<artifactId>maven-ejb-plugin</artifactId>
  			<configuration>
  				<ejbVersion>3.0</ejbVersion>
  			</configuration>
  		</plugin>
  	</plugins>
  </build>
</project>

Links:

  1. Mavenising seam projects [ part 1 ].
About these ads