How to update the JHipster project after updating JHipster generator?
Asked Answered
C

7

17

I updated my JHipster installation as per this page by running the command

npm update -g generator-jhipster

But to update my application I am not sure where should I run the next command yo jhipster.

I tried running it from the root of existing project, but it asked me to enter the name of the new project.

Jhipster console

I tried running it at one level above the root of existing project, then also it asked me the name of the new project. But this time I entered the same name and the jhipster generation process ran. However there was no change in any of the major files like package.json or Gruntfile.js or bower.json

What is the correct way to update a JHipster project, once the JHipster generator is updated?

Cristinacristine answered 27/3, 2014 at 7:14 Comment(0)
C
15

JHipster developers replied over twitter saying that yo jhipster has to be executed at the project root folder.

Cristinacristine answered 28/3, 2014 at 13:10 Comment(0)
T
9

Following [jhipster releases] (https://jhipster.github.io/2015/05/31/jhipster-release-2.14.2.html): How to upgrade

Update your version of JHipster with:

npm update -g generator-jhipster

And then you can update your project when you run again

yo jhipster

You can also update your entities by running again the entity sub-generator, for example if your entity is named Foo

yo jhipster:entity Foo 
Touristy answered 1/6, 2015 at 11:27 Comment(2)
This does not work for me (3.1.0 -> 3.2.0). Install is ok (3.2.0) for new projects but existing ones are still bound to 3.1.0Extine
I was just about to post the same thing. Jhipster generator reports 3.1.0 against existing app, but reports 3.2.0 in when run in new directory.Geiss
U
6

JHipster now has a page on Upgrading an application.

https://jhipster.github.io/upgrading-an-application/

TL;DR

Running the upgrade sub-generator

Go into the application’s root directory:

cd myapplication/

To upgrade your application, type:

yo jhipster:upgrade

If you want to run the upgrade sub-generator even if no new JHipster version is available, type:

yo jhipster:upgrade --force

Urbas answered 21/7, 2016 at 2:7 Comment(0)
D
4

If you want to update all entities you need to run

yo jhipster --with-entities

from the root of your project

Dewhurst answered 2/5, 2016 at 9:47 Comment(0)
S
0

Our jHipster monolithic project is based on an older build of the generator, and still reliant on bower / angularjs for the client. Thus the auto-update ability would never work.

I've been manually updating spring-boot-starter-parent every other sprint to try and bring it up into 2.x parity, but am still unable to leave the 1.5.x version stream due to various dependency issues with (mainly) Hibernate.

As a possible suggestion if you're in the same boat with your own monolithic project:

  • Pull down select versions of the jhipster-generator
  • Generate a "hello world" starter monolithic project
  • Compare the generated pom.xml with your own project
  • Compare the generated entity and configuration files with your own project
Secondclass answered 28/11, 2018 at 6:57 Comment(0)
P
0

Run below command at the root of your project. Also, make sure to delete nodemodules and target folders before upgrading the project.

yo jhipster:upgrade

Postbellum answered 16/5, 2020 at 14:43 Comment(0)
A
0

jhipster --force --with-entities this is how i do it (npm)

Amena answered 26/6, 2020 at 7:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.