zoukankan      html  css  js  c++  java
  • maven插件集成tomcat

    创建maven web工程

    在pom.xml中导入依赖:

     <dependencies>
        <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
          <version>2.5</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>javax.servlet-api</artifactId>
          <version>4.0.1</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>javax.servlet.jsp</groupId>
          <artifactId>jsp-api</artifactId>
          <version>2.0</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>4.12</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    
    <build>
        <plugins>
          <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
              <port>8888</port>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <target>1.8</target>
              <source>1.8</source>
              <encoding>UTF-8</encoding>
            </configuration>
          </plugin>
        </plugins>
      </build>

    点击tomcat7:run 启动服务器

  • 相关阅读:
    oc复习
    oc复习(琐碎)
    nodejs中express框架
    mac 下subline text 3最新版本激活码
    mac eclipse 修改SDK路径
    MAC下 ant 环境搭建
    nodejs npm命令行总结
    ios开发之短信验证
    ios开发之调用相机和本地相册
    ios8新特性之毛玻璃效果
  • 原文地址:https://www.cnblogs.com/M87-A/p/14863714.html
Copyright © 2011-2022 走看看