FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Architecture & Design
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
April 21, 2006

Maven: Building Complex Systems

(Page 8 of 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>
  <parent>
  	<groupId>GigiZone</groupId>
	<artifactId>Sudoku</artifactId>
	<version>1.0-SNAPSHOT</version>
  </parent>
    
  <artifactId>SudokuSolver</artifactId>
  
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

Listing One: pom.xml for SudokuSolver

<!-- 3rd party dependencies available from the public repository -->	  
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.0.4</version>
      <scope>provided</scope>
    </dependency>
    
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.9</version>
      <scope>compile</scope>
    </dependency>
    
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
      <version>1.2.6</version>
      <scope>compile</scope>
    </dependency>
    
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>1.2.6</version>
      <scope>compile</scope>
    </dependency>

<!-- SUN dependencies that must be cannot be distributed from public respositories and should not be deployed to the web container (hence the scope is 'provided') --> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.4</version> <scope>provided</scope> </dependency>

<dependency> <groupId>javax.servlet</groupId> <artifactId>jsp-api</artifactId> <version>2.0</version> <scope>provided</scope> </dependency>

<dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.1.2</version> <scope>compile</scope> </dependency>

<!-- Test only depdendency (should not be deployed, hence the scope is 'test') --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> </project>

Listing Two: pom.xml for SudokuServer.

<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>GigiZone</groupId>
  <artifactId>Sudoku</artifactId>
  <version>1.0-SNAPSHOT</version>
  <name>Sudoku Parent POM</name>
  <url>http://localhost:8080/SudokuServer-1.0-SNAPSHOT/sudoku.html</url>
  <packaging>pom</packaging>  
  <modules>
  	<module>SudokuSolver</module>
  	<module>SudokuServer</module>
  </modules>
  <developers>
    <developer>
      <name>Gigi Sayfan</name>
      <email>gsayfan@playstation.sony.com</email>
      <roles>
        <role>Lead Developer</role>
      </roles>
      <timezone>0</timezone>
    </developer>
  </developers>  
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
           <source>1.5</source>
           <target>1.5</target>
        </configuration>
     </plugin>
    </plugins>  
  </build>  
  <repositories>
    <repository>
      <id>Maven Snapshots</id>
      <url>http://snapshots.maven.codehaus.org/maven2/</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>Maven Snapshots</id>
      <url>http://snapshots.maven.codehaus.org/maven2/</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </pluginRepository>
  </pluginRepositories>  
  
</project>

Listing Three: Top-level POM file.

Previous Page | 1 Introducing Maven | 2 What Is Maven? | 3 The Project Object Model | 4 Maven At Work | 5 Multi-module Builds | 6 Configuring Plugins | 7 SudokuServer: A Sample Web Application | 8 Complete Source Code
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK