I am new to angular2, I want to know what is the possible file structure for SpringMVC4 with angular 2?
As shown in image, it will work for Angular 1.x but
You can automate your solution - just use frontend-maven-plugin (with which you can install nodejs and build the angular project) and maven-resources-plugin to copy the contents of /angular/dist/ directory into root of .war file (see also this article)
org.apache.maven.plugins
maven-resources-plugin
3.0.2
default-copy-resources
process-resources
copy-resources
true
${project.build.directory}/${project.artifactId}-${project.version}/
${project.basedir}/angular/dist
And then you can use hot reload feature (while developing) on nodejs server, runned by ng serve
with Angular CLI tool.