How to deploy WAR with Maven to Tomcat?

后端 未结 1 343
伪装坚强ぢ
伪装坚强ぢ 2020-12-29 05:49

I use the Maven with Eclipse. Is possible build the project and then deploy built WAR file to Tomcat server?

I use Windows. I can build WAR file, and al

相关标签:
1条回答
  • 2020-12-29 06:14

    Meanwhile I resolved it. There were a few issues.

    Firstly I set Goal in the Eclipse run configuration to tomcat:deploy.

    And I changed pom.xml following

    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>tomcat-maven-plugin</artifactId>
      <configuration>
        <url>http://localhost:8080/manager/text</url>
        <server>Apache_Tomcat_7_x86</server>
        <path>/HelloWorld</path>
      </configuration>
    </plugin>
    

    URL in configuration depends on Tomcat version. For me works text, for others works html on end of URL. And of course, in tomcat-users.xml must be set role manager-script or manager-gui.

    Maybe it helps to others.

    0 讨论(0)
提交回复
热议问题