Commit Graph

125 Commits

Author SHA1 Message Date
Sébastien Deleuze 75e57475ca Upgrade to Kotlin 2.1.0
Spring Framework 7.0 will use a Kotlin 2 baseline, using the latest 2.x
release at the time of the release.

This commit upgrades Kotlin to 2.1.0, and Kotlin Serialization and
Coroutines accordingly.

Closes gh-33629
2024-12-05 11:42:00 +01:00
Brian Clozel 28273b9309 Add build DSL extension to enable Java preview features
This commit adds a DSL Gradle extension for optionally enabling Java
preview features in a specific project module. The "--enable-preview"
JVM flag will be configured automatically for compile and test tasks
where this is applied:

```
springFramework {
	enableJavaPreviewFeatures = true
}
```

See gh-33616
2024-11-28 16:29:47 +01:00
Juergen Hoeller 4ca596b7bc Upgrade to Micrometer 1.14.0 and Reactor 2024.0.0
Includes Netty 4.1.114, Jetty 12.0.15, Jetty Reactive HttpClient 4.0.8, RxJava 3.1.9, RSocket 1.1.4, HSQLDB 2.7.4, H2 2.3.232, SnakeYAML 2.3, Groovy 4.0.24, JRuby 9.4.9, Jackson 2.18.1, Gson 2.11, Protobuf 4.28.3, XStream 1.4.21, Woodstox 6.7, TestNG 7.10.2, Selenium 4.26, HtmlUnit 4.6, XMLUnit 2.10, Checkstyle 10.20.1

Closes gh-33876
Closes gh-33878
2024-11-13 13:34:43 +01:00
Juergen Hoeller 4e49f67ec5 Upgrade to SLF4J 2.0.16, Tomcat 10.1.29, Jetty 12.0.13, Netty 4.1.113, Undertow 2.3.17, AssertJ 3.26.3, Checkstyle 10.18.1 2024-09-11 17:16:14 +02:00
Sam Brannen 1e97b2137b Disable class data sharing (CDS) for tests
Prior to this commit, the Gradle build output the following warning
multiple times.

OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended

Since we don't need CDS enabled for our tests, I've added `-Xshare:off`
as a JVM argument for our tests to disable CDS.

(cherry picked from commit 27985b1439)
2024-08-07 18:08:03 +03:00
Brian Clozel 9366308285 Fix Gradle warning in RuntimeHintsAgentPlugin
Fixing the following warning in the runtime hints plugin configuration:
https://docs.gradle.org/8.9/userguide/upgrading_version_8.html#test_task_default_classpath
2024-07-23 17:09:13 +02:00
Sam Brannen 89338c91a9 Stop using using legacy locale data for Date/Time formatting tests
Commit 84714fbae9 introduced usage of the
-Djava.locale.providers=COMPAT command-line argument for javac in order
to allow our JDK 20 builds to pass by using legacy locale data.

That was done to ensure that Date/Time formats using AM/PM produced a
standard space (" ") before the "AM" or "PM" instead of a narrow
non-breaking space (NNBSP "\u202F"), which was introduced in Java 20
due to adoption of Unicode Common Locale Data Repository (CLDR-14032).

This commit removes usage of the -Djava.locale.providers=COMPAT
command-line argument and updates all affected tests to:

- Use an NNBSP before "AM" or "PM" in input text when running on Java 20
  or higher.

- Leniently match against any Unicode space character in formatted
  values containing "AM" or "PM".

See https://jdk.java.net/20/release-notes#JDK-8284840
See https://unicode-org.atlassian.net/browse/CLDR-14032
See gh-30185
Closes gh-33144
2024-07-04 17:03:15 +02:00
Juergen Hoeller ddc397dd05 Upgrade to spring-javaformat-checkstyle 0.0.42 2024-06-11 09:04:30 +02:00
Sébastien Deleuze fe74fcfded Exclude node_modules from NoHttp checks
Closes gh-32980
2024-06-07 11:43:45 +02:00
Juergen Hoeller 8c6a7799be Upgrade to Checkstyle 10.17 2024-05-28 18:46:22 +02:00
Juergen Hoeller 26706f0039 Upgrade to Groovy 4.0.21, Tomcat 10.1.23, Jetty 12.0.8, Netty 4.1.109, Undertow 2.3.13, Checkstyle 10.16 2024-04-29 18:04:25 +02:00
Juergen Hoeller 67a81004a2 Upgrade to AspectJ 1.9.22, Groovy 4.0.20, Tomcat 10.1.20, Netty 4.1.108, OpenPDF 1.3.43, Woodstox 6.6.2, Checkstyle 10.15 2024-04-05 18:04:58 +02:00
Juergen Hoeller 36d1bc57d7 Upgrade to Checkstyle 10.14.2 2024-03-17 20:54:54 +01:00
Juergen Hoeller e5a69dcfdf Upgrade to Reactor 2023.0.4 and Micrometer 1.12.4
Includes AspectJ 1.9.21.1, Groovy 4.0.19, Tomcat 10.1.19, Jetty 12.0.7, Jackson 2.15.4, OpenPDF 1.3.42, Mockito 5.11, Checkstyle 10.14.1

