Setup environment to run jhipster stack in Win 7

  1. Install NodeJS, for example, D:\nodeJS
  2. Add D:\nodeJS\bin to PATH variable
  3. Create npm folder in C:\Users\<user name>\AppData\Roaming\
  4. Add C:\Users\<user name>\AppData\Roaming\npm to PATH variable
  5. Go to http://git-scm.com/download/win to download git execute and install Git
  6. Install yeoman, grunt, grunt-cli, bower and jhipster generator
    1. npm install -g yo
    2. npm install -g grunt
    3. npm install -g grunt-cli
    4. npm install -g bower
    5. npm install -g generator-jhipster
  7. Install at least Maven 3.2.x in machine. http://maven.apache.org/download.cgi and download the latest version of Maven
  8. Use yeoman to scaffold jhipster project
    1. Create a main folder, for example, d:\project
    2. cd project and run yo jhipster
    3. Answer questions and wait for the boilerplate codes to be ready.
  9. Since my workplace uses Java 6, java.version has to be updated in pom.xml
    1. Open pom.xml and update the value of <java.version> from 1.7 to 1.6
    2. Add <tomcat.version>7.0.56</tomcat.version> so spring-starter-tomcat uses tomcat 7 instead of tomcat 8.
  10. Open GruntFile.js and change ip address from 0.0.0.0 to 127.0.0.1; otherwise, home page cannot show in grunt server
  11. Deploy project to grunt server
    1. Open command prompt
    2. Type cd d:\project\<app name> to change directory
    3. Type grunt server in command line
    4. If grunt task runs successfully, home page is loaded into browser and Url should be http://localhost:9000
  12. Deploy Spring Boot application
    1. Open another command prompt
    2. cd d:\project\<app name>
    3. Type mvn spring-boot:run to run application
    4. Type http://localhost:8080 and the same home page is served by tomcat 7

References:

  1. http://jhipster.github.io/installation.html
  2. http://jhipster.github.io/installation.html
  3. http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#howto-use-tomcat-7