使用了这个插件就不需要配置tomcat了,直接用maven去run就行

配置方法:pom里添加:(之所以用tomcat7是因为如果直接用依赖下载很难下载到tomcat8-maven-plugin,详情看Maven使用tomcat8-maven-plugin插件

<build>
    <finalName>processdata</finalName>
      <plugins>
          <!-- 配置Tomcat插件 -->
          <plugin>
              <groupId>org.apache.tomcat.maven</groupId>
              <artifactId>tomcat7-maven-plugin</artifactId>
              <configuration>
                  <!-- 端口号,默认8080,如果用80就不需要在localhost后面写端口号了 -->
                  <port>80</port>
                  <path>/processdata</path>
              <!-- 这样写run以后的url是http://localhost/processdata -->
              </configuration>
          </plugin>
      </plugins>
  </build>

 

然后点击上方Run —— Edit Configuration

IDEA 使用tomcat7-maven-plugin

 

配置界面:(如果没有Maven,点击左上角+,选择maven)

IDEA 使用tomcat7-maven-plugin

最后点击运行

IDEA 使用tomcat7-maven-plugin

相关文章:

  • 2022-01-09
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-30
  • 2022-01-11
相关资源
相似解决方案