How can I create a war file of my project in NetBeans?

后端 未结 10 2088
深忆病人
深忆病人 2020-12-04 17:39

How can I create a war file of my project in NetBeans?

相关标签:
10条回答
  • 2020-12-04 18:13

    Netbeans will create the Ant script for you, it uses Ant to build anyway. But if you want to get the war file, just build your project. The .war file will be located in /yournetbeanshomedirectory/yourproject/dist/yourwar.war

    You can check out the ant build script it uses by looking at the build.xml file in your project directory. Might help you feel a little more comfortable using ant to do builds.

    0 讨论(0)
  • 2020-12-04 18:15

    Just check in you projects properties >build ->packaging WAR file compress.

    0 讨论(0)
  • 2020-12-04 18:17

    This worked for me:

    1.Right click pom.xml
    2.Run Maven > Goals
    3.Edit maven goals





    Results: war build in /target folder

       Packaging webapp
        Assembling webapp [WeatherDashboard] in [C:\Users\julian.mojico\Documents\NetBeansProjects\WeatherDashboard\target\WeatherDashboard-1.0-SNAPSHOT]
        Processing war project
        Webapp assembled in [672 msecs]
        Building war: C:\Users\julian.mojico\Documents\NetBeansProjects\WeatherDashboard\target\WeatherDashboard-1.0-SNAPSHOT.war
        ------------------------------------------------------------------------
        BUILD SUCCESS
        ------------------------------------------------------------------------
        Total time: 1:41.633s
        Finished at: Tue Sep 05 09:41:27 ART 2017
        Final Memory: 18M/97M
        ------------------------------------------------------------------------
    
    0 讨论(0)
  • 2020-12-04 18:19

    It's possible that you already have a war file and don't know it - netbeans does most of the work for you and I believe it creates a distributable war file by default. If you created a web project and successfully built it, it will be in the "dist" directory off your project root.

    0 讨论(0)
  • 2020-12-04 18:22

    It is in the dist folder inside of the project, but only if "Compress WAR File" in the project settings dialog ( build / packaging) ist checked. Before I checked this checkbox there was no dist folder.

    0 讨论(0)
  • 2020-12-04 18:28

    As DPA says, the easiest way to generate a war file of your project is through the IDE. Open the Files tab from your left hand panel, right click on the build.xml file and tell it what type of ant target you want to run.

    NetBeans - Create a WAR file

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