Run app in tomcat using maven with IntelliJ

前端 未结 3 1454
情歌与酒
情歌与酒 2021-02-07 11:52

Without using maven, to run the app on tomcat from the Intellij IDE, all you have to do is create an artifact and a \"tomcat\" run configuration pointing to that artifact, this

相关标签:
3条回答
  • 2021-02-07 12:24

    If you have set

    <packaging>war</packaging>
    

    in your pom, IDEA should automatically identify the artifact (your WAR file) to deploy. No need to manually create an artifact.

    0 讨论(0)
  • 2021-02-07 12:27

    In pom.xml add

    <build>
                <plugin>
                    <groupId>org.apache.tomcat.maven</groupId>
                    <artifactId>tomcat7-maven-plugin</artifactId>
                    <version>2.2</version>
                    <configuration>
                        <uriEncoding>UTF-8</uriEncoding>
                        <path>/your-path</path>
                        <update>true</update>
                    </configuration>
                </plugin>
    </build>
    

    In IntelliJ, open Menu > View > Tool Windows > Maven Projects

    Plugins > tomcat7 > tomcat7:run
    
    0 讨论(0)
  • 2021-02-07 12:40

    When you setup this: n IntelliJ, open Menu > View > Tool Windows > Maven Projects, you will see this menu:

    enter image description here

    When you click on this picture you can enter the goal of Maven, for example tomcat7:run

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