@@ -42,6 +42,7 @@ Then open [http://localhost:4200/](http://localhost:4200/)
42
42
* Commands above are explained [ here] ( #generate-it-and-run-it )
43
43
* [ Delete all generated files] ( #delete-all-generated-files )
44
44
* [ How-to use your own database] ( #how-to-use-your-own-database )
45
+ * [ How-to package front/back in a single jar and run it] ( #how-package )
45
46
46
47
## Generate it and run it
47
48
@@ -157,3 +158,32 @@ Follow the steps 2-3 from the [Generate it and run it](#generate-it-and-run-it)
157
158
158
159
[ pom.xml ] : https://github.com/jaxio/celerio-angular-quickstart/blob/master/quickstart/pom.xml
159
160
[ entity.service.ts.e.vm ] : https://github.com/jaxio/celerio-angular-quickstart/blob/master/pack-angular/celerio/pack-angular/web/src/app/entities/entity.service.ts.e.vm
161
+
162
+ ## How-to package front/back in a single jar and run it
163
+
164
+ Let's go one step further. Wouldn't it be convenient for production to only have a single jar to run ?
165
+
166
+ To create a single jar (Java archive), in addition to the steps above we need to compile the front end code (typescript etc.)
167
+ using Angular Cli and to copy the compilation result (dist folder) in our springboot backend (in a special folder
168
+ for static content) so it can be packaged into a jar file along with the backend.
169
+
170
+ Here are the command lines (hope it is self explanatory):
171
+
172
+ git clone https://github.com/jaxio/celerio-angular-quickstart.git
173
+ cd celerio-angular-quickstart/quickstart
174
+ ng new web
175
+ rm web/src/main.ts web/src/app/app.module.ts web/src/app/app.component.* web/src/styles.css
176
+ mvn -Pdb,metadata,gen generate-sources
177
+ cd web
178
+ npm install --save @angular/animations
179
+ npm install --save @angular/material@2.0.0-beta.3
180
+ npm install --save primeng@4.0.0
181
+ npm install --save font-awesome
182
+ ng build --prod
183
+ cp dist/* ../src/main/resources/static
184
+ cd ..
185
+ mvn package
186
+ java -jar target/celerio-angular-quickstart-1.0.0-SNAPSHOT.jar
187
+
188
+ Access it at http://localhost:8080/
189
+
0 commit comments