Disable Liquibase temporarily in JHipster 2.26

耗尽温柔 提交于 2019-12-23 11:46:03

问题


I am using JHipster as a tool to teach Software Engineering. I would like to teach JHipster incrementally to soften the learning curve . In this regard, please, I'd like to know the smartest way to temporarily disable Liquibase . I prefer to use the JPA2 DDL auto functionality at the begining of the Academic course (https://docs.spring.io/spring-boot/docs/current/reference/html/howto-database-initialization.html#howto-initialize-a-database-using-jpa) . Thank you very much for this awesome AngularJS + Spring Boot generator.


回答1:


I'm using jihipster 3.12, in Jhipster 3.12, in your src\main\resource\config\application-dev.yml

change profiles setup to add "no-liquibase" like this:

spring:
    profiles:
        active: dev
        include: swagger, no-liquibase

Hope that helps




回答2:


You can add the profile no-liquibase when build. I ussually use below config:

 <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
    <executable>true</executable>
    <arguments>
        <argument>--spring.profiles.active=prod,no-liquibase</argument>
    </arguments>
</configuration>

You can prefer some useful profiles in Constants if needed.




回答3:


Try commenting out all include lines from master.xml. This will not actually disable liquibase and it will still create the databasechangelog and databasechangeloglock tables, but it will prevent it from applying any changesets.




回答4:


I tried to disable liquibase, by commenting the includes in the master.xml file.

But every time on adding/updating an entity, the master.xml file is updated. This will again execute liquibase on subsequent startups.

I had all the tables generated and I wanted to completely disable liquibase. For this I commented out liquibase plugins and dependencies from the pom.xml.

This gave a few compilation errors in a few liquibase related java classes, which I commented out.

Now liquibase does not start any more on startup.



来源:https://stackoverflow.com/questions/34559042/disable-liquibase-temporarily-in-jhipster-2-26

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!