Closes gh-32420
Closes gh-32431
2024-03-12 20:07:58 +01:00
Juergen Hoeller d8c4a33bea Upgrade to SLF4J 2.0.12, Jetty 12.0.6, Apache HttpClient 5.3.1, OpenPDF 1.3.39, Mockito 5.10, Checkstyle 10.13 2024-02-06 17:54:26 +01:00
Juergen Hoeller 9ccc72a9fb Upgrade to spring-javaformat-checkstyle 0.0.41 2024-01-10 17:07:01 +01:00
Juergen Hoeller 81bd6be1c0 Upgrade to Checkstyle 10.12.7 2024-01-06 23:37:45 +01:00
Brian Clozel 3bcd30e811 Remove API diff Gradle plugin configuration
We have not published API diffs for a while now so we should remove the
configuration entirely from our build.
2023-11-23 16:19:20 +01:00
Juergen Hoeller ca9634143c Upgrade to Reactor 2023.0.0
Includes Protobuf 3.25.0, Artemis 2.31.2, Checkstyle 10.12.5

Closes gh-31557
2023-11-15 14:06:43 +01:00
Stéphane Nicoll 5c6232e681 Polish "Order modifiers to align with JLS"
See gh-31368
2023-10-17 16:16:58 +02:00
Stéphane Nicoll 27431b5138 Polish "Enable checkstyle in buildSrc"
See gh-31445
2023-10-17 15:53:37 +02:00
Johnny Lim e95ba4c205 Enable checkstyle in buildSrc
See gh-31445
2023-10-17 15:53:37 +02:00
Stéphane Nicoll 73a5229b03 Polish 2023-10-17 15:53:28 +02:00
Stéphane Nicoll 370c8e0b9e Do not enable spring javaformat plugin
We do not use the plugin, but rather apply some checkstyle rules that
should be available on the classpath.

Closes gh-31448
2023-10-17 15:46:53 +02:00
Stéphane Nicoll 1e7fc6035d Merge branch '6.0.x' 2023-10-12 16:19:49 +02:00
Stéphane Nicoll d05ac097dd Polish "Replace deprecated method getBuildDir()"
See gh-31416
2023-10-12 16:14:23 +02:00
Victor Georgescu 35103b0cd1 Replace deprecated method getBuildDir()
See gh-31416
2023-10-12 16:10:40 +02:00
Juergen Hoeller 841448877a Upgrade to Reactor 2023.0.0-RC1
Includes Jetty 12.0.2 and Checkstyle 10.12.4

Closes gh-31406
2023-10-11 00:46:24 +02:00
ali dandach 1d12c74042 Use Objects.equals() for null-safe string comparison
See gh-31305
2023-09-25 08:28:33 +02:00
Brian Clozel 8708a21143 Configure Gradle toolchain auto-provisioning
This commit configures the Foojay resolver plugin in the Gradle build in
order to auto-provision a required JDK distribution if it's not present
already on the host.

Currently the Spring Framework build requires both a JDK 17 and a JDK 21
distribution to build artifacts.

Closes gh-30474
2023-09-22 09:44:12 +02:00
Sam Brannen 5a87f555f8 Update copyright headers 2023-09-08 13:57:41 +02:00
Brian Clozel 3686c457bb Polish Aggregate Javadoc task
Closes gh-31173
2023-09-07 15:29:25 +02:00
Brian Clozel c93ae250f9 Stop publishing distribution zip artifact
Prior to this commit, the Spring Framework build would publish several
zip artifacts:

* a "*-schema.zip" containing all the XSD schemas produced
* a "*-docs.zip" containing the API docs
* a "*-dist.zip" containing all of the above, plus module jars

Since the reference docs are now produced by Antora in a separate
process, the "*-docs.zip" does not contain the reference docs anymore.
But it still contains the API docs which are automatically fetched from
the artifact repository and published on the docs.spring.io website.

This commit intends to update the current arrangement and optimize the
build.

First, the "*-dist.zip" is not published anymore, since it cannot be
consumed anyway by the community: repo.spring.io does not distribute
release artifacts publicly, developers are expected to get them from
Maven Central. This arrangement is quite dated anyway and is not really
useful in current application build setups.

The generation of API docs is moved to a new "framework-api" module,
separating it from the reference docs module ("framework-docs") which
contains Java, Kotlin and Asciidoctor sources. This removes the custom
javadoc aggregation task and instead uses a dedicated Gradle plugin.

