Java 更新JHipster生成器后如何更新JHipster项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22680663/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 17:15:21  来源:igfitidea点击:

How to update the JHipster project after updating JHipster generator?

javaspringyeoman-generatorjhipster

提问by Dhanush Gopinath

I updated my JHipster installation as per this pageby running the command

我通过运行命令根据此页面更新了我的 JHipster 安装

npm update -g generator-jhipster

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

但是要更新我的应用程序,我不确定应该在哪里运行下一个命令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

Jhipster 控制台

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

我尝试在现有项目根目录上方的一级运行它,然后它还会询问我新项目的名称。但是这次我输入了相同的名称,并且jhipster生成过程运行了。然而,任何主要文件都没有变化,比如 package.json 或 Gruntfile.js 或 bower.json

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

一旦 JHipster 生成器更新,更新 JHipster 项目的正确方法是什么?

采纳答案by Dhanush Gopinath

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

JHipster 开发人员在 twitter 上回复说yo jhipster必须在项目根文件夹中执行。

回答by alpoza

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

关注 [jhipster 发布] ( https://jhipster.github.io/2015/05/31/jhipster-release-2.14.2.html):如何升级

Update your version of JHipster with:

使用以下命令更新您的 JHipster 版本:

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

您还可以通过再次运行实体子生成器来更新您的实体,例如,如果您的实体名为 Foo

yo jhipster:entity Foo 

回答by Ganesh Krishnan

If you want to update all entities you need to run

如果要更新需要运行的所有实体

yo jhipster --with-entities

from the root of your project

你的项目

回答by TheKojuEffect

JHipsternow has a page on Upgrading an application.

JHipster现在有一个关于升级应用程序的页面。

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

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

TL;DR

TL; 博士

Running the upgrade sub-generator

运行升级子生成器

Go into the application's root directory:

进入应用程序的根目录:

cd myapplication/

cd myapplication/

To upgrade your application, type:

要升级您的应用程序,请键入:

yo jhipster:upgrade

yo jhipster:upgrade

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

如果您想在没有新的 JHipster 版本可用的情况下运行升级子生成器,请键入:

yo jhipster:upgrade --force

yo jhipster:upgrade --force

回答by Erik Yuzwa

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.

我们的 jHipster 单体项目基于生成器的较旧版本,并且仍然依赖于客户端的 bower / angularjs。因此,自动更新功能永远不会起作用。

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.

我一直在每隔一个 sprint 手动更新 spring-boot-starter-parent 以尝试将其提升到 2.x 奇偶校验,但由于(主要是)Hibernate 的各种依赖性问题,我仍然无法离开 1.5.x 版本流.

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
  • 下拉选择版本的 jhipster-generator
  • 生成一个“hello world”启动单体项目
  • 将生成的 pom.xml 与自己的项目进行对比
  • 将生成的实体和配置文件与您自己的项目进行比较

回答by trainings-dev

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

在项目的根目录下运行以下命令。另外,请确保在升级项目之前删除 nodemodules 和 target 文件夹。

yo jhipster:upgrade

哟 jhipster:升级