0

I have a question, I want to use angular 2 in maven project, and as you now the modules should download with ( npm install or ng new .. (cli) ).

The problem is if I generate the war file with all this modules, it will be very large because of the presence of all the nodejs modules.

In one of Github example they install this modules with ( npm install ) and finally goes to the home directory and run spring-boot:run I want directly deploy my war file, so my question is : i should generate the war file with the all the modules and dependencies of nodejs or there is another solution ?

1 Answers1

1

Three ways:

  1. add all node_modules dependencies in to your version control, so source is always there, or copy necessary js libraries manually in specific source folder, like angular.min.js and so on (if your node.js is not available on your server, by security reason)

  2. create execution goal inside pom.xml, something like How to deploy a node.js app with maven?

  3. use https://github.com/eirslett/frontend-maven-plugin and check existing examples, I am sure your case is straight forward

Community
  • 1
  • 1
Dmitri Algazin
  • 3,332
  • 27
  • 30