This change also adds a new `-PskipDocs` Gradle project property that
skips entirely the documentation tasks (javadoc, kdocs) as well as the
"distrbution" tasks managed in the framework-api module.
This allows developers to publish locally a SNAPSHOT of Spring Framework
without creating the entire documentation distribution. This is
particularly useful for local testing.

For example, `$ ./gradlew pTML -PskipDocs`.

Closes gh-31049
2023-08-30 12:15:23 +02:00
Sam Brannen c91841883c Upgrade to Checkstyle 10.12.3 2023-08-28 14:52:49 +02:00
Sam Brannen 9e4b95ef3c Upgrade to spring-javaformat-checkstyle 0.0.39 2023-08-28 14:50:28 +02:00
Sam Brannen 63fe45d92a Update copyright headers 2023-07-15 13:11:29 +02:00
Eric Haag 1b27a7baab Remove explicit cross project task dependency
Previously, the runtimeHintsTest task configuration made a cross
project task reference to obtain the jar path of spring-core-test
to use in the -javaagent argument.

With this change, a dedicated configuration exists to resolve the
project artifact without the need to reference the jar task of
spring-core-test.

Closes gh-30838
2023-07-10 22:42:37 +02:00
Eric Haag d40c10e00f Evaluate runtime hints agent parameter lazily
Previously, an afterEvaluate call was used to read the values of the
runtimeHintsAgent extension and the -javaagent parameter supplied to
the runtimeHintsTest task was evaluated eagerly.

With this change the construction of the -javaagent parameter is
deferred until task execution and the extension properties are
evaluated lazily.

See gh-30838
2023-07-10 22:42:37 +02:00
Eric Haag 5d022d2a24 Fix build cache miss in runtimeHintsTest task
Prior to this change, a build cache miss would occur in
runtimeHintsTest tasks when executing the build from two different
locations, causing the tasks to re-execute. This was due to an
absolute path to the agent jar being included in the -javaagent
argument supplied to the test JVM process.

This change introduces a RuntimeHintsAgentArgumentProvider allowing
finer grained control over the way Gradle computes the build cache
key. With this change, the contents of the agent jar file are
considered, rather than the absolute file location.

See gh-30838
2023-07-10 22:42:37 +02:00
Juergen Hoeller b4ed3fbcd0 Upgrade to Checkstyle 10.12.1 2023-06-30 13:02:38 +02:00
Juergen Hoeller b8b88e638b Upgrade to Checkstyle 10.12 2023-06-04 18:54:30 +02:00
Juergen Hoeller 657fe1fa43 Merge branch '6.0.x' 2023-05-08 14:52:26 +02:00
Rob Winch 601de66c03 nohttp exclude **/.gradle/** 2023-05-04 17:47:37 +01:00
Sébastien Deleuze f469eff97b Update RuntimeHintsAgentPlugin to use the native image code path
RuntimeHintsAgentPlugin purpose is to verify that the reflective
invocations expected match the ones performed.

gh-30242 introduces a code path where the reflective invocation
is skipped when running on native.

This issue set the system property "org.graalvm.nativeimage.imagecode"
to "runtime" when running runtime tests with the agent in order to
make sure the code path tested for those tests is the native one.

Closes gh-30422
2023-05-04 15:31:31 +02:00
Simon Baslé 33b4995547 Fix glob pattern in CheckstyleConventions to be Windows-compatible
On windows, the `*` character is not allowed in a directory's name.
When trying to append a glob pattern to a `Path` (`path.resolve("**")`),
if the underlying `Path.getFileSystem()` is windows then an
`InvalidPathException` is thrown.

The NoHttp plugin doesn't really need a `Path` but a glob `String`, so
this commit uses a simple String concatenation in order to append the
wildcard part (with the canonical path separator for good measure).

Closes gh-30355
2023-04-20 16:44:58 +02:00
Sam Brannen d446de62a4 Update copyright headers 2023-04-19 15:55:11 +02:00
Sam Brannen 65a430bb42 Upgrade to Checkstyle 10.9.3 again
Commit ed4404f350 inadvertently switched back to 10.9.1.
2023-04-18 14:09:43 +02:00
Brian Clozel da88ac8cca Move NoHttp config to Gradle conventions
See gh-30339
2023-04-14 12:31:43 +02:00
Brian Clozel 5c574b9878 Refactor toolchain support in Gradle build
This commit removes the `-PmainToolchain` option from our build, since
it was not broadly used. Instead, the language level is now configured
in the `JavaConventions` for JDK 17.

The `-PtestToolchain` option is still available for testing Spring
Framework with other JDKs (i.e., compiling and running tests with a JDK
that's not the baseline).

See gh-30339
2023-04-14 10:30:12 +02:00
Brian Clozel 9562a1c146 Move build test configuration to Gradle convention
This commit moves the Gradle test configuration to a convention so it
can be applied to all test tasks, including from other source sets.

See gh-30339
2023-04-14 10:27:56 +02:00