2

I want to build a project which has Java Spring as the backend and ng2 as the frontend. After building the project I want to have a war file to deploy. I placed "angular-quickstart" into webapp/resource and then installed package.json by npm. Eclispe always leaks memory because of too many files.

Can you show me how to get over it? Do I need config something, or is it OK with this folder structure?

2 Answers 2

1

As @tan9 suggests, Develop front-end and back-end separately. For back-end you can have eclipse, tomcat, Spring rest. For front-end, create new project using angular-cli (https://github.com/angular/angular-cli), in folder OUTSIDE eclipse workspace.

After development use ng build --prod to create an optimized set of html-js files in dist directory in angular project.

Depends on your requirement you can copy all these to your eclipse Project/WebContent folder; if this is the case, use <base href="."> in index.html.

Sign up to request clarification or add additional context in comments.

Comments

0

You should only packaged the compiled resources into your WAR archive. Try https://github.com/angular/angular-cli , and only package the dist folder created by running ng build.

Or you should try to separate frontend and backend into two Maven modules, package frontend as a jar, and place all built resources into jar/META-INF/resources. And the set the frontend jar module as a dependency of the backend war module.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.