问题
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