Commit Graph

72 Commits

Author SHA1 Message Date
Juergen Hoeller 459e8a1ea5 Deprecate LocalVariableTableParameterNameDiscoverer completely
LocalVariableTableParameterNameDiscoverer is not registered by default anymore now.
Java sources should be compiled with `-parameters` instead (available since Java 8).
Also retaining standard Java parameter names for all of Spring's Kotlin sources now.

Closes gh-29531
2022-11-22 19:26:15 +01:00
Brian Clozel 21414bc265 Move Kotlin Gradle build config to convention
This commit moves the Kotlin build configuration from the Gradle DSL
to a dedicated convention in buildSrc.
2022-11-02 10:59:39 +01:00
Arjen Poutsma ca33752267 Upgrade to Jackson 2.14.0-rc3
This commit upgrades Jackson to 2.14.0-rc3, which resolves two
outstanding issues Spring Framework had with rc2. This commit reverts
the changes made due to those issues, see
https://github.com/FasterXML/jackson-core/issues/824, and
https://github.com/FasterXML/jackson-module-kotlin/issues/582.

Closes gh-29405
2022-10-31 10:35:10 +01:00
Arjen Poutsma f99c02fc94 Upgrade to Jackson 2.14.0-rc2
This commit upgrades Jackson to 2.14.0-rc2, and uses the new
ByteBufferFeeder in Jackson2Tokenizer.

Unfortunately, because of https://github.com/FasterXML/jackson-core/issues/478,
we had to change the CompilerConventions to suppress class file warnings.

Closes gh-29343
2022-10-19 11:05:40 +02: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
Phillip Webb 9d1e9703ae Include shadowed jar source in published source artifacts
Add a new `ShadowSource` Gradle task and update `spring-core.gradle`
to include source for cglib, javapoet and objenesis.

Closes gh-28892

Co-authored-by: Andy Wilkinson <wilkinsona@vmware.com>
2022-07-30 10:25:58 +01:00
Brian Clozel 10e4965f99 Guard against new Spring modules in ApiDiff task
Prior to this commit, the ApiDiff Gradle task would be configured for
all submodules of the Spring Framework project and would assume that
they all existed for the baseline version considered for the API diff.

This would cause issues when:
* the sub-project is not published as it's not an official "spring-*"
  module
* the "spring-*" module is new and did not exist for the baseline
  version

This commit ensures that only "spring-*" modules are considered for this
task and that we trigger an early resolution of the baseline version -
if the version doesn't exist, a warn message is logged and we assume
that this is a new module, to be compared with an empty configuration.

This commit also renames the "spring-core-graalvm" project to
"graalvm-feature", since this sub-project is not an official module
published to Maven Central, but rather an internal dependency.

Fixes gh-28818
2022-07-28 10:51:53 +02:00
Brian Clozel fc1408f827 Configure RuntimeHintsAgent in test suite
This commit configures the `RuntimeHintsAgent` in the Spring Framework
test suite.
Instead of applying the agent to the entire test suite, and possibly
interfering with other tests, this commit adds a new custom Gradle
plugin that does the following:

* create a new test task named `"runtimeHintsTest"`
* run this task with the runtime hints java agent
* only execute tests tagged with `"RuntimeHintsTests"`

See gh-27981
2022-06-30 18:20:25 +02:00
Brian Clozel 2d9c9fe9cc Configure Spring Milestone repository for apiDiff task
Prior to this commit, the `apiDiff` custom Gradle task would only use
the configured repositories in the build to generated the API diff
report. This causes issues when the report has to be generated against a
previous milestone: the Spring Framework build only relies on Maven
Central and a specific `libs-spring-framework-build` repository for
building the project. In this case, the task cannot resolve the previous
milestone artifacts to generate the report.

This commit improves the `ApiDiffPlugin` to automatically add the Spring
Milestone repository to the root project configuration when the task is
executed.

Fixes gh-27928
2022-01-13 12:24:39 +01:00
Brian Clozel f53bf8e9e1 Merge branch '5.3.x' 2021-09-15 14:44:39 +02:00
Brian Clozel 00eef79e5c Upgrade to JApicmp Gradle Plugin 0.3.0
Fixes gh-27414
2021-09-15 14:40:42 +02:00
Brian Clozel c0e479460e Switch CI pipeline to a JDK17 baseline
This commit introduces a new `spring-framework-6.0.x` CI pipeline with
JDK 17 baseline.

Note that Kotlin still uses a JDK11 baseline for now, this will be
addressed in gh-27413.

Closes gh-27409
2021-09-15 12:37:10 +02:00
Sébastien Deleuze 3f66ef7aee Compile with parameter names
Compiled code should contain parameter names to avoid the need
for class resources to be included in native image builds.

