My Experience with JHipster
When I saw this informative post about JHipster I couldn’t wait to try it out. Features like security, persistence, responsive UI, efficient monitoring, ability to change log level at runtime and much more – all granted for free, no effort whatsoever. Amazing stuff, and it worked… almost. I ended up spending a day trying to brew my perfect app. Well, let me tell you there have been a lot of waiting time and errors. Even though I am not sure if I am ready to use the tool for real I wanted to share my experience. Never mind the time and effort, some of the problems were, as usual, my own fault and made me fix my environment.
First of all, I recommend resolving npm permissions, so that you can avoid using sudo when installing npm modules. Check this video, there are several options mentioned in it. Here is what worked for me:
$ whoami tom $ sudo chown -R tom /usr/local/lib/node_modules $ sudo chown -R tom /usr/local/bin $ sudo chown -R tom /usr/local/share $ npm config set prefix /Users/tom/npm-global
$ npm --prefix="" set prefix ""
$ export PATH="/Users/tom/npm-global/bin:${PATH}"
$ sudo chown -R tom ~/.npm
Next, install everything as per the JHipster tutorial. Here is what I have:
#1 Java
$ java -version java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
$ mvn -version Apache Maven 3.2.5
$ git --version git version 1.9.3 (Apple Git-50)
$ node -v v0.12.2 $ npm -v 2.7.4
$ yo --version 1.4.6
$ bower --version 1.4.1
$ grunt --version grunt-cli v0.1.13
$ npm list -g --depth=0 | grep jhipster ├── generator-jhipster@2.7.0
$ mkdir myapp && cd $_ && yo jhipster
Now just wait until the generator completes. Beware it may take quite some time. Pay attention to errors and resolve them individually. An awful lot of files is being downloaded and you need a solid network connection. Even then though, some of the dependencies can (and will!) fail to download.
Hopefully, at some point, you get to see a successful build.
In your project directory run grunt and then start the app by running mvn spring-boot:run
Now comes the confusing part.
Initially, the app loaded as expected. Seeing the fully functioning UI is a very rewarding experience and I find the features impressive.
On the other hand, it all feels rather fragile. For instance, the app was successfully started the very first time. Upon subsequent restarts, and I swear I hadn’t changed a single line of code (!), I started to see errors. Typically, AngularJS wouldn’t load or there were failing modules etc. I tried rebuilding the project, but that didn’t help. All in all, the UI breaks very easily and it’s not too obvious what exactly went wrong.