Source

spring-webmvc-skeleton / pom.xml

<?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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.example.project</groupId>
	<artifactId>project</artifactId>
	<packaging>war</packaging>
	<version>0.1</version>

	<!--
	Define the basic build profiles.
	For example, `mvn clean package -P debug` would build the
	debug profile as defined below.
	-->
	<profiles>
		<profile>
			<id>debug</id>
			<properties>
				<war.name>${project.artifactId}-debug</war.name>
				<profile.name>debug</profile.name>
			</properties>
		</profile>
		<profile>
			<id>production</id>
			<properties>
				<war.name>${project.artifactId}</war.name>
				<profile.name>production</profile.name>
			</properties>
		</profile>
	</profiles>

	<build>
		<!--
		Configure our list of build plugins. See
		http://maven.apache.org/plugins/index.html for a list
		of available plugins.
		-->
		<plugins>
			<plugin>
				<!--
				The WAR plugin is how we package our project for
				distribution/deployment.
				-->
				<artifactId>maven-war-plugin</artifactId>
				<version>2.1.1</version>
				<configuration>
					<!--
					${war.name} is defined by the selected build profile.
					-->
					<warName>${war.name}</warName>


					<webResources>
						<!--
						This resource includes tokens (e.g. ${some.token}) that need
						to be parsed and replaced via filtering.
						-->
						<resource>
							<directory>${basedir}/src/main/webapp</directory>
							<targetPath>WEB-INF</targetPath>
							<filtering>true</filtering>
							<includes>
								<include>**/web.xml</include>
							</includes>
						</resource>

						<!--
						Include build profile specific properties.
						-->
						<resource>
							<directory>${basedir}/src/main/resources/${profile.name}</directory>
							<targetPath>WEB-INF</targetPath>
							<includes>
								<include>*.properties</include>
							</includes>
						</resource>
					</webResources>
				</configuration>
			</plugin>
		</plugins>

		<!--
		Here, we define the filters that we will apply to resources
		within our project. These files will not be included in
		the final .war.
		-->
		<filters>
			<filter>src/main/resources/${project.artifactId}.properties</filter>
		</filters>
	</build>

	<!--
	Define custom properties that can be referenced within this pom.xml.
	-->
	<properties>
		<!--
		This is a special property that sets the default encoding for
		all text files that are processed by plugins.
		-->
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

		<log4j.version>1.2.16</log4j.version>
		<spring.version>3.0.5.RELEASE</spring.version>
	</properties>

	<!--
	List the packages on which this project depends. These will be
	automatically downloaded by Maven.
	-->
	<dependencies>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>${log4j.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
			<version>${spring.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<version>${spring.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${spring.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<version>${spring.version}</version>
		</dependency>
	</dependencies>

	<!--
	The list of repositories that Maven will search for the
	defined dependencies.
	-->
	<repositories>
		<repository>
			<id>org.maven</id>
			<name>Main Maven Repository</name>
			<url>http://repo1.maven.org/maven2</url>
		</repository>
	</repositories>
</project>