jasypt-spring-boot 5.0.0
5.0.0 moves jasypt-spring-boot to Spring Boot 4 and Java 25, and collects the fixes that were waiting in issues and pull requests: the StackOverflowError on values with placeholders, a startup deadlock, lost java.util.logging output, encrypted environment variables that stayed encrypted, and a round of Maven plugin fixes with a test suite behind them. Encrypted values, property names and defaults are the same as in 4.x; nothing has to be re-encrypted.
The README has a step-by-step Upgrading from 4.x to 5.0.0 section.
Requirements
- Spring Boot 4.0 or later. Built against Spring Boot 4.2.0 and Spring Cloud 2026.0.0. The sample applications also pass on Spring Boot 4.0 and 4.1.
- Java 17 or later. Built and tested on Java 17, 21 and 25.
- Spring Boot 3.5 stays on 4.0.x. 5.0.0 does not start on Spring Boot 3.
- Same coordinates as before, version
5.0.0:com.github.ulisesbocchio:jasypt-spring-boot-starter,jasypt-spring-bootandjasypt-maven-plugin.
Breaking changes
Spring Boot 4.0 or later is required
Spring Boot 4.2 removed the EnvironmentPostProcessor interface the library was built on, so 4.0.4 does not start there (#440). 5.0.0 uses the Spring Boot 4 interface and therefore needs Spring Boot 4.0 or later (#444, which carries #439).
Migration: move the application to Spring Boot 4 first (Spring Boot 4.0 Migration Guide), then change the version of the starter, the library and the Maven plugin to 5.0.0. On Spring Boot 3, 5.0.0 fails at startup with NoClassDefFoundError: org/springframework/boot/env/PropertySourceInfo; keep 4.0.x there.
Values from @DynamicPropertySource and DynamicPropertyRegistrar are no longer decrypted
Wrapping Spring's DynamicValuesPropertySource broke Spring's own handling of dynamic test properties (#432). That source is now left alone (#438), which also means an ENC(...) value registered that way reaches the application as it is.
Migration: in a test that registered an encrypted value dynamically, register the decrypted value (decrypt it in the supplier), or move the encrypted value to @SpringBootTest(properties = ...), @TestPropertySource or a test configuration file, where it is decrypted as before.
A property that refers to itself fails with Spring's error
Reading AA=${AA}, or ${name:#{default}} used as the value of name, now fails with Spring's Circular placeholder reference, the same as without this library. Before, it ended in a StackOverflowError.
Migration: give the default a different property name, or set the value from another source.
Maven plugin: file encoding and project settings
encrypt,decrypt,reencryptandupgraderead and write the file in the project'sproject.build.sourceEncoding, and in UTF-8 if the project sets none. They used the default encoding of the JVM, so the result depended on the machine. Migration: if your files are in another encoding and the project does not declare it, pass-Djasypt.plugin.encoding=<encoding>. A file that is not valid in the encoding it is read with makes the goal fail, and nothing is written.spring.main.*andlogging.*settings in the project's configuration files are no longer applied to the goals. Migration: none; these settings only made the goals fail.
Java API
Only relevant if your code uses these classes directly.
EncryptablePropertySourcealso extends Spring Boot'sPropertySourceInfo. Both methods have defaults, so an implementation of your own compiles unchanged.- The constructors of
DefaultPropertyResolverthrowNullPointerExceptioninstead ofIllegalArgumentExceptionfor a null encryptor or detector, and no longer accept a nullEnvironment. Singletonmay call its supplier more than once when several threads make the first call at the same time; one result is kept. A null supplier is rejected in the constructor.- Maven plugin:
EncryptionService.decryptValuethrowsIllegalStateException(with the original exception as its cause) for a value it cannot decrypt.FileService.readandwritehave overloads that take aCharset, and the ones without it use UTF-8.
Fixes
- #440: the library starts on Spring Boot 4.2. (#444, #439)
- #427, #392, #377: no more
StackOverflowErrorat startup when an environment variable or a property contains${...}, a shellPS1for example. An environment variable of the formENC(${...})is resolved and decrypted too. (#444) - #404: fixed a startup hang when another thread reads a property while the application context is creating beans. (#443)
- #428: output from libraries that log through
java.util.logging, Liquibase for one, is no longer lost after startup. A bean that re-installsSLF4JBridgeHandleras a workaround can be removed. (#433) - #429: an encrypted environment variable read through its property name (
MY_PWDas${my.pwd}) is decrypted whatever the order of the Spring Boot and jasypt jars on the class path. Before, it could come back asENC(...). (#445) - #432: Spring's dynamic test properties work with the library on the class path; see the breaking change above. (#438)
New
jasypt.encryptor.reset-logging-system(defaulttrue). The library resets the logging system once the property sources are encryptable, so that encrypted properties in the logging configuration are decrypted. Set it tofalseto keep logging customizations made before the application context is refreshed, such as appenders added from anApplicationContextInitializer; encrypted properties in the logging configuration are then not decrypted. (#430)- The property filter compiles its regular expressions once instead of on every property lookup. (#379)
Maven plugin
- New parameter
jasypt.plugin.encodingforencrypt,decrypt,reencryptandupgrade; see the breaking change above for its default. (#448, from #355) - #346: a project with
spring.main.web-application-type=servletin its configuration no longer makes the goals fail withNoClassDefFoundError. (#448) - #347: the project's
logging.*settings (logging.file.name,logging.config) are not applied to the goals. (#448) - #348: a value that cannot be decrypted is reported with the value and what to check, instead of
null: EncryptionOperationNotPossibleException. (#448) - #345:
-Dspring.config.locationis honoured andsrc/main/resourcesdoes not have to exist. This already worked; it is now covered by an integration test. (#448) - A goal that changes nothing does not rewrite the file. (#354, #448)
reencryptandupgradetake each value from the old configuration to the new one in one pass, and write the file only if every value could be decrypted. (#448)- Documentation: quoting
-Darguments in PowerShell (#353) and using another security provider such as Bouncy Castle with the plugin (#395). - The plugin has a test suite now: unit tests that run every goal, and 13 integration projects that run the built plugin with a real Maven, one of them a Spring Boot application that reads the file the plugin encrypted.
Build and CI
- The build works on JDK 25: annotation processors are declared explicitly and the compiler uses
release. (#449) - CI runs on pull requests and on every push to
master, on Java 17, 21 and 25 with Temurin and Zulu, in the library and in the samples; each repository is built against the matching branch of the other. Java 18 and 19 and the Travis configuration are gone. (#442, #447, #449) - Build plugins updated:
maven-compiler-plugin3.16.0,maven-surefire-plugin3.6.1,maven-source-plugin3.4.0,maven-javadoc-plugin3.12.0,jacoco-maven-plugin0.8.16,maven-plugin-pluginandmaven-plugin-annotations3.16.0. Jasypt itself stays at 1.9.3. (#449) - New regression tests for everything listed under Fixes.
- Samples: on Spring Boot 4.2 and 5.0.0, a new
jasypt-spring-boot-demo-loggingsample, and tests that no longer depend on their order.
Documentation
The README and the plugin README were checked against this release by running their examples: a requirements table, the upgrade guide, a reference of all configuration properties, and corrections to examples that did not run as written. (#457)
Thanks
This release is mostly your work: pull requests that waited far too long, and issue reports precise enough to fix from. Thank you.
Pull requests in this release
- @MartinUhlen for the Spring Boot 4.2 port and the guard against recursive placeholder resolution (#439), and @sharmanikhil04 for the follow-up commits in it and for pointing out that the guard had no test that failed without it.
- @arminha for re-installing the
java.util.loggingbridge after the logging reset (#433). - @jpmsilva for
jasypt.encryptor.reset-logging-system(#430). - @AlexXuz for leaving Spring's dynamic property sources alone, with tests and the README note (#438).
- @m-van-tilburg for compiling the filter patterns once (#379).
- @qxo for not rewriting an unchanged file (#354) and for finding the file encoding problem (#355; the commit is part of #448).
Reports and diagnoses the fixes are built on
- @marcopag90 for finding the
StackOverflowErrorwith environment variables on Spring Boot 4.2 and proposing the guard; @novicate for the root-cause analysis on #427; @stevenliuit for thePS1reproduction; @verbathim (#427), @Cczzzz (#392) and @git9999999 (#377) for the reports. - @kalgon for reporting that Spring Boot 4.2 removed the interface the library depended on (#440).
- @nikb1tamerfdp for #428, with a minimal reproducer and the correct diagnosis.
- @tloist for #432: the report, the pointer to the type check in Spring, and the fix that was adopted.
- @gitYupan and @zhangdc007 for the thread dumps on #404 that showed both locks and the order they were taken in.
- @kheckelmann for working out on #429 that Spring Boot had copied the system environment before the library started decrypting it.
- @hugograf for #346 and the public project that revealed the cause; @BearKid for the minimal reproduction on #347, now a test, and @syedshabbir for the workaround there; @jonas-haeusler for pointing to the fix on #345; @JanCooper for the PowerShell versus
cmdobservation on #353.
Earlier pull requests that this release supersedes
- @kyle-mclachlan-stanchion (#382) and @slavino (#406) for their Spring upgrade pull requests.
- @simon-greatrix (#415) for an independent fix and test for environment variables that were not decrypted on Spring Boot 3.5.
Full changelog: jasypt-spring-boot-parent-4.0.4...jasypt-spring-boot-parent-5.0.0