百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
J

jasypt-spring-boot

> 后端框架
开源

Jasypt 与 Spring Boot 的集成

3.1K stars0 点赞2 次浏览
访问官网GitHub

工具介绍

Jasypt 与 Spring Boot 的集成

jasypt-spring-boot

Jasypt 对 Spring Boot 3.5+ 的集成

要求: Java 17+ 和 Spring Boot 3.5+ Jasypt Spring Boot 为 Spring Boot 应用中的属性源提供加密支持。
在项目中集成 jasypt-spring-boot 有 3 种方式:

  • 如果使用 @SpringBootApplication 或 @EnableAutoConfiguration,只需将启动器 jar jasypt-spring-boot-starter 添加到类路径中,即可在整个 Spring 环境中启用可加密属性
  • 将 jasypt-spring-boot 添加到类路径中,并在主配置类上添加 @EnableEncryptableProperties,以在整个 Spring 环境中启用可加密属性
  • 将 jasypt-spring-boot 添加到类路径中,并使用 @EncryptablePropertySource 声明各个可加密属性源

有什么新内容?

前往 发布说明

首先需要做什么?

使用以下 3 种方法之一(上面已简要说明):

  1. 如果你的 Spring Boot 应用使用了 @SpringBootApplication 或 @EnableAutoConfiguration,只需将 starter jar 依赖添加到项目中,即可在整个 Spring 环境中启用可加密属性(这意味着任何系统属性、环境属性、命令行参数、application.properties、application-*.properties、yaml 属性以及任何其他属性源都可以包含加密属性):
xml
    <dependency>
            <groupId>com.github.ulisesbocchio</groupId>
            <artifactId>jasypt-spring-boot-starter</artifactId>
            <version>4.0.4</version>
    </dependency>
	```

2. 如果你不使用 `@SpringBootApplication` 或 `@EnableAutoConfiguration` 自动配置注解,则将以下依赖添加到项目中:
	
	
```xml
    <dependency>
            <groupId>com.github.ulisesbocchio</groupId>
            <artifactId>jasypt-spring-boot</artifactId>
            <version>4.0.4</version>
    </dependency>
	```

然后,将 `@EnableEncryptableProperties` 添加到你的配置类中。例如:

	```java
    @Configuration
    @EnableEncryptableProperties
    public class MyAp
    ```

Issues· 77 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Javaencryptable-propertiesencryptionjavajava-8

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类后端框架
定价开源

> 相关工具

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架