惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
WordPress大学
WordPress大学
小众软件
小众软件
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
腾讯CDC
量子位
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Vulnerabilities – Threatpost
Scott Helme
Scott Helme
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
Jina AI
Jina AI
Attack and Defense Labs
Attack and Defense Labs
S
SegmentFault 最新的问题
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
Google Online Security Blog
Google Online Security Blog
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
罗磊的独立博客
L
LINUX DO - 最新话题
博客园 - Franky
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
The Last Watchdog
The Last Watchdog
J
Java Code Geeks
AI
AI
C
Cisco Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
Help Net Security
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
I
Intezer
S
Securelist

Maciej Walkowiak - Java & Spring

Blog Generating HTTP clients in Spring Boot application from OpenAPI spec PostgreSQL and UUID as primary key Dynamic Projections with Spring Data JPA Container logs with Spring Boot and Testcontainers Reified Generics in Java? Faster integration tests with reusable Testcontainers and Flyway Running one-time jobs with Quartz and Spring Boot The best way to use Testcontainers with Spring Boot Spring Boot & Flyway - clear database between integration tests Activate Maven Profile by Operating System Spring Boot with Thymeleaf and Tailwind CSS - Complete Guide How to publish a Java library to Maven Central - Complete Guide Docker Compose - waiting until containers are ready Single file Java applications with JBang Beautiful bash scripts with Gum Running Java on CRaC How to log PostgreSQL queries with Testcontainers Spring Boot 3.0 & GraalVM Native Image - not a free lunch Creating Spring Cloud Function projects with AWS SAM Loading classpath resources to String with a custom JUnit extension Creating Project Templates with Cookiecutter Auto-Registering JUnit 5 extensions Spring Boot component scanning without annotations Listing Maven dependencies in Spring Boot Actuator Info endpoint Spring Cloud AWS 2.3 RC2 Released How I built vlad-cli - command line interface to Vlad Mihalcea The State of Java Relational Persistence On Choosing a Tech Stack
What's new in Spring?
Spring Authorization Server 1.0 ​ · 2022-11-28 · via Maciej Walkowiak - Java & Spring

Agent Smith from The Matrix

If you feel a little overwhelmed with the constant stream of news from the Spring team - I hear you. November was a very hot month for Spring developers. In addition to plenty of Spring project portfolio releases there were few interesting changes that you might have missed.

Below I collected the most important things (and added some notes) that I believe you - as a Spring developer - should know to stay up to date.


Just to avoid any confusion - I do not work for Spring/VMWare and this is not an official news blog post by any means. For the official news from the Spring team follow weekly series "This week in Spring" written by Josh Long at https://spring.io/blog.

New Releases ​

Spring Framework 6.0 ​

Spring Framework has become a foundation for all the other Spring modules, so often we don't follow much what has changed as we are more interested in how Spring Boot offers these changes to be consumed by developers.

There are though some both important and interesting changes you should get familiar with.

Official announcement: 👉 Spring Framework 6.0 goes GA at spring.io/blog

"Introducing Spring Framework 6.0" by Brian Clozel and Stephane Nicoll:

GraalVM Native Image Support ​

It is possible now to compile and build Spring Framework based projects to GraalVM Native Image - thanks to which applications have not only dramatically shorter startup times but also consume much less memory.

This capability has been developed for past 3 years in an experimental project called Spring Native - now it has been merged into Spring Framework 6 and Spring Boot 3 effectively ending the life of the Spring Native project.

While it may sound reasonable to switch completely to building native images instead of running Spring applications on JVM - in many cases it is not, for reasons explained in Spring Boot 3 Native Image - Not a Free Lunch. Also, there is a chance that the dependencies you use do expose required metadata for GraalVM and you either have to ditch them, change the way they are used, or just wait until the become GraalVM native image friendly.

Especially if you are going to build a new application I recommend getting familiar with the constraints to see how your use case fits and consider targeting native build.

HTTP Interfaces ​

Spring now offers creating HTTP clients in a declarative way in a feature called HTTP interfaces.

This is not a new concept - it has been possible to do it in Spring since years through Spring Cloud OpenFeign project. Now it is a first class citizen and I imagine we can expect better support and integration with other aspects of a framework than through 3rd party options.

Observability ​

