maven pom.xml e.g.

周瀚
2023-12-01

<?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.0http://maven.apache.org/maven-v4_0_0.xsd">

            <modelVersion>4.0.0</modelVersion>

            <groupId>org.springframework.samples</groupId>

            <artifactId>mvc-basic</artifactId>

            <name>mvc-basic</name>

            <packaging>war</packaging>

            <version>1.0.0-SNAPSHOT</version>

 

            <properties>

                        <org.springframework.version>3.1.1.RELEASE</org.springframework.version>

                        <javax.validation.version>1.1.0.Alpha1</javax.validation.version>

                        <org.hibernate.hibernate-validator.version>4.3.0.Final</org.hibernate.hibernate-validator.version>

                        <javax.servlet.version>3.0-alpha-1</javax.servlet.version>

                        <javax.servlet.jsp.version>2.2.1-b03</javax.servlet.jsp.version>

                        <javax.servlet.jstl.version>1.2</javax.servlet.jstl.version>

                        <joda-time.version>2.1</joda-time.version>

                        <joda-time-jsptags.version>1.1.1</joda-time-jsptags.version>

                        <org.apache.tomcat.maven.version>2.0-beta-1</org.apache.tomcat.maven.version>

                        <junit.version>4.10</junit.version>

                        <org.slf4j.version>1.6.4</org.slf4j.version>

                        <log4j.version>1.2.16</log4j.version>

            </properties>

            <dependencies>

 

                        <!--Spring -->

                        <dependency>

                                    <groupId>org.springframework</groupId>

                                    <artifactId>spring-core</artifactId>

                                    <version>${org.springframework.version}</version>

                        </dependency>

                        <dependency>

                                    <groupId>org.springframework</groupId>

                                    <artifactId>spring-context</artifactId>

                                    <version>${org.springframework.version}</version>

                                    <exclusions>

                                                <!--Exclude Commons Logging in favor of SLF4j -->

                                                <exclusion>

                                                            <groupId>commons-logging</groupId>

                                                            <artifactId>commons-logging</artifactId>

                                                </exclusion>

                                    </exclusions>

                        </dependency>

                        <dependency>

                                    <groupId>org.springframework</groupId>

                                    <artifactId>spring-beans</artifactId>

                                    <version>${org.springframework.version}</version>

                        </dependency>

                        <dependency>

                                    <groupId>org.springframework</groupId>

                                    <artifactId>spring-webmvc</artifactId>

                                    <version>${org.springframework.version}</version>

                        </dependency>

                        <dependency>

                                    <groupId>org.springframework</groupId>

                                    <artifactId>spring-web</artifactId>

                                    <version>${org.springframework.version}</version>

                        </dependency>

                        <dependency>

                                    <groupId>org.springframework</groupId>

                                    <artifactId>spring-context-support</artifactId>

                                    <version>${org.springframework.version}</version>

                        </dependency>

 

                        <dependency>

                                    <groupId>org.springframework</groupId>

                                    <artifactId>spring-jdbc</artifactId>

                                    <version>${org.springframework.version}</version>

                        </dependency>

 

                        <!--CGLIB (required for processing @Configuration classes -->

                        <dependency>

                                    <groupId>cglib</groupId>

                                    <artifactId>cglib-nodep</artifactId>

                                    <version>2.2.2</version>

                        </dependency>

 

                        <!--Logging -->

                        <dependency>

                                    <groupId>org.slf4j</groupId>

                                    <artifactId>slf4j-api</artifactId>

                                    <version>${org.slf4j.version}</version>

                        </dependency>

                        <dependency>

                                    <groupId>org.slf4j</groupId>

                                    <artifactId>jcl-over-slf4j</artifactId>

                                    <version>${org.slf4j.version}</version>

                                    <scope>runtime</scope>

                        </dependency>

                        <dependency>

                                    <groupId>org.slf4j</groupId>

                                    <artifactId>slf4j-log4j12</artifactId>

                                    <version>${org.slf4j.version}</version>

                                    <scope>runtime</scope>

                        </dependency>

                        <dependency>

                                    <groupId>log4j</groupId>

                                    <artifactId>log4j</artifactId>

                                    <version>${log4j.version}</version>

                                    <scope>runtime</scope>

                        </dependency>

 

                        <!--JSR 303 with Hibernate Validator -->

                        <dependency>

                                    <groupId>javax.validation</groupId>

                                    <artifactId>validation-api</artifactId>

                                    <version>${javax.validation.version}</version>

                        </dependency>

                        <dependency>

                                    <groupId>org.hibernate</groupId>

                                    <artifactId>hibernate-validator</artifactId>

                                    <version>${org.hibernate.hibernate-validator.version}</version>

                        </dependency>

 

                        <!--Joda Time -->

                        <dependency>

                                    <groupId>joda-time</groupId>

                                    <artifactId>joda-time</artifactId>

                                    <version>${joda-time.version}</version>

                                    <scope>runtime</scope>

                        </dependency>

                        <dependency>

                                    <groupId>joda-time</groupId>

                                    <artifactId>joda-time-jsptags</artifactId>

                                    <version>${joda-time-jsptags.version}</version>

                                    <scope>runtime</scope>

                        </dependency>

 

                        <!--Servlet -->

                        <dependency>

                                    <groupId>javax.servlet</groupId>

                                    <artifactId>servlet-api</artifactId>

                                    <version>${javax.servlet.version}</version>

                                    <scope>provided</scope>

                        </dependency>

                        <dependency>

                                    <groupId>javax.servlet.jsp</groupId>

                                    <artifactId>jsp-api</artifactId>

                                    <version>${javax.servlet.jsp.version}</version>

                                    <scope>provided</scope>

                        </dependency>

                        <dependency>

                                    <groupId>javax.servlet</groupId>

                                    <artifactId>jstl</artifactId>

                                    <version>${javax.servlet.jstl.version}</version>

                        </dependency>

 

                        <!--Test -->

                        <dependency>

                                    <groupId>junit</groupId>

                                    <artifactId>junit</artifactId>

                                    <version>${junit.version}</version>

                                    <scope>test</scope>

                        </dependency>

 

            </dependencies>

 

            <repositories>

                        <!--For Hibernate Validator -->

                        <repository>

                                    <id>org.jboss.repository.release</id>

                                    <name>JBossMaven Release Repository</name>

                                    <url>https://repository.jboss.org/nexus/content/repositories/releases</url>

                                    <snapshots>

                                                <enabled>false</enabled>

                                    </snapshots>

                        </repository>

            </repositories>

 

            <build>

                        <plugins>

                                    <plugin>

                                                <groupId>org.apache.maven.plugins</groupId>

                                                <artifactId>maven-compiler-plugin</artifactId>

                                                <configuration>

                                                            <source>1.7</source>

                                                            <target>1.7</target>

                                                            <showWarnings>true</showWarnings>

                                                </configuration>

                                    </plugin>

 

                                    <plugin>

                                                <groupId>org.apache.maven.plugins</groupId>

                                                <artifactId>maven-war-plugin</artifactId>

                                                <configuration>

                                                            <warName>mvc-basic</warName>

                                                </configuration>

                                    </plugin>

 

                                    <plugin>

                                                <groupId>org.apache.maven.plugins</groupId>

                                                <artifactId>maven-dependency-plugin</artifactId>

                                                <executions>

                                                            <execution>

                                                                        <id>install</id>

                                                                        <phase>install</phase>

                                                                        <goals>

                                                                                    <goal>sources</goal>

                                                                        </goals>

                                                            </execution>

                                                </executions>

                                    </plugin>

                        </plugins>

 

                        <pluginManagement>

                                    <plugins>

                                                <!--For Tomcat 7 -->

                                                <plugin>

                                                            <groupId>org.apache.tomcat.maven</groupId>

                                                            <artifactId>tomcat7-maven-plugin</artifactId>

                                                            <version>${org.apache.tomcat.maven.version}</version>

                                                            <configuration>

                                                                        <url>http://localhost:8080/manager/html</url>

                                                                        <server>tomcat</server>

                                                            </configuration>

                                                </plugin>

                                    </plugins>

                        </pluginManagement>

            </build>

 

</project>

 类似资料:

相关阅读

相关文章

相关问答