Angular 4 + springboot + Maven + Eclipse – Have to build everytime
Angular 4 + springboot + Maven + Eclipse – Have to build everytime
have you tried with below command
ng serve --proxy-config proxy-conf.json -o
Do remember that you need to have proxy-conf.json in your project. It should be in the same directory where package.json is. Then run localhost:4200
{
/api: {
target: http://localhost:8080,
secure: false
}
}
Maybe consider running Angular 4 project separately, outside of Spring project. And when you want to deploy/release then you just put Angular files to Spring project.
My setup for example:
Angular 4 running on :4200 locally.
Spring running on :8080 locally.
When I need to deploy a new version, I just put compressed angular files to Spring project folder and create War file with Maven.
Angular 4 + springboot + Maven + Eclipse – Have to build everytime
For development you can use ng serve
in your angular app directory and start the backend seperatly. ng serve
will automatically detect changes in your Angular files, rebuild and serve the new content.
For the complete deployment in the end you can use maven and build everything to one war
. In your pom you can define also a plugin for ng build
and a plugin to copy the dist directory of you Angular app to the correct location. The dist directory contains your build Android application (js files etc.).