Distributed tracing capability for Spring stack that used to live in Spring Cloud Sleuth project, has moved to Micrometer Tracing and also became Spring Framework's dependency. Effectively, when using Spring Framework 6 (or Spring Boot 3 for that matter), you should not include anymore the dependency to Spring Cloud Sleuth.

I recommend reading a fantastic post by Marcin Grzejszczak - Observability with Spring Boot 3 and Micrometer Tracing documentation to learn what's the Spring approach to observability defined as interconnection between metrics, logging, and distributed tracing.

Migration from javax to jakarta ​

Due to political reasons many of the modules that used to reside in javax package has been moved to jakara package. Spring team has nothing to do with this change and just had to adjust to the reality.

As a result, all the classes from packages like javax.servlet, or javax.persistence moved to jakarta.servlet and jakarta.persistence respectively. Be prepared to spend some time on "Find & Replace" in your IDE.

Upgrading baseline to Java 17 ​

Spring has been compatible with Java 17 since a long time, so this does not mean that now you can use Java 17 and before you couldn't. It means though that now Spring Framework uses internally Java 17 and requires Java 17 or newer in your projects.

I think this is great from the adoption point of view as it will effectively force developers to upgrade Java versions (which will positively affect applications performance and developers' happiness) but in case you are stuck for whatever reason with Java 11 or Java 8 - you have a problem - as you won't be able to use Spring Framework 6 and any Spring module based on Spring Framework 6.

Spring Data 2022.0 ​

Spring Data is an umbrella for all datastore specific projects so for each one it brings a different set of changes. To be honest, I don't find it easy to go through changelogs and find what exactly has changed between the major version.

👉 Spring Data 2022.0 goes GA

For the Spring Data JPA, definitely the highlight is upgrade to Hibernate 6. You can learn more about upgrading to Hibernate 6 and Spring Framework 6 from the Vlad's article with a bit clickbaity title The best way to do the Spring 6 migration.

Also, a new repository type has been introduced - ListCrudRepository, and a couple of things have changed in regard to CrudRepository and PagingAndSortingRepository. I recommend learning more about the changes and reasons from the official blog post Announcing ListCrudRepository & Friends for Spring Data 3.0.

Spring Modulith 0.1 ​

Spring Modulith is a new, experimental Spring project that supports developers in expressing these logical application modules in code and in building well-structured, domain-aligned Spring Boot applications.

(from Introducing Spring Modulith by Oliver Drotbohm)

This effectively means that it gives tools to enforce internal structure within single (monolithic) application - split it into modules with clearly expressed dependencies, test these modules independently and enforce module boundaries with tests.

Recommended reading:

A new Spring module for implementing OAuth2 authorization server. This somewhat reverses the decision to remove authorization server capabilities from Spring Security.

Now, Authorization Server is completely detached from Spring Security and functions as a separate Spring module.

👉 Spring Authorization Server 1.0 is now GA

I recommend watching a talk from Laur Splica on this very topic:

Changes in start.spring.io ​

Gradle is the default build tool ​

Spring team took a quite controversial decision to switch the default build tool at start.spring.io from Maven to Gradle.

... which caused some drama on Twitter (that I actually enjoyed). I recommend looking into https://github.com/spring-io/start.spring.io/issues/1012 and go through the discussion to get familiar with different pros/cons of using Gradle and Maven.

If you don't like having Gradle selected by default, I made a Chrome extension that reverts this change.

Gradle Kotlin variant for Java projects ​

It is possible to choose which flavor or Gradle build to use - Groovy or Kotlin (not determined by the language as it used to be).

SpringOne switched to online event ​

Unexpectedly, one month before the SpringOne was meant to happen, the event has transitioned into a free virtual event and rescheduled to January. A bummer for everyone who planned their trip to San Francisco but on the other hand everone around the globe will be able to attend the virtual variant of this event for free.

It won't be a full-fledged conference like SpringOne in pandemic times, but rather a series of presentations on the latest and greatest in Spring ecosystem directly from the Spring team.

Logo change on spring.io website ​

A subtle change at spring.io website - the Spring logo got decorated with "by VMWare Tanzu".

Perhaps it is a cosmetic change, or maybe it means something more. Time will tell.

Let's stay in touch and follow me on Twitter: @maciejwalkowiak

Subscribe to RSS feed