简体   繁体   中英

Deploy war file on apache tomcat upon creation

I'm not well experienced in java.

I build a UI using JSP for my servlets to get input data from users. Everytime I want to see the UI and how the Servlets are performing I have to do all thses steps over and over again,

  1. create the war file by mvn clean install
  2. Copy war file to Webapps folder
  3. restart apache tomcat
  4. View the result using the url

I want to know if there is a command that i can use to rerun apache tomcat with the war file im building at once, So that i only have to refresh the webpage to see the result. Or any method that is easier than above.

I use Intellij Idea.

Thanks in advance.

IntelliJ IDEA Community Edition does not support J2EE , but you can also achieve this in the following two ways. For full support of tomcat, you can buy IntelliJ IDEA Enterpries Edition .

Use maven-compiler-plugin
1) Add this plugin to your pom.xml :

<build>
    <finalName>mvn-webapp</finalName>
      <plugins>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>3.5.1</version>
          </plugin>
      </plugins>
  </build>

2) Then run this command:

mvn tomcat:run

Or Install Tomcat Runner Plugin

Refer to this link for usage of this plugin.

May be this will help you to deploy the war file on server 可能这将帮助您在服务器上部署war文件

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM