Commit Graph

57 Commits

Author SHA1 Message Date
Sébastien Deleuze 7edb0b3397 Upgrade the build to Java 25
See gh-35531
Closes gh-35530
2025-09-23 15:57:21 +02:00
Sébastien Deleuze da0a36bfd6 Upgrade to NullAway 0.12.10 and refine nullability
Closes gh-35492
2025-09-17 15:17:23 +02:00
Sébastien Deleuze adc64d5cbc Upgrade to Dokka 2.0.0
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
See https://kotlinlang.org/docs/dokka-migration.html

Closes gh-35211
2025-07-16 18:27:10 +02:00
Sébastien Deleuze ebf8d4fb1c Use Gradle nullability plugin 0.0.1
This commit replaces manual Gradle configuration of Error Prone
and NullAway by
https://github.com/spring-gradle-plugins/nullability-plugin.

Closes gh-34983
2025-06-03 09:42:29 +02:00
Sam Brannen 0c6a26a381 Merge branch '6.2.x'
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
2025-04-27 17:59:50 +02:00
Sam Brannen 5013d6d771 Fail Gradle build whenever a javadoc task fails
Backport Bot / build (push) Waiting to run Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
To ensure that failures in javadoc tasks do not result in documentation
silently not being generated/published, this commit sets
`failOnError = true` for all javadoc tasks.

See gh-27497
See gh-34774
Closes gh-34837
2025-04-27 17:59:41 +02:00
Sam Brannen 39e263fe5d Switch javadoc link-modularity-mismatch flag to info
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
We now invoke the javadoc tool with "--link-modularity-mismatch info"
in order not to fail the build when encountering warnings such as the
following.

> The code being documented uses packages in the unnamed module, but the
> packages defined in https://junit.org/junit5/docs/5.12.2/api/ are in
> named modules.

Closes gh-27497
2025-04-16 14:16:59 +02:00
Sam Brannen 3057de7746 Merge branch '6.2.x' 2025-04-16 14:04:38 +02:00
Sam Brannen f40d98668d Revise configuration for javadoc Gradle tasks
Backport Bot / build (push) Waiting to run Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
Closes gh-34766
2025-04-16 13:42:05 +02:00
Sam Brannen cfb7888044 Merge branch '6.2.x' 2025-04-06 17:40:51 +02:00
Sam Brannen 2ca9f6f064 Indent with tabs instead of spaces in Gradle build scripts 2025-04-06 17:39:23 +02:00
Sam Brannen a376ef36e4 Merge branch '6.2.x'
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
2025-03-20 10:24:39 +01:00
Dmitry Sulman 5455c645f0 Update deprecated Gradle task creation
Backport Bot / build (push) Waiting to run Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
This commit replaces use of the deprecated Gradle `task` method with
the new `tasks.register` method.

Closes gh-34617

Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
2025-03-20 10:22:55 +01:00
Sébastien Deleuze 7bc712e304 Upgrade NullAway to 0.12.4
This commit also slightly refines nullness but without
significant user-side impact expected.

Closes gh-34525
2025-03-03 08:45:54 +01:00
Sébastien Deleuze e49d2da443 Upgrade to Error Prone 2.36.0
Closes gh-34396
2025-02-10 12:09:19 +01:00
Sébastien Deleuze c0039fb624 Enable NullAway JSpecify mode
See gh-34140
2025-01-14 12:26:20 +01:00
Sébastien Deleuze 87f1961c3e Polishing 2025-01-09 17:53:28 +01:00
Sébastien Deleuze 52f325db82 Fix javadoc Gradle task
This commit refines the javadoc options and removes aspectj broken link.

See gh-34220
2025-01-09 17:28:09 +01:00
Sébastien Deleuze 2697aea15f Upgrade NullAway to 0.12.3
This commit also leverages the new OnlyNullMarked flag.

See gh-28797
2025-01-07 09:57:56 +01:00
Sébastien Deleuze 1e0ef99b0c Leverage `@NullMarked` instead of package configuration
This commit replaces NullAway package configuration by package-level
`@NullMarked` detection by configuring `NullAway:AnnotatedPackages` to
an empty string.

NullAway configuration should be refined to use a proper flag instead
once uber/NullAway#574 is fixed.

See gh-28797
2024-12-23 17:14:29 +01:00
Sébastien Deleuze bc5d771a06 Switch to JSpecify annotations
This commit updates the whole Spring Framework codebase to use JSpecify
annotations instead of Spring null-safety annotations with JSR 305
semantics.

JSpecify provides signficant enhancements such as properly defined
specifications, a canonical dependency with no split-package issue,
better tooling, better Kotlin integration and the capability to specify
generic type, array and varargs element null-safety. Generic type
null-safety is not defined by this commit yet and will be specified
later.

