-
Notifications
You must be signed in to change notification settings - Fork 32
Maven build
Angular2Guy edited this page Nov 20, 2016
·
11 revisions
The maven build is done according to the archetype of JBoss for ear packages.
In the ear project the war and ejb dependencies bundled by the maven ear plugin into an ear package for deployment.
In the ejb project the sources and resources are build and bundled in a ejb jar.
In the war project are several steps performed.
- The directories dist/ and node_modules are cleaned
- The directory src/main/angular2 is copied to target (without dependencies only a few kb)
- In target/angular2/carrental/ npm install is called to resolve the dependencies
- In target/angular2/carrental/ ng build --prod --base-href "/carrental-web/" is called to build an optimized bundle. (--base-href is needed to set baseref)
- The war plugin includes the directories for the Angular Cli bundle and the translations and builds the war.
The command ng build --prod --base-ref "carrental-web" builds a tree shaken/uglified bundle with the right bref for routing to work. Angular Cli will offer the --aot option for further optimization and splitting of the bundle according to routes.