Generate .war file from web app containing just HTML, CSS & JavaScript

前端 未结 2 1159
清酒与你
清酒与你 2021-02-14 12:22

I am trying to create a war file that will be deployed on a web/application server.

The source files of the app are purely HTML, CSS, and JavaScript. There is a separat

2条回答
  •  一整个雨季
    2021-02-14 12:53

    This is extremely simple:

    1. Create a folder
    2. Add a src/main/webapp folder
    3. Add all of your HTML, CSS and JS files to the src/main/webapp folder
    4. Add an empty web.xml file to the src/main/webapp/WEB-INF directory.
    5. add a maven pom.xml
    6. add the maven-war-plugin to your pom.xml, with the following configuration:

      
      
        maven-war-plugin
        
          src/main/webapp/WEB-INF/web.xml
        
      
      
    7. run mvn clean install!

提交回复
热议问题