A key difference is that Spring null-safety annotations, following
JSR 305 semantics, apply to fields, parameters and return values,
while JSpecify annotations apply to type usages. That's why this
commit moves nullability annotations closer to the type for fields
and return values.

See gh-28797
2024-12-19 11:07:23 +01:00
Stéphane Nicoll bbfc3364e1 Merge branch '6.1.x' 2024-07-24 11:45:49 +02:00
Stéphane Nicoll bcdc991838 Switch to Shadow plugin fork
This commit fixes to a fork of the shadow plugin that fixes support
with recent Gradle releases.

See https://github.com/johnrengelman/shadow/pull/876
2024-07-24 11:42:54 +02:00
Sébastien Deleuze 12272d6e41 Remove unneeded `@SuppressWarnings("NullAway")`
Closes gh-32542
2024-05-06 18:28:54 +02:00
Sébastien Deleuze 996e66abdb Perform NullAway build-time checks in spring-test
Closes gh-32475
2024-03-26 18:14:56 +01:00
Sébastien Deleuze 8b51b36729 Perform NullAway build-time checks in more modules
This commit enables null-safety build-time checks in
all remaining modules except spring-test.

See gh-32475
2024-03-26 15:53:01 +01:00
Sébastien Deleuze 5b660da52d Perform NullAway build-time checks in more modules
This commit enables null-safety build-time checks in:
 - spring-jdbc
 - spring-r2dbc
 - spring-orm
 - spring-beans
 - spring-aop

See gh-32475
2024-03-26 09:59:30 +01:00
Sébastien Deleuze 7c009ccc1f Perform NullAway build-time checks in spring-messaging
See gh-32475
2024-03-25 12:30:03 +01:00
Sébastien Deleuze 2fc78dfb69 Perform NullAway build-time checks in spring-jms
See gh-32475
2024-03-25 11:27:04 +01:00
Sébastien Deleuze e52ee01ec8 Perform NullAway build-time checks in spring-web
Also in spring-websocket.

See gh-32475
2024-03-25 11:11:09 +01:00
Sébastien Deleuze 0e7aba4179 Perform NullAway build-time checks in spring-webmvc
See gh-32475
2024-03-22 17:49:03 +01:00
Sébastien Deleuze 0a50854e1a Perform NullAway build-time checks in spring-webflux
See gh-32475
2024-03-22 16:09:18 +01:00
Sébastien Deleuze f648fd7c3b Perform NullAway build-time checks in spring-expression
See gh-32475
2024-03-20 10:10:00 +01:00
Sébastien Deleuze 4c7735016b Refine null-safety with NullAway build-time checks
This commit introduces null-safety checks for spring-core at build-time
in order to validate the consistency of Spring null-safety annotations
and generate errors when inconsistencies are detected during a build
(similar to what is done with Checkstyle).

In order to make that possible, this commit also introduces a new
org.springframework.lang.Contract annotation inspired from
org.jetbrains.annotations.Contract, which allows to specify semantics
of methods like Assert#notNull in order to prevent artificial
additional null checks in Spring Framework code base.

This commit only checks org.springframework.core package, follow-up
commits will also extend the analysis to other modules, after related
null-safety refinements.

See gh-32475
2024-03-19 16:30:32 +01:00
Werner Fouché 68864674cc Upgrade to JMH 1.37
See gh-32015
2024-01-12 08:40:47 +01:00
Simon Baslé eabb846d07 Improve how the build deals with javadoc invalid references
This commit improves how the build deals with javadoc invalid references
in two ways.

Link/see references that are temporarily invalid during javadoc
generation of individual modules are better masked by using the option
`Xdoclint:syntax` instead of `Xdoclint:none` (warnings were still
visible in some cases, e.g. when individually building the javadoc for
a specific module).

Global javadoc-building task `api` now combines `syntax` and `reference`
`Xdoclint` groups, allowing to raise truly invalid references even when
all the modules have been aggregated.

This commit also fixes the 20+ errors which appeared following the later
change in doclet configuration.

Closes gh-30428
2023-05-16 15:04:10 +02:00
Brian Clozel e9ada8d15c Upgrade JMH build plugins
This commit upgrades the Gradle JMH plugin to 0.6.8 and the companion
JMH version to 1.36.
2022-12-05 13:02:11 +01:00
Brian Clozel acd9016fc3 Create framework-docs module
This commit creates a new "framework-docs" module, which is dedicated to
documentation generation (reference and API docs).
This commit refactors the build configuration and moves the asciidoc
files to a separate location, but does not change the name nor the
nature of published artifacts.

