Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create war file of angular project?

I am working on project where I used angular as frontend and spring boot as backend. I want to deploy my project on Sentora control panel. It requires only war files to deploy on server. I created war file of spring project but I dont know how to create war file of angular project. I used vs code for angular. I tried to find the way of creating war file for angular on internet but didn't find any solution. Should I need to import angular project in eclipse? Please someone tell me step by step solution to create war file of angular project.

Update: Error while deploying wabit.war file

enter image description here

I deployed simple spring boot project demo-0.0.1-SNAPSHOT and it started.

wabit.war file is deployed but it doesn't start. It gives error

FAIL - Application at context path [/wabit] could not be started

Why is this happening?

like image 776
bunT Avatar asked Oct 17 '25 14:10

bunT


1 Answers

Another solution is instead of creating a war file for your angular project just embed it in the spring boot war.

To do that

  1. Just create your angular dist by ng build command.
  2. Copy the contents of everything in that folder.
  3. Go to your Spring Boot project and paste them inside a static package in the resources directory. The path should be src/main/resources/static
  4. Create and deploy the Spring boot war file and your angular will run as well.

This is how you directory of spring boot should look like

enter image description here

like image 66
Anas Avatar answered Oct 20 '25 11:10

Anas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!