Closes gh-27369
2021-09-07 15:08:44 +02:00
Sam Brannen d7ea4d230f Remove Eclipse-specific code from OptionalDependenciesPlugin
To support the recent changes to our `optional` dependencies plugin,
this commit removes the Eclipse-specific code which no longer appears
to be necessary.

Closes gh-27365
2021-09-07 10:49:48 +02:00
Andy Wilkinson d23afea168 Extend optional rather than adding it to existing classpath
This allows the attributes configured on compileClasspath and
runtimeClasspath to independently influence the variant selection when
resolving the optional configuration, allowing it to contribute compile
dependencies (JAVA_API) to the former and runtime dependencies
(JAVA_RUNTIME) to the latter.

Fixes gh-27365
2021-09-06 19:18:16 +02:00
Andy Wilkinson 0ec4be37d5 Configure optional configuration to consume its dependencies' API
Previously, the optional configuration had no usage attribute. This
resulted in it using the default, JAVA_RUNTIME, which caused it to
only consume the runtime produced by its dependencies and not the
API. Given that the optional configuration is added to the compile
classpath, this was incorrect.

This commit updates the optional configuration to be configured to
consume the Java API of its dependencies. The configuration has
also been marked as not being for consumption. This prevents other
projects attempting to consume the optional variant of a project
that has the optional dependencies plugin applied and further
aligns it with Gradle's built-in configurations of a similar nature.

See gh-27365
2021-09-06 19:16:57 +02:00
Sam Brannen b2a17a8d86 Fix typo 2021-09-03 18:44:42 +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
Brian Clozel a20e561897 Upgrade to Gradle Enterprise 3.2
Also use the "io.spring.gradle-enterprise-conventions" plugin for
configuring Gradle Enterprise Cache support.
2020-04-29 10:54:03 +02:00
陈其苗 fac1b94623 Fix typo in buildSrc/README.md
See gh-24697
2020-03-14 10:06:25 +01:00
Brian Clozel 89560777e4 Upgrade Guava for API Diff plugin
Fixes gh-24606
2020-02-28 13:56:49 +01:00
Sam Brannen c640d28a82 Polishing 2020-02-07 11:30:23 +01:00
Sam Brannen 51fa98a1b2 Apply compiler conventions to test fixtures 2020-02-07 11:04:03 +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
Sam Brannen 7b6d83a106 Use Gradle test fixture support for spring-web
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 8a371c7669 Use Gradle test fixture support for spring-aop
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 5581f3b77b Use Gradle test fixture support for spring-tx
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 94f8ef08e2 Move common TestPrincipal to spring-core test fixtures
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 726b1bb1d0 Rename test fixture package in spring-context
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 0335db23c9 Use Gradle test fixture support for spring-context-support
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen 61d4ee594d Use Gradle test fixture support for spring-beans and spring-context
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen 5718bf424b Use Gradle test fixture support for spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen fd95646a04 Polish contribution
See gh-23869
2019-10-25 15:26:20 +02:00
Johnny Lim 46a31bc656 Extract build cache settings to a dedicated file
Closes gh-23869
2019-10-25 15:08:11 +02:00
Andy Wilkinson 3b0b173353 Enable local build cache for buildSrc and main project 2019-09-30 15:04:14 +02:00
Brian Clozel 72be38cf2c Fix API Diff Gradle task
Prior to this change, the Gradle API Diff task was failing due to a
missing class (a Guava class) during processing. This might be a
dependency that was previously brought by some other dependency.

This commit adds that dependency as a workaround, and improves the
Gradle API Diff task to only select relevant projects when running the
task (projects using the Java Plugin and the Maven Publish Plugin).
2019-09-23 17:13:49 +02:00
Brian Clozel 6008c61680 Use JApiCmp Gradle plugin for API diffs
This commit removes JDiff from the Spring Framework build and instead,
adds a Gradle plugin that configure JApiCmp tasks on the framework
modules.

Fixes gh-22942
See gh-23282
2019-08-19 10:21:55 +02:00
Sam Brannen ceaf6f46ac Remove test dependencies from spring-build-src
The spring-build-src module does not contain any tests. Thus, we do not
need any test dependencies.
2019-08-17 18:56:11 +02:00
Brian Clozel 2f61c89f09 Polish Gradle compile convention
See gh-23282
2019-08-16 08:25:52 +02:00
Brian Clozel 71ddb861bd Move compile config to a Gradle convention
This commit moves the compile configuration from the Gradle DSL to a
convention. This configuration is not changing often, and we're using
that opportunity to make the Java source compatibility a project
property so as to easily recent JDKs this on the command line.