Closes gh-29417
2022-11-02 10:59:12 +01:00
Brian Clozel 6b0f6e9f27 Apply Gradle Test Retry plugin
The plugin is configured to detect flaky tests and retry them 3 times
when running on the CI, but still reports failures. This will provide a
standard way to detect flaky tests as failures and successful attempts
are shown in the tests report.
2022-10-06 13:54:28 +02:00
Brian Clozel cecc0849a8 Upgrade to Gradle 7.2
This commit upgrades Gradle to 7.2.
Gradle configuration names are updated accordingly.
This also upgrades Gradle build plugins.

See gh-26870
2021-09-13 09:37:35 +02:00
Sam Brannen e7b499f7b6 Upgrade to JMH 1.32 and avoid accidental dependency on jopt-simple 4.6
JMH is now implicitly configured to use jopt-simple 5.0.4 instead of 4.6.

This problem was uncovered while fixing gh-27365
2021-09-07 10:45:44 +02:00
Brian Clozel 85eb589c2e Fix Gradle Java Toolchain configuration
This commit fixes various issues with the configuration of the Gradle
Java toolchain in the build.

First, the configuration of build properties is fixed in the CI pipeline
because it wasn't properly checked.
The JMH plugin is also upgraded and we now configure its toolchain
support.
This commit also rewrites the XJC tasks in the spring-oxm module,
leveraging a Gradle plugin that creates actual compile tasks we can
configure.

See gh-25787
2021-05-03 15:02:09 +02:00
Brian Clozel a8d553218c Introduce Gradle Toolchain support in build
Prior to this commit, the Spring Framework build would rely on
setting a custom Java HOME for building all sources and tests
with that JDK.

This approach is not flexible enough, since we would be testing
the source compatibility against a recent JDK, but not a common
case experienced by the community: compiling and running
application code with a recent JDK and the official, JDK8-based
Framework artifacts.
This method is also limiting our choice of JDKs to the ones
currently supported by Gradle itself.

This commit introduces the support of Gradle JVM Toolchains in
the Spring Framework build.

We can now select a specific JDK for compiling the main
SourceSets (Java, Groovy and Kotlin) and another one for
compiling and running the test SourceSets:

`./gradlew check -PmainToolChain=8 -PtestToolchain=15`

Gradle will automatically find the JDKs present on the host or
download one automcatically. You can find out about the ones
installed on your host using:

`./gradlew -q javaToolchains`

Finally, this commit also refactors the CI infrastructure to:

* only have a single CI image (with all the supported JDKs)
* use this new feature to compile with JDK8 but test it
against JDK11 and JDK15.

Closes gh-25787
2021-03-15 14:33:41 +01:00
Sam Brannen 3112dc5f81 Improve JMH Jar configuration 2021-01-12 12:27:54 +01:00
Sam Brannen 6b9d5698ce Upgrade to JMH 1.25 2021-01-12 12:27:54 +01:00
Brian Clozel 67547e61c6 Add JMH benchmark infrastructure
Prior to this commit, the Spring Framework test suite would rely only on
"Performance" tests associated with a specific CI build. As outlined in
gh-24830, the way they're built and executed is not working well
anymore.

This commit introduces a new JMH benchmark infrastructure in the build.
The goal here is not to run those benchmarks as part of a CI build, but
rather provide a proper infrastructure for writing and locally running
micro-benchmarks when working on specific optimizations.

This commit adds and configures a Gradle JMH plugin to allow for JMH
benchmark classes in Spring Framework modules (in `src/jmh/java` of each
`spring-*` module). It's also relaxing the checkstyle rules for JMH
classes, especially around Javadoc rules: this code is not meant to
have Javadocs.

Finally, this commit links to a new Wiki page on the project GitHub
repository documenting the infrastructure and helping contributors to
run and design benchmarks.

See gh-24830
2020-05-13 21:29:02 +02:00
Jendrik Johannes 9bd60f6554 Update to Gradle 6.2
- Build Scan plugin is now Gradle Enterprise plugin applied in settings
- Compile task dependencies are now defined through classpath
- Test fixture publication can be disabled through public API

Closes gh-24384
2020-04-28 15:03:03 +02:00
Sam Brannen 22a888b53d Polish test fixture publication skipping config
Thanks to @jjohannes for the tip.

See gh-23550
2020-01-03 14:56:13 +01:00
Sam Brannen d5f0bb23ae Disable publication of test fixture artifacts
Thanks to @melix for providing the code snippet necessary to achieve
this with Gradle 5.6.x.

See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen c91dd02905 Delete obsolete TestSourcesPlugin
Since we have migrated to Gradle's built-in test fixture support, the
custom TestSourcesPlugin Gradle plugin is now obsolete.

See gh-23550
2020-01-02 16:01:35 +01:00