JHipster - Maven and Yarn Execution

2019-08-16 23:29发布

问题:

As per the JHipster documentation, I am supposed to be able to access the application by default at localhost:8080 but the page comes out to be blank. I installed yarn 0.27.5 and issues the command yarn start to start the UI. Now I am able to access the application at localhost:9000. I have to run the mvnw and yarn commands at the same time for the application to be available for use, but it should be just the maven command. Can someone please explain the reason and how do I do this from Eclipse.

回答1:

You must run both yarn and maven in dev because yarn takes care of building your angular app while hot reloading your changes, maven takes care of building your spring boot app (including generating some code using annotation processors) and spring devtools takes care of hot reloading your java code changes.

I don't use Eclipse but I suppose that running yarn is just a matter of launching from the integrated terminal. Anyway this is not a problem because you have to do it only once thanks to hot reloading. More information about Eclipse here: http://www.jhipster.tech/configuring-ide-eclipse/