Sim*_*ant 9 java spring hibernate spring-boot hibernate-types
我com.vladmihalcea:hibernate-types-52
在 Spring Boot 项目中使用了依赖项。而且,我注意到在应用程序启动时,添加了一些大型日志消息:
2020-04-09 11:43:59.535 WARN 3465 --- [ main] Hypersistence Optimizer : You should use Hypersistence Optimizer to speed up your Hibernate application!
2020-04-09 11:43:59.535 WARN 3465 --- [ main] Hypersistence Optimizer : For more details, go to https://vladmihalcea.com/hypersistence-optimizer/
2020-04-09 11:43:59.536 INFO 3465 --- [ main] Hypersistence Optimizer :
_ _ _ _
| | | | (_) | |
| |__| |_ _ _ __ ___ _ __ ___ _ ___| |_ ___ _ __ ___ ___
| __ | | | | '_ \ / _ \ '__/ __| / __| __/ _ \ '_ \ / __/ _ \
| | | | |_| | |_) | __/ | \__ \ \__ \ || __/ | | | (_| __/
|_| |_|\__, | .__/ \___|_| |___/_|___/\__\___|_| |_|\___\___|
__/ | |
|___/|_|
____ _ _ _
/ __ \ | | (_) (_)
| | | |_ __ | |_ _ _ __ ___ _ _______ _ __
| | | | '_ \| __| | '_ ` _ \| |_ / _ \ '__|
| |__| | |_) | |_| | | | | | | |/ / __/ |
\____/| .__/ \__|_|_| |_| |_|_/___\___|_|
| |
|_|
Run Code Online (Sandbox Code Playgroud)
提示很好,项目听起来很有趣,但仍然希望从我的应用程序中删除横幅。
项目所有者描述了为什么引入横幅,为什么默认情况下不会禁用它以及如何手动禁用它。
In short, you can buy a Hypersistence Optimizer license and add the project as a dependency to benefit from the JPA and Hibernate auto-tuning checks.
Or you can add either a hibernate.properties
or hibernate-types.properties
file to your project with the one property to disable the banner:
hibernate.types.print.banner = false
Run Code Online (Sandbox Code Playgroud)
Or, you could pass this property as a Java System property:
java -Dhibernate.types.print.banner=false -jar target/high-performance-java-persistence-1.0.0.jar
Run Code Online (Sandbox Code Playgroud)
Starting with the release of Hibernate 5.5 and the hibernate-types-55
dependency, you can now provide the hibernate.types.print.banner
property in your application.properties
file, like this:
spring.jpa.properties.hibernate.types.print.banner=false
Run Code Online (Sandbox Code Playgroud)
If you're using
hibernate-types-52
or older dependencies, then you won't be able to provide this setting via the Spring Bootapplication.properties
file.
如果您无权访问 JVM 参数,则可以替代上述答案。
这两种方法都适用于 Spring Boot,在 2.2.x 上进行了测试。
在src/main/resources/hibernate-types.properties
.
hibernate.types.print.banner=false
Run Code Online (Sandbox Code Playgroud)
创建以下任一文件(取决于您的 版本hibernate-types
)。
最新的做事方式:src/main/java/io/hypersistence/optimizer/core/License.java
.
package io.hypersistence.optimizer.core;
public class License {
public static class Signature {
}
}
Run Code Online (Sandbox Code Playgroud)
旧版本检查src/main/java/io/hypersistence/optimizer/HypersistenceOptimizer.java
.
package io.hypersistence.optimizer;
public class HypersistenceOptimizer {
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3039 次 |
最近记录: |