This sample is currently MIT licenced, see the included LICENSE file. The client project is a modified version of w11k/fabs-boilerplate authored by Philipp Burgmer.
This sample project demonstrates the integration of JAVA and AngularJS projects with gradle und fabs. It contains the 4 sub projects:
-
common: The models and interfaces describing the callable service.
-
service: the implementation of the interface.
-
client: a singe page application derived from fabs-boilderplate.
-
server: an integration project that includes the other projects.
Note: The service and the client projects are web-fragment enabled web applications.
The following software needs to be installed on your system
- Oracle JDK 1.8: It should work without installing any other software, but not tested.
Because gradle installs it's own versions of the following it could be installed if needed:
- nodejs (tested using version 0.12.2)
- grunt installed via NPM globally (npm -g install grunt)
- gradle installed by your favourite package manager (tested with 2.3) .
Use ./gradlew :client:dev
or cd client && grunt dev
to start a node server on port 9000 for development. The directory
client/src/main/webap is being watched for changes. If a change is detected, the web page is reloaded automatically.
Fabs is configured to use the servlet container on port 8080 for service calls, so you might want to start the Jetty container.
Use ./gradlew :server:jettyRun
to start a servlet container. It contains the service and the minified version of
the client. It starts the Jetty on port 8080.
- Simple echo Service: curl -X GET localhost:8080/server/service/product/echo?text=hello
- Product list: curl -X GET localhost:8080/server/service/product/list
- The mock and e2e tests of client project has not been tested, but it should work out of the box.
- It is not possible to use the gradle jetty plugin, because web-fragments is not available with this plugin. The gretty plugin is used instead.
- The incremental build feature of the gradle-grunt plugin is not used.
- :client:clean is not implemented the right way, because it should delete node_modules.