美文网首页
maven tomcat:run 无法启动

maven tomcat:run 无法启动

作者: IT宝哥哥 | 来源:发表于2019-10-12 14:27 被阅读0次

    解决方法:
    pom.xml中添加一下内容,运行:mvn tomcat7:run,原理未知。

    <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.1</version>
            <configuration>
              <!--<url>http://localhost:8080/manager/text</url>
              <server>my-tomcat</server>
              <path>/myapp</path>-->
              <port>8081</port>
              <uriEncoding>UTF-8</uriEncoding><!-- 参数乱码 -->
            </configuration>
          </plugin>
    

    常用的依赖,以免忘记

    <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
        <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>javax.servlet-api</artifactId>
          <version>3.1.0</version>
          <scope>provided</scope>
        </dependency>
    
        <!-- https://mvnrepository.com/artifact/javax.servlet.jsp/javax.servlet.jsp-api -->
        <dependency>
          <groupId>javax.servlet.jsp</groupId>
          <artifactId>javax.servlet.jsp-api</artifactId>
          <version>2.3.0</version>
          <scope>provided</scope>
        </dependency>
    

    相关文章

      网友评论

          本文标题:maven tomcat:run 无法启动

          本文链接:https://www.haomeiwen.com/subject/nqpqmctx.html