See gh-23282
2019-08-15 13:31:06 +02:00
Brian Clozel 561af5f8f9 Replace propdeps plugin with custom plugin
Prior to this commit, the Spring Framework build would be using the
propdeps Gradle plugin to introduce two new configurations to the build:
"optional" and "provided". This would also configure related conventions
for IDEs, adding those configurations to published POMs.

This commit removes the need for this plugin and creates instead a
custom plugin for an "optional" configuration. While the Eclipse IDE
support is still supported, there is no need for specific conventions
for IntelliJ IDEA anymore.
This new plugin does not introduce the "provided" scope, as
"compileOnly" and "testCompileOnly" are here for that.

Also as of this commit, optional/provided dependencies are not published
with the Spring Framework modules POMs annymore.
Generally, these dependencies do not provide actionable information to
the developers reading / tools consuming the published POMs.

Optional/Provided dependencies are **not**:
* dependencies you can add to enable some supported feature
* dependencies versions that you can use to figure out CVEs or bugs
* dependencies that might be missing in existing Spring applications

In the context of Spring Framework, optional dependencies are just
libraries are Spring is compiling against for various technical reasons.
With that in mind, we are not publishing that information anymore.

See gh-23282
2019-08-13 18:19:37 +02:00
Brian Clozel 4e5c780b99 Move TestSourcesPlugin to a Java Gradle plugin
This commit moves the existing "test sources" Gradle plugin from Groovy
to Java and updates the "buildSrc" build file to prepare for additional
plugins in the Spring Framework build.

The plugin itself looks, for a given Spring Framework module, at all the
project dependencies for the following scopes: "compile", "testCompile",
"api", "implementation" and "optional" (to be supported by a different
plugin).

See gh-23282
2019-08-13 16:23:59 +02:00
Rob Winch 62ea7382d7 Polish URL Cleanup
Update Apache Headers
2019-03-22 00:24:06 -05:00
Juergen Hoeller 9190b76ab9 Latest dependency updates (POI 3.17, Rome 1.8, EhCache 3.4, Caffeine 2.5.6, RxJava 2.1.4, Tomcat 8.5.21, JRuby 9.1.13, Rhino 1.7.7.2) 2017-09-23 11:28:19 +02:00
Brian Clozel 2eeb428e95 Move modules to independent build files
The main `build.gradle` file contains now only the common build
infrastructure; all module-specific build configurations have
been moved to their own build file.

Issue: SPR-15885
2017-08-21 14:41:55 +02:00
Brian Clozel 41cbc4670f Refactor the spring-beans build
This commit merges back the "spring-beans-groovy" module into the main
"spring-beans" one. The build is configured so:

* Java and Groovy sources are jointly compiled
* Kotlin sources are compiled after

With this change, the `MergePlugin` is not used anymore in the project
build and therefore is removed.
The `DetectSplitPackagesPlugin` wasn't applied so it's been removed as
well.

Issue: SPR-15885
2017-08-21 14:41:46 +02:00
Rob Winch 09f16747b5 Fix MergePlugin transitive dependencies
A little terminiology first:

* merge.from - a project that contains source that will be merged
               into merge.into
* merge.into - a project that contains source code that will have
               code from merge.from merged into it.

Previously a module that dependended on merge.into would not see
the merge.from module as a transitive dependency. This worked fine
from a Gradle build because all the code from merge.from is merged
into the merge.into jar. However, in an IDE it did not work because
the IDE does not assemble a jar.

This fix ensures that merge.from modules are automatically added
to the classpath of any module relying on the merge.into project.

Fixes SPR-14650
2016-08-31 11:38:24 -05:00
Brian Clozel 58d8a81b16 Fix maven dependency scope conflicts in MergePlugin
Spring Framework's build is using a custom MergePlugin in order to merge
a project into another one and share/override configuration and
dependencies.

Prior to this commit, two projects merged into a third one could trigger
dependency conflicts when exporting the project definition into a POM.
When trying to define the scope for a given dependency, those two
projects would compete for this with the same priority, resulting in a
Gradle exception.

One could trigger this issue by running:

    ./gradlew :spring-orm:install -x javadoc

Because `spring-orm-hibernate4` and `spring-orm-hibernate5` get merged
into `spring-orm` and both define optional/test dependencies to
spring-mvc, etc.

This commit makes sure that two projects, when defining dependency
scopes, don't use the same priority value; the MergePlugin now adds the
index of the current subproject to the priority value. So when two
projects compete for this, the one defined in last will define the
dependency scope.

Issue: SPR-13013
2015-05-11 20:42:24 +02:00
Juergen Hoeller 8f484d382e Polishing 2014-07-29 11:42:37 +02:00
Juergen Hoeller 9d6c38bd54 Consistent bracket alignment 2014-07-18 17:21:58 +02:00