简体   繁体   English

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

[英]How to update the JHipster project after updating JHipster generator?

I updated my JHipster installation as per this page by 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 控制台

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.但是这次我输入了相同的名称,并且jhipster生成过程运行了。 However there was no change in any of the major files like package.json or Gruntfile.js or bower.json然而,任何主要文件都没有变化,比如 package.json 或 Gruntfile.js 或 bower.json

What is the correct way to update a JHipster project, once the JHipster generator is updated?一旦 JHipster 生成器更新,更新 JHipster 项目的正确方法是什么?

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

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 

JHipster now 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/

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:如果您想在没有新的 JHipster 版本可用的情况下运行升级子生成器,请键入:

yo jhipster:upgrade --force

If you want to update all entities you need to run如果要更新需要运行的所有实体

yo jhipster --with-entities

from the root of your project你的项目

Our jHipster monolithic project is based on an older build of the generator, and still reliant on bower / angularjs for the client.我们的 jHipster 单体项目基于生成器的较旧版本,并且仍然依赖于客户端的 bower / angularjs。 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.我一直在每隔一个 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下拉选择版本的 jhipster-generator
  • Generate a "hello world" starter monolithic project生成一个“hello world”启动单体项目
  • Compare the generated pom.xml with your own project将生成的 pom.xml 与自己的项目进行对比
  • Compare the generated entity and configuration files with your own project将生成的实体和配置文件与您自己的项目进行比较

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:升级

jhipster --force --with-entities 这就是我的做法(npm)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM