官术网_书友最值得收藏!

  • Spring MVC Blueprints
  • Sherwin John Calleja Tragura
  • 138字
  • 2021-07-14 10:48:23

The pom.xml file

The basic fundamental unit of work in Maven is the pom.xml file. This XML file is the main part of the Maven project folder structure, and is always located in the base directory of the project. The file contains all the necessary archetype plugins and dependencies for project building and deployment.

The PWP has this pom.xml file that builds sources, creates project WAR files, and deploys the projects with web.xml to the Tomcat server.

<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>org.packt.spring.codes</groupId> 
  <artifactId>ChapterOne</artifactId> 
  <version>0.0.1-SNAPSHOT</version> 
  <packaging>war</packaging> 
  <name>ChapterOne</name> 
  <description>Personal Web Portal</description> 
 
  <!-- properties --> 
  <properties> 
    <spring.version>4.1.2.RELEASE</spring.version> 
    <servlet.api.version>3.1.0</servlet.api.version> 
  </properties> 
  <!-- dependencies --> 
 
  <dependencies> 
    <dependency> 
    <groupId>javax.mail</groupId> 
    <artifactId>mail</artifactId> 
    <version>1.4.3</version> 
  </dependency> 
 
  <dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-core</artifactId> 
    <version>${spring.version}</version> 
  </dependency> 
 
  <dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-beans</artifactId> 
    <version>${spring.version}</version> 
  </dependency> 
 
  <!-- Rest of the dependencies in sources --> 
  </dependencies> 
 
  <build> 
    <finalName>spring-mvc-maven-webapp-from-scratch</finalName> 
      <plugins> 
        <!-- Apache Tomcat 7 Maven Plugin --> 
        <-- 
        <plugin> 
          <groupId>org.apache.tomcat.maven</groupId> 
          <artifactId>tomcat7-maven-plugin</artifactId> 
          <version>2.2</version> 
          <configuration> 
 
            <url>http://localhost:8080/manager/text</url> 
            <path>/ch01</path> 
            <username>admin</username> 
            <password>admin</password> 
          </configuration> 
        </plugin> 
        --> 
        <plugin> 
          <groupId>org.apache.maven.plugins</groupId> 
          <artifactId>maven-compiler-plugin</artifactId> 
          <version>3.1</version> 
          <configuration> 
            <source>1.7</source> 
            <target>1.7</target> 
          </configuration> 
        </plugin> 
        <!-- Mojo Maven Plugin --> 
          <plugin> 
            <groupId>org.codehaus.mojo</groupId> 
            <artifactId>tomcat-maven-plugin</artifactId> 
            <version>1.1</version> 
            <configuration> 
              <url>http://localhost:8080/manager/text</url> 
              <server>TomcatServer</server> 
              <path>/ch01</path> 
            </configuration> 
          </plugin> 
        </plugins> 
    </build> 
  </project> 

After setting the development and deployment environment, it is time to start configuring out the Spring MVC component of PWP.

主站蜘蛛池模板: 峨山| 阜阳市| 特克斯县| 疏附县| 三河市| 鄂伦春自治旗| 盐源县| 清远市| 合川市| 应城市| 南京市| 呼和浩特市| 乌兰浩特市| 德清县| 嘉黎县| 南康市| 吴堡县| 壶关县| 苏尼特左旗| 红河县| 鹤岗市| 沈丘县| 措美县| 五台县| 宁化县| 仪征市| 襄樊市| 北流市| 安西县| 米泉市| 高陵县| 英吉沙县| 舟山市| 陇川县| 曲麻莱县| 正镶白旗| 沧州市| 专栏| 延长县| 安阳县| 德州市|