mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Compare commits
275 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a7df66374 | |||
| 63bff1f068 | |||
| e7d2ac4427 | |||
| ae1b36dc4f | |||
| 75a84b50e3 | |||
| 72013f975c | |||
| 3a6e7b8020 | |||
| 8a93309c22 | |||
| 50ed863279 | |||
| f9bb4b3b80 | |||
| 01f31027d7 | |||
| a52396b342 | |||
| d547570bcd | |||
| a9290d80c4 | |||
| 1f52f09089 | |||
| e9616b7204 | |||
| bbd5fc6f35 | |||
| a420e84591 | |||
| b1267b95b9 | |||
| a3161632dd | |||
| e731746bb0 | |||
| f2d7d663b4 | |||
| acd268e48f | |||
| 9d77afc218 | |||
| f3d0beb955 | |||
| 245c61e278 | |||
| c374389a59 | |||
| b720804c6d | |||
| 1e888706d3 | |||
| 1bca2c01fd | |||
| 0c45f179b3 | |||
| eb492ed583 | |||
| cd8d72e3f8 | |||
| 8cf61c595e | |||
| 8422da4d3f | |||
| b93d266c75 | |||
| 57bf64364f | |||
| ebbcc4d9fb | |||
| 27f0142d9e | |||
| 8135442336 | |||
| aa388bc094 | |||
| e5783b1bfa | |||
| 7f7fbe8172 | |||
| 42ab04a299 | |||
| 5ae706ee10 | |||
| f449b5a5b3 | |||
| bdc8d798e2 | |||
| 30ad07a4e2 | |||
| 0ed1a21073 | |||
| bad2b900e9 | |||
| 9a04191c2b | |||
| a7889c9df4 | |||
| 1cd7600d8a | |||
| 418c2a8641 | |||
| 377f3eecb4 | |||
| d1efd4c3a1 | |||
| aba4be83a7 | |||
| 5bc58773fb | |||
| 39fe8eebb1 | |||
| 778693f9f8 | |||
| aa3e0be1a0 | |||
| 28c7760c79 | |||
| cc11b811ea | |||
| 8abe1f055e | |||
| 12c4f8e7f9 | |||
| b9ff29ec7e | |||
| a551cbcf9d | |||
| c207882fdc | |||
| ab21bd4266 | |||
| 2ec41af799 | |||
| eb24365556 | |||
| 3a31efaf31 | |||
| 751c429897 | |||
| f19bc572da | |||
| 81348516ff | |||
| a00e00bd47 | |||
| b0fce78abf | |||
| 90fbeb1643 | |||
| 7384c3d82f | |||
| b016c8db91 | |||
| ceb8ce0a76 | |||
| d34c392c53 | |||
| 2b4e25b6f3 | |||
| 9929810610 | |||
| 4058f693e5 | |||
| 959ab7a5db | |||
| bed2134736 | |||
| dd68fecbf2 | |||
| 667438ddb0 | |||
| f4532ad704 | |||
| 0deacb9fa1 | |||
| 0ee12563b0 | |||
| e0b29b708c | |||
| 6c36240055 | |||
| a844712908 | |||
| 03c3dc3dae | |||
| 9caf672f21 | |||
| 9d78f17176 | |||
| 245d3114a8 | |||
| 4169898842 | |||
| e491d990de | |||
| 6d6eaf8506 | |||
| a6bcda25c2 | |||
| 7702fb8513 | |||
| b17d53ffae | |||
| 7f081a5eb4 | |||
| 983e2ce64f | |||
| ea49c8b840 | |||
| 2cfd15899d | |||
| d8dc4a257a | |||
| 00ed17dca0 | |||
| 410b9f933e | |||
| a0745c0c0a | |||
| cfdd50d8ab | |||
| e3136e65f4 | |||
| ced6bb4569 | |||
| 4525527794 | |||
| 98075c33c6 | |||
| 4cee691d09 | |||
| 347737290e | |||
| a94677e7b6 | |||
| ca386c13fc | |||
| f9eacf9c1f | |||
| 88906d271b | |||
| d8166d6155 | |||
| 4fccd1799a | |||
| 9187eeff27 | |||
| 2ab55414e5 | |||
| c90e2c6f10 | |||
| 506e9f50d0 | |||
| 2564db2bfd | |||
| 13edc93f78 | |||
| 1d26c37b87 | |||
| ee8e178434 | |||
| 679e122326 | |||
| 7c1a2f37f2 | |||
| 5e318e73f8 | |||
| 682b0f2c63 | |||
| ad81ec922b | |||
| 9862fbfc01 | |||
| d7825586dc | |||
| 9338080916 | |||
| fd10e149f6 | |||
| 1dd01a7a82 | |||
| 3788635f51 | |||
| 86ef22db49 | |||
| b2fce2f254 | |||
| be2c2e9a86 | |||
| 0047200b98 | |||
| 1641e082eb | |||
| baeac9ea6b | |||
| bac05f568a | |||
| cb7d689f92 | |||
| da8e2d6736 | |||
| 6ed589d94b | |||
| e70119733a | |||
| 0824746255 | |||
| 30d0bd309c | |||
| ec2603de63 | |||
| 470c85ade0 | |||
| 01d8d64200 | |||
| 2c8b7fe093 | |||
| bbfc807b0c | |||
| c81543e1a4 | |||
| 437ce9bb0e | |||
| b79260a017 | |||
| 0f522cfe6a | |||
| da75eaedbf | |||
| 69f2496cd7 | |||
| e670975fde | |||
| 41d9d737ac | |||
| c25cbe5522 | |||
| 8c64b47473 | |||
| 229537288a | |||
| bec5463640 | |||
| 7ebfd9e6a8 | |||
| f9147d375f | |||
| 03dd7a57f0 | |||
| 43bc3f19d9 | |||
| 0cf4a2626b | |||
| a0d0b37d10 | |||
| 5a149e4600 | |||
| 25a806a54e | |||
| 33463a94e3 | |||
| a6f5d9eb93 | |||
| f11ef28a4d | |||
| 52c10c52cd | |||
| cb13353c1d | |||
| 8b09b52720 | |||
| d7fd70fa08 | |||
| fbe955ab28 | |||
| 26ee0c4842 | |||
| 19718700cf | |||
| 8599dfd74e | |||
| a3bfa754fd | |||
| 8e3a0070dc | |||
| f9cf5d1aa6 | |||
| f78bef906d | |||
| 7704d76144 | |||
| 3f48c71c77 | |||
| 576f6fd25c | |||
| 5204e11d9c | |||
| 30166981e2 | |||
| 617f0ef542 | |||
| dc400c7124 | |||
| a7e2297432 | |||
| 671f97721f | |||
| 49f728eae8 | |||
| 16da15eca1 | |||
| efabc6bf18 | |||
| 98b281ea45 | |||
| 00a69394e6 | |||
| 45f1438ef8 | |||
| e7b44e015a | |||
| 23fe1e2934 | |||
| 1f64b147b1 | |||
| 5e4f3b3108 | |||
| c87989477d | |||
| 3b4210fa6f | |||
| 79b86a7e3a | |||
| b488ae6009 | |||
| aeef8c87f6 | |||
| 556c6a79c5 | |||
| 0281158fcc | |||
| 100fa178dd | |||
| a387d13d5f | |||
| 841d9533db | |||
| 0d18deb6a4 | |||
| 42204e5098 | |||
| eed090e5f5 | |||
| 0320cc582b | |||
| a76c7ca299 | |||
| 8bab873107 | |||
| e8006bdf78 | |||
| 3f387eb9cf | |||
| 0769d53a6a | |||
| 6263c9abf9 | |||
| 1eb50297ad | |||
| 20f87ab98d | |||
| c25a1bcb60 | |||
| e8deba2915 | |||
| fa33c4b857 | |||
| 24c30eac49 | |||
| 1af7575bde | |||
| 8143d66e4c | |||
| 9e370208d0 | |||
| e66bc07c37 | |||
| c9a2dbdbfd | |||
| 2fa0e63e5a | |||
| 83ac44d1e4 | |||
| 0cf93711b9 | |||
| 8faa2e61ec | |||
| 71443efd90 | |||
| bc243b5aa7 | |||
| d36979bc80 | |||
| 5875695d99 | |||
| dcb44264ad | |||
| 9fcb578187 | |||
| 8cdfbfe864 | |||
| 9ca407d55e | |||
| 1380d053c4 | |||
| 6b76afd1ce | |||
| 2fe74a4ef0 | |||
| ee9b9d6a57 | |||
| bf8fa6e268 | |||
| c976fa329f | |||
| d22c8aca49 | |||
| 79d9f7a5f7 | |||
| 9d3cfcd8e6 | |||
| 7d72ab59ae | |||
| 40a6769309 | |||
| e30d6104f3 | |||
| 129b4b3136 | |||
| b32a365f14 | |||
| 79c9ca1a26 |
@@ -1,10 +0,0 @@
|
||||
root = true
|
||||
|
||||
[*.{adoc,bat,groovy,html,java,js,jsp,kt,kts,md,properties,py,rb,sh,sql,svg,txt,xml,xsd}]
|
||||
charset = utf-8
|
||||
|
||||
[*.{groovy,java,kt,kts,xml,xsd}]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
continuation_indent_size = 8
|
||||
end_of_line = lf
|
||||
@@ -1,16 +0,0 @@
|
||||
# Normalize line endings to LF.
|
||||
* text eol=lf
|
||||
|
||||
# Ensure that line endings for multipart files in spring-web are not modified.
|
||||
*.multipart -text
|
||||
|
||||
# Ensure that line endings for DOS batch files are not modified.
|
||||
*.bat -text
|
||||
|
||||
# Ensure the following are treated as binary.
|
||||
*.gif binary
|
||||
*.jar binary
|
||||
*.jpeg binary
|
||||
*.jpg binary
|
||||
*.png binary
|
||||
*.vsd binary
|
||||
@@ -1,17 +0,0 @@
|
||||
<!--
|
||||
!!! For Security Vulnerabilities, please go to https://spring.io/security-policy !!!
|
||||
-->
|
||||
**Affects:** \<Spring Framework version>
|
||||
|
||||
---
|
||||
<!--
|
||||
Thanks for taking the time to create an issue. Please read the following:
|
||||
|
||||
- Questions should be asked on Stack Overflow.
|
||||
- For bugs, specify affected versions and explain what you are trying to do.
|
||||
- For enhancements, provide context and describe the problem.
|
||||
|
||||
Issue or Pull Request? Create only one, not both. GitHub treats them as the same.
|
||||
If unsure, start with an issue, and if you submit a pull request later, the
|
||||
issue will be closed as superseded.
|
||||
-->
|
||||
@@ -1,33 +0,0 @@
|
||||
name: Send notification
|
||||
description: Sends a Google Chat message as a notification of the job's outcome
|
||||
inputs:
|
||||
webhook-url:
|
||||
description: 'Google Chat Webhook URL'
|
||||
required: true
|
||||
status:
|
||||
description: 'Status of the job'
|
||||
required: true
|
||||
build-scan-url:
|
||||
description: 'URL of the build scan to include in the notification'
|
||||
run-name:
|
||||
description: 'Name of the run to include in the notification'
|
||||
default: ${{ format('{0} {1}', github.ref_name, github.job) }}
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- shell: bash
|
||||
run: |
|
||||
echo "BUILD_SCAN=${{ inputs.build-scan-url == '' && ' [build scan unavailable]' || format(' [<{0}|Build Scan>]', inputs.build-scan-url) }}" >> "$GITHUB_ENV"
|
||||
echo "RUN_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> "$GITHUB_ENV"
|
||||
- shell: bash
|
||||
if: ${{ inputs.status == 'success' }}
|
||||
run: |
|
||||
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was successful ${{ env.BUILD_SCAN }}"}' || true
|
||||
- shell: bash
|
||||
if: ${{ inputs.status == 'failure' }}
|
||||
run: |
|
||||
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<users/all> *<${{ env.RUN_URL }}|${{ inputs.run-name }}> failed* ${{ env.BUILD_SCAN }}"}' || true
|
||||
- shell: bash
|
||||
if: ${{ inputs.status == 'cancelled' }}
|
||||
run: |
|
||||
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancelled"}' || true
|
||||
@@ -1,34 +0,0 @@
|
||||
name: Backport Bot
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled]
|
||||
pull_request:
|
||||
types: [labeled]
|
||||
push:
|
||||
branches:
|
||||
- '*.x'
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
build:
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'liberica'
|
||||
java-version: 17
|
||||
- name: Download BackportBot
|
||||
run: wget https://github.com/spring-io/backport-bot/releases/download/latest/backport-bot-0.0.1-SNAPSHOT.jar
|
||||
- name: Backport
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_EVENT: ${{ toJSON(github.event) }}
|
||||
run: java -jar backport-bot-0.0.1-SNAPSHOT.jar --github.accessToken="$GITHUB_TOKEN" --github.event_name "$GITHUB_EVENT_NAME" --github.event "$GITHUB_EVENT"
|
||||
@@ -1,63 +0,0 @@
|
||||
name: Build and deploy snapshot
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 5.3.x
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
jobs:
|
||||
build-and-deploy-snapshot:
|
||||
if: ${{ github.repository == 'spring-projects/spring-framework' }}
|
||||
name: Build and deploy snapshot
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'liberica'
|
||||
java-version: 8
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
|
||||
with:
|
||||
cache-read-only: false
|
||||
- name: Configure Gradle properties
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p $HOME/.gradle
|
||||
echo 'systemProp.user.name=spring-builds+github' >> $HOME/.gradle/gradle.properties
|
||||
echo 'systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false' >> $HOME/.gradle/gradle.properties
|
||||
echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties
|
||||
echo 'org.gradle.daemon=4' >> $HOME/.gradle/gradle.properties
|
||||
- name: Build and publish
|
||||
id: build
|
||||
env:
|
||||
CI: 'true'
|
||||
GRADLE_ENTERPRISE_URL: 'https://ge.spring.io'
|
||||
DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
|
||||
run: ./gradlew -PdeploymentRepository=$(pwd)/deployment-repository build publishAllPublicationsToDeploymentRepository
|
||||
- name: Deploy
|
||||
uses: spring-io/artifactory-deploy-action@v0.0.1
|
||||
with:
|
||||
uri: 'https://repo.spring.io'
|
||||
username: ${{ secrets.ARTIFACTORY_USERNAME }}
|
||||
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
||||
build-name: ${{ format('spring-framework-{0}', github.ref_name)}}
|
||||
repository: 'libs-snapshot-local'
|
||||
folder: 'deployment-repository'
|
||||
signing-key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
signing-passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||
artifact-properties: |
|
||||
/**/spring-*.zip::zip.name=spring-framework,zip.deployed=false
|
||||
/**/spring-*-docs.zip::zip.type=docs
|
||||
/**/spring-*-dist.zip::zip.type=dist
|
||||
/**/spring-*-schema.zip::zip.type=schema
|
||||
- name: Send notification
|
||||
uses: ./.github/actions/send-notification
|
||||
if: always()
|
||||
with:
|
||||
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
|
||||
status: ${{ job.status }}
|
||||
build-scan-url: ${{ steps.build.outputs.build-scan-url }}
|
||||
run-name: ${{ format('{0} | Linux | Java 8', github.ref_name) }}
|
||||
@@ -1,80 +0,0 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 5.3.x
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
jobs:
|
||||
ci:
|
||||
if: ${{ github.repository == 'spring-projects/spring-framework' }}
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- id: ubuntu-latest
|
||||
name: Linux
|
||||
java:
|
||||
- version: 8
|
||||
toolchain: false
|
||||
- version: 17
|
||||
toolchain: true
|
||||
- version: 21
|
||||
toolchain: true
|
||||
exclude:
|
||||
- os:
|
||||
name: Linux
|
||||
java:
|
||||
version: 8
|
||||
name: '${{ matrix.os.name}} | Java ${{ matrix.java.version}}'
|
||||
runs-on: ${{ matrix.os.id }}
|
||||
steps:
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'liberica'
|
||||
java-version: |
|
||||
${{ matrix.java.version }}
|
||||
${{ matrix.java.toolchain && '8' || '' }}
|
||||
- name: Prepare Windows runner
|
||||
if: ${{ runner.os == 'Windows' }}
|
||||
run: |
|
||||
git config --global core.autocrlf true
|
||||
git config --global core.longPaths true
|
||||
Stop-Service -name Docker
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Gradle
|
||||
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
|
||||
with:
|
||||
cache-read-only: false
|
||||
- name: Configure Gradle properties
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p $HOME/.gradle
|
||||
echo 'systemProp.user.name=spring-builds+github' >> $HOME/.gradle/gradle.properties
|
||||
echo 'systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false' >> $HOME/.gradle/gradle.properties
|
||||
echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties
|
||||
echo 'org.gradle.daemon=4' >> $HOME/.gradle/gradle.properties
|
||||
- name: Configure toolchain properties
|
||||
if: ${{ matrix.java.toolchain }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo toolchainVersion=${{ matrix.java.version }} >> $HOME/.gradle/gradle.properties
|
||||
echo systemProp.org.gradle.java.installations.auto-detect=false >> $HOME/.gradle/gradle.properties
|
||||
echo systemProp.org.gradle.java.installations.auto-download=false >> $HOME/.gradle/gradle.properties
|
||||
echo systemProp.org.gradle.java.installations.paths=${{ format('$JAVA_HOME_{0}_X64', matrix.java.version) }} >> $HOME/.gradle/gradle.properties
|
||||
- name: Build
|
||||
id: build
|
||||
env:
|
||||
CI: 'true'
|
||||
GRADLE_ENTERPRISE_URL: 'https://ge.spring.io'
|
||||
DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
|
||||
run: ./gradlew check
|
||||
- name: Send notification
|
||||
uses: ./.github/actions/send-notification
|
||||
if: always()
|
||||
with:
|
||||
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
|
||||
status: ${{ job.status }}
|
||||
build-scan-url: ${{ steps.build.outputs.build-scan-url }}
|
||||
run-name: ${{ format('{0} | {1} | Java {2}', github.ref_name, matrix.os.name, matrix.java.version) }}
|
||||
@@ -1,13 +0,0 @@
|
||||
name: "Validate Gradle Wrapper"
|
||||
on: [push, pull_request]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
validation:
|
||||
name: "Validation"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: gradle/wrapper-validation-action@v2
|
||||
+12
-37
@@ -10,42 +10,17 @@ integration-repo
|
||||
ivy-cache
|
||||
jxl.log
|
||||
jmx.log
|
||||
derby.log
|
||||
spring-test/test-output/
|
||||
.gradle
|
||||
argfile*
|
||||
pom.xml
|
||||
activemq-data/
|
||||
org.springframework.jdbc/derby.log
|
||||
org.springframework.spring-parent/.classpath
|
||||
org.springframework.spring-parent/.project
|
||||
org.springframework.test/test-output/
|
||||
target
|
||||
spring-build/lib/docbook
|
||||
|
||||
classes/
|
||||
# ignore files and directories related to gradle build
|
||||
/.classpath
|
||||
/.project
|
||||
/.gradle
|
||||
/build
|
||||
buildSrc/build
|
||||
/spring-*/build
|
||||
/spring-core/graalvm/build
|
||||
/spring-core/kotlin-coroutines/build
|
||||
/framework-bom/build
|
||||
/framework-docs/build
|
||||
/integration-tests/build
|
||||
/src/asciidoc/build
|
||||
target/
|
||||
/target/
|
||||
|
||||
# Eclipse artifacts, including WTP generated manifests
|
||||
.classpath
|
||||
.project
|
||||
spring-*/src/main/java/META-INF/MANIFEST.MF
|
||||
|
||||
# IDEA artifacts and output dirs
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea
|
||||
out
|
||||
test-output
|
||||
atlassian-ide-plugin.xml
|
||||
.gradletasknamecache
|
||||
|
||||
# VS Code
|
||||
.vscode/
|
||||
|
||||
cached-antora-playbook.yml
|
||||
/spring-*
|
||||
!/spring-framework-reference
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
Juergen Hoeller <jhoeller@vmware.com>
|
||||
Juergen Hoeller <jhoeller@vmware.com> <jhoeller@pivotal.io>
|
||||
Juergen Hoeller <jhoeller@vmware.com> <jhoeller@gopivotal.com>
|
||||
Rossen Stoyanchev <rstoyanchev@vmware.com>
|
||||
Rossen Stoyanchev <rstoyanchev@vmware.com> <rstoyanchev@pivotal.io>
|
||||
Rossen Stoyanchev <rstoyanchev@vmware.com> <rstoyanchev@gopivotal.com>
|
||||
Phillip Webb <pwebb@vmware.com>
|
||||
Phillip Webb <pwebb@vmware.com> <pwebb@pivotal.io>
|
||||
Phillip Webb <pwebb@vmware.com> <pwebb@gopivotal.com>
|
||||
Chris Beams <cbeams@vmware.com>
|
||||
Chris Beams <cbeams@vmware.com> <cbeams@pivotal.io>
|
||||
Chris Beams <cbeams@vmware.com> <cbeams@gopivotal.com>
|
||||
Arjen Poutsma <apoutsma@vmware.com>
|
||||
Arjen Poutsma <apoutsma@vmware.com> <apoutsma@pivotal.io>
|
||||
Arjen Poutsma <apoutsma@vmware.com> <apoutsma@gopivotal.com>
|
||||
Arjen Poutsma <apoutsma@vmware.com> <poutsma@mac.com>
|
||||
Oliver Drotbohm <odrotbohm@vmware.com>
|
||||
Oliver Drotbohm <odrotbohm@vmware.com> <ogierke@vmware.com>
|
||||
Oliver Drotbohm <odrotbohm@vmware.com> <ogierke@pivotal.io>
|
||||
Oliver Drotbohm <odrotbohm@vmware.com> <ogierke@gopivotal.com>
|
||||
Dave Syer <dsyer@vmware.com>
|
||||
Dave Syer <dsyer@vmware.com> <dsyer@pivotal.io>
|
||||
Dave Syer <dsyer@vmware.com> <dsyer@gopivotal.com>
|
||||
Dave Syer <dsyer@vmware.com> <david_syer@hotmail.com>
|
||||
Andy Clement <aclement@vmware.com>
|
||||
Andy Clement <aclement@vmware.com> <aclement@pivotal.io>
|
||||
Andy Clement <aclement@vmware.com> <aclement@gopivotal.com>
|
||||
Andy Clement <aclement@vmware.com> <andrew.clement@gmail.com>
|
||||
Sam Brannen <sbrannen@vmware.com>
|
||||
Sam Brannen <sbrannen@vmware.com> <sbrannen@pivotal.io>
|
||||
Sam Brannen <sbrannen@vmware.com> <sam@sambrannen.com>
|
||||
<dmitry.katsubo@gmail.com> <dmitry.katsubo@gmai.com>
|
||||
Nick Williams <nicholas@nicholaswilliams.net>
|
||||
@@ -1,3 +0,0 @@
|
||||
# Enable auto-env through the sdkman_auto_env config
|
||||
# Add key=value pairs of SDKs to use below
|
||||
java=8.0.382-librca
|
||||
@@ -1,44 +0,0 @@
|
||||
= Contributor Code of Conduct
|
||||
|
||||
As contributors and maintainers of this project, and in the interest of fostering an open
|
||||
and welcoming community, we pledge to respect all people who contribute through reporting
|
||||
issues, posting feature requests, updating documentation, submitting pull requests or
|
||||
patches, and other activities.
|
||||
|
||||
We are committed to making participation in this project a harassment-free experience for
|
||||
everyone, regardless of level of experience, gender, gender identity and expression,
|
||||
sexual orientation, disability, personal appearance, body size, race, ethnicity, age,
|
||||
religion, or nationality.
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery
|
||||
* Personal attacks
|
||||
* Trolling or insulting/derogatory comments
|
||||
* Public or private harassment
|
||||
* Publishing other's private information, such as physical or electronic addresses,
|
||||
without explicit permission
|
||||
* Other unethical or unprofessional conduct
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments,
|
||||
commits, code, wiki edits, issues, and other contributions that are not aligned to this
|
||||
Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors
|
||||
that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
By adopting this Code of Conduct, project maintainers commit themselves to fairly and
|
||||
consistently applying these principles to every aspect of managing this project. Project
|
||||
maintainers who do not follow or enforce the Code of Conduct may be permanently removed
|
||||
from the project team.
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an
|
||||
individual is representing the project or its community.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
|
||||
contacting a project maintainer at spring-code-of-conduct@pivotal.io . All complaints will
|
||||
be reviewed and investigated and will result in a response that is deemed necessary and
|
||||
appropriate to the circumstances. Maintainers are obligated to maintain confidentiality
|
||||
with regard to the reporter of an incident.
|
||||
|
||||
This Code of Conduct is adapted from the
|
||||
https://contributor-covenant.org[Contributor Covenant], version 1.3.0, available at
|
||||
https://contributor-covenant.org/version/1/3/0/[contributor-covenant.org/version/1/3/0/]
|
||||
-131
@@ -1,131 +0,0 @@
|
||||
# Contributing to the Spring Framework
|
||||
|
||||
First off, thank you for taking the time to contribute! :+1: :tada:
|
||||
|
||||
### Table of Contents
|
||||
|
||||
* [Code of Conduct](#code-of-conduct)
|
||||
* [How to Contribute](#how-to-contribute)
|
||||
* [Discuss](#discuss)
|
||||
* [Create an Issue](#create-an-issue)
|
||||
* [Issue Lifecycle](#issue-lifecycle)
|
||||
* [Submit a Pull Request](#submit-a-pull-request)
|
||||
* [Build from Source](#build-from-source)
|
||||
* [Source Code Style](#source-code-style)
|
||||
* [Reference Docs](#reference-docs)
|
||||
|
||||
### Code of Conduct
|
||||
|
||||
This project is governed by the [Spring Code of Conduct](CODE_OF_CONDUCT.adoc).
|
||||
By participating you are expected to uphold this code.
|
||||
Please report unacceptable behavior to spring-code-of-conduct@pivotal.io.
|
||||
|
||||
### How to Contribute
|
||||
|
||||
#### Discuss
|
||||
|
||||
If you have a question, check Stack Overflow using
|
||||
[this list of tags](https://stackoverflow.com/questions/tagged/spring+or+spring-mvc+or+spring-aop+or+spring-jdbc+or+spring-transactions+or+spring-annotations+or+spring-jms+or+spring-el+or+spring-test+or+spring+or+spring-remoting+or+spring-orm+or+spring-jmx+or+spring-cache+or+spring-webflux?tab=Newest).
|
||||
Find an existing discussion, or start a new one if necessary.
|
||||
|
||||
If you believe there is an issue, search through
|
||||
[existing issues](https://github.com/spring-projects/spring-framework/issues) trying a
|
||||
few different ways to find discussions, past or current, that are related to the issue.
|
||||
Reading those discussions helps you to learn about the issue, and helps us to make a
|
||||
decision.
|
||||
|
||||
|
||||
#### Create an Issue
|
||||
|
||||
Reporting an issue or making a feature request is a great way to contribute. Your feedback
|
||||
and the conversations that result from it provide a continuous flow of ideas. However,
|
||||
before creating a ticket, please take the time to [discuss and research](#discuss) first.
|
||||
|
||||
If creating an issue after a discussion on Stack Overflow, please provide a description
|
||||
in the issue instead of simply referring to Stack Overflow. The issue tracker is an
|
||||
important place of record for design discussions and should be self-sufficient.
|
||||
|
||||
Once you're ready, create an issue on
|
||||
[GitHub](https://github.com/spring-projects/spring-framework/issues).
|
||||
|
||||
#### Issue Lifecycle
|
||||
|
||||
When an issue is first created, it is flagged `waiting-for-triage` waiting for a team
|
||||
member to triage it. Once the issue has been reviewed, the team may ask for further
|
||||
information if needed, and based on the findings, the issue is either assigned a target
|
||||
milestone or is closed with a specific status.
|
||||
|
||||
When a fix is ready, the issue is closed and may still be re-opened until the fix is
|
||||
released. After that the issue will typically no longer be reopened. In rare cases if the
|
||||
issue was not at all fixed, the issue may be re-opened. In most cases however any
|
||||
follow-up reports will need to be created as new issues with a fresh description.
|
||||
|
||||
#### Submit a Pull Request
|
||||
|
||||
1. If you have not previously done so, please sign the
|
||||
[Contributor License Agreement](https://cla.pivotal.io/sign/spring). You will be reminded
|
||||
automatically when you submit the PR.
|
||||
|
||||
1. Should you create an issue first? No, just create the pull request and use the
|
||||
description to provide context and motivation, as you would for an issue. If you want
|
||||
to start a discussion first or have already created an issue, once a pull request is
|
||||
created, we will close the issue as superseded by the pull request, and the discussion
|
||||
about the issue will continue under the pull request.
|
||||
|
||||
1. Always check out the `main` branch and submit pull requests against it
|
||||
(for target version see [settings.gradle](settings.gradle)).
|
||||
Backports to prior versions will be considered on a case-by-case basis and reflected as
|
||||
the fix version in the issue tracker.
|
||||
|
||||
1. Choose the granularity of your commits consciously and squash commits that represent
|
||||
multiple edits or corrections of the same logical change. See
|
||||
[Rewriting History section of Pro Git](https://git-scm.com/book/en/Git-Tools-Rewriting-History)
|
||||
for an overview of streamlining the commit history.
|
||||
|
||||
1. Format commit messages using 55 characters for the subject line, 72 characters per line
|
||||
for the description, followed by the issue fixed, e.g. `Closes gh-22276`. See the
|
||||
[Commit Guidelines section of Pro Git](https://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines)
|
||||
for best practices around commit messages, and use `git log` to see some examples.
|
||||
|
||||
1. If there is a prior issue, reference the GitHub issue number in the description of the
|
||||
pull request.
|
||||
|
||||
If accepted, your contribution may be heavily modified as needed prior to merging.
|
||||
You will likely retain author attribution for your Git commits granted that the bulk of
|
||||
your changes remain intact. You may also be asked to rework the submission.
|
||||
|
||||
If asked to make corrections, simply push the changes against the same branch, and your
|
||||
pull request will be updated. In other words, you do not need to create a new pull request
|
||||
when asked to make changes.
|
||||
|
||||
#### Participate in Reviews
|
||||
|
||||
Helping to review pull requests is another great way to contribute. Your feedback
|
||||
can help to shape the implementation of new features. When reviewing pull requests,
|
||||
however, please refrain from approving or rejecting a PR unless you are a core
|
||||
committer for the Spring Framework.
|
||||
|
||||
### Build from Source
|
||||
|
||||
See the [Build from Source](https://github.com/spring-projects/spring-framework/wiki/Build-from-Source)
|
||||
wiki page for instructions on how to check out, build, and import the Spring Framework
|
||||
source code into your IDE.
|
||||
|
||||
### Source Code Style
|
||||
|
||||
The wiki pages
|
||||
[Code Style](https://github.com/spring-projects/spring-framework/wiki/Code-Style) and
|
||||
[IntelliJ IDEA Editor Settings](https://github.com/spring-projects/spring-framework/wiki/IntelliJ-IDEA-Editor-Settings)
|
||||
define the source file coding standards we use along with some IDEA editor settings we customize.
|
||||
|
||||
### Reference Docs
|
||||
|
||||
The reference documentation is in the [src/docs/asciidoc](src/docs/asciidoc) directory, in
|
||||
[Asciidoctor](https://asciidoctor.org/) format. For trivial changes, you may be able to browse,
|
||||
edit source files, and submit directly from GitHub.
|
||||
|
||||
When making changes locally, execute `./gradlew asciidoctor` and then browse the result under
|
||||
`build/docs/ref-docs/html5/index.html`.
|
||||
|
||||
Asciidoctor also supports live editing. For more details see
|
||||
[AsciiDoc Tooling](https://docs.asciidoctor.org/asciidoctor/latest/tooling/).
|
||||
-202
@@ -1,202 +0,0 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
https://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -1,38 +1,59 @@
|
||||
# <img src="framework-docs/src/docs/spring-framework.png" width="80" height="80"> Spring Framework [](https://github.com/spring-projects/spring-framework/actions/workflows/build-and-deploy-snapshot.yml?query=branch%3A5.3.x) [](https://ge.spring.io/scans?search.rootProjectNames=spring)
|
||||
## Spring Framework
|
||||
The Spring Framework provides a comprehensive programming and configuration model for modern
|
||||
Java-based enterprise applications - on any kind of deployment platform. A key element of Spring is
|
||||
infrastructural support at the application level: Spring focuses on the "plumbing" of enterprise
|
||||
applications so that teams can focus on application-level business logic, without unnecessary ties
|
||||
to specific deployment environments.
|
||||
|
||||
This is the home of the Spring Framework: the foundation for all [Spring projects](https://spring.io/projects). Collectively the Spring Framework and the family of Spring projects are often referred to simply as "Spring".
|
||||
The framework also serves as the foundation for
|
||||
[Spring Integration](https://github.com/SpringSource/spring-integration),
|
||||
[Spring Batch](https://github.com/SpringSource/spring-batch) and the rest of the Spring
|
||||
[family of projects](http://springsource.org/projects). Browse the repositories under the
|
||||
[SpringSource organization](https://github.com/SpringSource) on GitHub for a full list.
|
||||
|
||||
Spring provides everything required beyond the Java programming language for creating enterprise applications for a wide range of scenarios and architectures. Please read the [Overview](https://docs.spring.io/spring/docs/current/spring-framework-reference/overview.html#spring-introduction) section as reference for a more complete introduction.
|
||||
[.NET](https://github.com/SpringSource/spring-net) and
|
||||
[Python](https://github.com/SpringSource/spring-python) variants are available as well.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
This project is governed by the [Spring Code of Conduct](CODE_OF_CONDUCT.adoc). By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to spring-code-of-conduct@pivotal.io.
|
||||
|
||||
## Access to Binaries
|
||||
|
||||
For access to artifacts or a distribution zip, see the [Spring Framework Artifacts](https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Artifacts) wiki page.
|
||||
## Downloading artifacts
|
||||
Instructions on
|
||||
[downloading Spring artifacts](https://github.com/SpringSource/spring-framework/wiki/Downloading-Spring-artifacts)
|
||||
via Maven and other build systems are available via the project wiki.
|
||||
|
||||
## Documentation
|
||||
See the current [Javadoc](http://static.springsource.org/spring-framework/docs/current/api)
|
||||
and [Reference docs](http://static.springsource.org/spring-framework/docs/current/reference).
|
||||
|
||||
The Spring Framework maintains reference documentation ([published](https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/) and [source](src/docs/asciidoc)), GitHub [wiki pages](https://github.com/spring-projects/spring-framework/wiki), and an
|
||||
[API reference](https://docs.spring.io/spring-framework/docs/current/javadoc-api/). There are also [guides and tutorials](https://spring.io/guides) across Spring projects.
|
||||
## Getting support
|
||||
Check out the [Spring forums](http://forum.springsource.org) and the
|
||||
[Spring tag](http://stackoverflow.com/questions/tagged/spring) on StackOverflow.
|
||||
[Commercial support](http://springsource.com/support/springsupport) is available too.
|
||||
|
||||
## Micro-Benchmarks
|
||||
## Issue Tracking
|
||||
Spring's JIRA issue tracker can be found [here](http://jira.springsource.org/browse/SPR). Think
|
||||
you've found a bug? Please consider submitting a reproduction project via the
|
||||
[spring-framework-issues](https://github.com/springsource/spring-framework-issues) repository. The
|
||||
[readme](https://github.com/springsource/spring-framework-issues#readme) provides simple
|
||||
step-by-step instructions.
|
||||
|
||||
See the [Micro-Benchmarks](https://github.com/spring-projects/spring-framework/wiki/Micro-Benchmarks) wiki page.
|
||||
## Building from source
|
||||
Instructions on
|
||||
[building Spring from source](https://github.com/SpringSource/spring-framework/wiki/Building-from-source)
|
||||
are available via the project wiki.
|
||||
|
||||
## Build from Source
|
||||
## Contributing
|
||||
[Pull requests](http://help.github.com/send-pull-requests) are welcome; you'll be asked to sign our
|
||||
contributor license agreement ([CLA](https://support.springsource.com/spring_committer_signup)).
|
||||
Trivial changes like typo fixes are especially appreciated (just
|
||||
[fork and edit!](https://github.com/blog/844-forking-with-the-edit-button)). For larger changes,
|
||||
please search through JIRA for similiar issues, creating a new one if necessary, and discuss your
|
||||
ideas with the Spring team.
|
||||
|
||||
See the [Build from Source](https://github.com/spring-projects/spring-framework/wiki/Build-from-Source) wiki page and the [CONTRIBUTING.md](CONTRIBUTING.md) file.
|
||||
|
||||
## Continuous Integration Builds
|
||||
|
||||
Information regarding CI builds can be found in the [Spring Framework Concourse pipeline](ci/README.adoc) documentation.
|
||||
|
||||
## Stay in Touch
|
||||
|
||||
Follow [@SpringCentral](https://twitter.com/springcentral), [@SpringFramework](https://twitter.com/springframework), and its [team members](https://twitter.com/springframework/lists/team/members) on Twitter. In-depth articles can be found at [The Spring Blog](https://spring.io/blog/), and releases are announced via our [news feed](https://spring.io/blog/category/news).
|
||||
## Staying in touch
|
||||
Follow [@springframework](http://twitter.com/springframework) and its
|
||||
[team members](http://twitter.com/springframework/team/members) on Twitter. In-depth articles can be
|
||||
found at the SpringSource [team blog](http://blog.springsource.org), and releases are announced via
|
||||
our [news feed](http://www.springsource.org/news-events).
|
||||
|
||||
## License
|
||||
|
||||
The Spring Framework is released under version 2.0 of the [Apache License](https://www.apache.org/licenses/LICENSE-2.0).
|
||||
The Spring Framework is released under version 2.0 of the
|
||||
[Apache License](http://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Please see the
|
||||
[Spring Framework Versions](https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Versions)
|
||||
wiki page.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please see https://spring.io/security-policy.
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module relativePaths="true" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="build-spring-framework" default="precommit">
|
||||
|
||||
<path id="unit.test.bundles">
|
||||
<pathelement location="../org.springframework.instrument"/>
|
||||
<pathelement location="../org.springframework.instrument.tomcat"/>
|
||||
<pathelement location="../org.springframework.core"/>
|
||||
<pathelement location="../org.springframework.expression"/>
|
||||
<pathelement location="../org.springframework.beans"/>
|
||||
<pathelement location="../org.springframework.aop"/>
|
||||
<pathelement location="../org.springframework.context"/>
|
||||
<pathelement location="../org.springframework.transaction"/>
|
||||
<pathelement location="../org.springframework.oxm"/>
|
||||
<pathelement location="../org.springframework.jms"/>
|
||||
<pathelement location="../org.springframework.jdbc"/>
|
||||
<pathelement location="../org.springframework.web"/>
|
||||
<pathelement location="../org.springframework.orm"/>
|
||||
<pathelement location="../org.springframework.context.support"/>
|
||||
<pathelement location="../org.springframework.aspects"/>
|
||||
<pathelement location="../org.springframework.web.servlet"/>
|
||||
<pathelement location="../org.springframework.web.portlet"/>
|
||||
<pathelement location="../org.springframework.test"/>
|
||||
<pathelement location="../org.springframework.web.struts"/>
|
||||
</path>
|
||||
|
||||
<path id="bundles">
|
||||
<pathelement location="../org.springframework.spring-parent"/>
|
||||
<pathelement location="../org.springframework.asm"/>
|
||||
<path refid="unit.test.bundles" />
|
||||
<pathelement location="../org.springframework.integration-tests"/>
|
||||
<pathelement location="../org.springframework.spring-library"/>
|
||||
</path>
|
||||
|
||||
<property file="${basedir}/../build.properties"/>
|
||||
<import file="${basedir}/package-top-level.xml"/>
|
||||
<import file="${basedir}/publish-top-level.xml"/>
|
||||
<import file="${basedir}/publish-documentation.xml"/>
|
||||
<import file="${basedir}/../spring-build/multi-bundle/default.xml"/>
|
||||
|
||||
<target name="precommit" depends="clean, clean-integration, test"/>
|
||||
|
||||
<presetdef name="javadoc.links">
|
||||
<javadoc>
|
||||
<link href="http://download.oracle.com/javase/6/docs/api"/>
|
||||
<link href="http://download.oracle.com/javaee/6/api"/>
|
||||
<link href="http://aopalliance.sourceforge.net/doc"/>
|
||||
<!-- Caucho Burlap/Hessian -->
|
||||
<link href="http://cglib.sourceforge.net/apidocs"/>
|
||||
<!-- EasyMock -->
|
||||
<link href="http://ehcache.sourceforge.net/apidocs"/>
|
||||
<link href="http://freemarker.sourceforge.net/docs/api/"/>
|
||||
<link href="http://docs.jboss.org/hibernate/core/3.6/javadocs/"/>
|
||||
<!-- iBATIS -->
|
||||
<!-- iText -->
|
||||
<!-- Commons Attributes -->
|
||||
<link href="http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/"/>
|
||||
<link href="http://jakarta.apache.org/commons/dbcp/apidocs/"/>
|
||||
<link href="http://jakarta.apache.org/commons/fileupload/apidocs/"/>
|
||||
<link href="http://jakarta.apache.org/commons/httpclient/apidocs/"/>
|
||||
<link href="http://jakarta.apache.org/commons/logging/apidocs/"/>
|
||||
<link href="http://jakarta.apache.org/commons/pool/apidocs/"/>
|
||||
<!-- JasperReports -->
|
||||
<!-- JDO -->
|
||||
<!-- JMX -->
|
||||
<!-- JOTM -->
|
||||
<!-- JPA -->
|
||||
<!-- JSF -->
|
||||
<link href="http://junit.sourceforge.net/javadoc_40/"/>
|
||||
<link href="http://logging.apache.org/log4j/docs/api/"/>
|
||||
<link href="http://jakarta.apache.org/regexp/apidocs/"/>
|
||||
<link href="http://jakarta.apache.org/poi/apidocs/"/>
|
||||
<link href="http://portals.apache.org/pluto/portlet-1.0-apidocs/"/>
|
||||
<link href="http://www.quartz-scheduler.org/api/2.1.0/"/>
|
||||
<link href="http://struts.apache.org/struts-doc-1.2.9/api/"/>
|
||||
<link href="http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/"/>
|
||||
<link href="http://tiles.apache.org/framework/apidocs/"/>
|
||||
<link href="http://velocity.apache.org/engine/devel/apidocs/"/>
|
||||
</javadoc>
|
||||
</presetdef>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="package-bundle">
|
||||
|
||||
<target name="package" depends="ivy.init">
|
||||
<dist-jar/>
|
||||
<src-jar/>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="package-library">
|
||||
|
||||
<target name="package" depends="ivy.init">
|
||||
<dist-jar/>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="package-top-level">
|
||||
|
||||
<target name="package" description="Creates the release package for this project">
|
||||
<delete dir="${package.output.dir}" quiet="true"/>
|
||||
<mkdir dir="${package.output.dir}"/>
|
||||
<delete file="${package.output.file}" quiet="true"/>
|
||||
<mkdir dir="${artifacts.dir}"/>
|
||||
|
||||
<all-bundles target="package">
|
||||
<property name="package.output.dir" value="${package.output.dir}"/>
|
||||
</all-bundles>
|
||||
|
||||
<ant target="javadoc-api" inheritAll="false">
|
||||
<property name="target.dir" value="${package.docs.dir}"/>
|
||||
</ant>
|
||||
|
||||
<!-- Reference Document START-->
|
||||
<path id="doc.projects">
|
||||
<path location="${basedir}/../spring-framework-reference"/>
|
||||
</path>
|
||||
|
||||
<all-bundles target="doc" buildpathRef="doc.projects"/>
|
||||
|
||||
<delete>
|
||||
<fileset dir="${basedir}/../spring-framework-reference" includes="**/*.zip"/>
|
||||
</delete>
|
||||
|
||||
<all-bundles target="package" buildpathRef="doc.projects">
|
||||
<property name="package.output.dir" value="${package.output.dir}"/>
|
||||
</all-bundles>
|
||||
|
||||
<!-- Reference Document END-->
|
||||
|
||||
<copy todir="${package.output.dir}">
|
||||
<fileset dir="${basedir}/resources"/>
|
||||
</copy>
|
||||
|
||||
<copy todir="${package.output.dir}/projects">
|
||||
<fileset dir="${basedir}/..">
|
||||
<exclude name="*/target/**"/>
|
||||
<exclude name="integration-repo/**"/>
|
||||
<exclude name="ivy-cache/**"/>
|
||||
<exclude name="spring-build/lib/docbook/**" />
|
||||
<exclude name="**/*OLD*/**"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<replaceregexp match="build.stamp.*\n" replace="" flags="g"
|
||||
file="${package.output.dir}/projects/build.properties"/>
|
||||
|
||||
<replaceregexp match="release.type=.*" replace="release.type=integration" flags="g"
|
||||
file="${package.output.dir}/projects/build.properties"/>
|
||||
|
||||
<zip destfile="${package.output.file}">
|
||||
<zipfileset dir="${package.dir}">
|
||||
<exclude name="${package.basename}/docs/**"/>
|
||||
</zipfileset>
|
||||
</zip>
|
||||
|
||||
<zip destfile="${artifacts.dir}/${package.basename}-with-docs.zip">
|
||||
<zipfileset dir="${package.dir}"/>
|
||||
</zip>
|
||||
|
||||
<zip destfile="${artifacts.dir}/${package.basename}-dependencies.zip">
|
||||
<zipfileset dir="${basedir}/../ivy-cache/repository">
|
||||
<exclude name="org.apache.velocity/org.apache.velocity.docbookframework.dist/**"/>
|
||||
</zipfileset>
|
||||
</zip>
|
||||
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="publish-documentation">
|
||||
|
||||
<!-- Main targets -->
|
||||
<target name="publish-documentation" depends="publish-documentation.init">
|
||||
<sshexec host="static.springsource.org" username="${username}" keyfile="${key.file}" passphrase="${passphrase}"
|
||||
command="rm -rf /opt/www/domains/springframework.org/www/htdocs/spring/docs/${bundle.version}"/>
|
||||
<sshexec host="static.springsource.org" username="${username}" keyfile="${key.file}" passphrase="${passphrase}"
|
||||
command="mkdir /opt/www/domains/springframework.org/www/htdocs/spring/docs/${bundle.version}"/>
|
||||
|
||||
<scp remoteToDir="${username}@static.springsource.org:/opt/www/domains/springframework.org/www/htdocs/spring/docs/${bundle.version}"
|
||||
keyfile="${key.file}" passphrase="${passphrase}" sftp="true" verbose="true">
|
||||
<fileset dir="${package.output.dir}">
|
||||
<include name="changelog.txt" />
|
||||
<include name="license.txt" />
|
||||
<include name="readme.txt" />
|
||||
</fileset>
|
||||
<fileset dir="${package.docs.dir}" />
|
||||
</scp>
|
||||
|
||||
<sshexec host="static.springsource.org" username="${username}" keyfile="${key.file}" passphrase="${passphrase}"
|
||||
command="rm -f /opt/www/domains/springframework.org/www/htdocs/spring/docs/3.1.x ; ln -s /opt/www/domains/springframework.org/www/htdocs/spring/docs/${bundle.version} /opt/www/domains/springframework.org/www/htdocs/spring/docs/3.1.x"/>
|
||||
</target>
|
||||
|
||||
<!-- Other targets -->
|
||||
<target name="publish-documentation.init">
|
||||
<fail message="The 'username' property must be set">
|
||||
<condition>
|
||||
<not>
|
||||
<isset property="username"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<fail message="The 'key.file' property must be set">
|
||||
<condition>
|
||||
<not>
|
||||
<isset property="key.file"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<fail message="The 'passphrase' property must be set">
|
||||
<condition>
|
||||
<not>
|
||||
<isset property="passphrase"/>
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="publish-top-level" xmlns:aws="antlib:org.springframework.build.aws">
|
||||
|
||||
<target name="publish" depends="publish-package, publish-multi-bundle.publish"
|
||||
description="Publish package, Ivy, and Maven artifacts"/>
|
||||
|
||||
<target name="publish-package" depends="aws.init">
|
||||
<checksum file="${package.output.file}" algorithm="sha1"/>
|
||||
<checksum file="${artifacts.dir}/${package.basename}-with-docs.zip" algorithm="sha1"/>
|
||||
<checksum file="${artifacts.dir}/${package.basename}-dependencies.zip" algorithm="sha1"/>
|
||||
|
||||
<aws:s3 accessKey="${accessKey}" secretKey="${secretKey}">
|
||||
<upload bucketName="dist.${bucket.basename}" file="${package.output.file}"
|
||||
toFile="${adjusted.release.type}/${project.key}/${package.file.name}" publicRead="true">
|
||||
<metadata name="project.name" value="Spring Framework"/>
|
||||
<metadata name="release.type" value="${release.type}"/>
|
||||
<metadata name="bundle.version" value="${bundle.version}"/>
|
||||
<metadata name="package.file.name" value="${package.file.name}"/>
|
||||
</upload>
|
||||
<upload bucketName="dist.${bucket.basename}" file="${package.output.file}.sha1"
|
||||
toFile="${adjusted.release.type}/${project.key}/${package.file.name}.sha1" publicRead="true"/>
|
||||
|
||||
<upload bucketName="dist.${bucket.basename}" file="${artifacts.dir}/${package.basename}-with-docs.zip"
|
||||
toFile="${adjusted.release.type}/${project.key}/${package.basename}-with-docs.zip" publicRead="true">
|
||||
<metadata name="project.name" value="Spring Framework"/>
|
||||
<metadata name="release.type" value="${release.type}"/>
|
||||
<metadata name="bundle.version" value="${bundle.version}"/>
|
||||
<metadata name="package.file.name" value="${package.basename}-with-docs.zip"/>
|
||||
</upload>
|
||||
<upload bucketName="dist.${bucket.basename}" file="${artifacts.dir}/${package.basename}-with-docs.zip.sha1"
|
||||
toFile="${adjusted.release.type}/${project.key}/${package.basename}-with-docs.zip.sha1" publicRead="true"/>
|
||||
|
||||
<upload bucketName="dist.${bucket.basename}" file="${artifacts.dir}/${package.basename}-dependencies.zip"
|
||||
toFile="${adjusted.release.type}/${project.key}/${package.basename}-dependencies.zip" publicRead="true">
|
||||
<metadata name="project.name" value="Spring Framework"/>
|
||||
<metadata name="release.type" value="${release.type}"/>
|
||||
<metadata name="bundle.version" value="${bundle.version}"/>
|
||||
<metadata name="package.file.name" value="${package.basename}-dependencies.zip"/>
|
||||
</upload>
|
||||
<upload bucketName="dist.${bucket.basename}" file="${artifacts.dir}/${package.basename}-dependencies.zip.sha1"
|
||||
toFile="${adjusted.release.type}/${project.key}/${package.basename}-dependencies.zip.sha1" publicRead="true"/>
|
||||
</aws:s3>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,42 @@
|
||||
This is where the master build that creates releases of Spring Framework resides.
|
||||
The build system is based on spring-build, which is linked in using an SVN
|
||||
external to https://src.springframework.org/svn/spring-build.
|
||||
|
||||
Build Pre-requisites:
|
||||
- javac 1.6 or > must be in your system path
|
||||
- ant 1.7 or > must be in your system path
|
||||
- set ANT_OPTS as follows (to avoid out of memory errors):
|
||||
ANT_OPTS="-XX:MaxPermSize=1024m -Xmx1024m -Dtest.vm.args='-XX:MaxPermSize=512m -Xmx1024m'"
|
||||
|
||||
USERS
|
||||
- To build all Spring Framework projects, including samples:
|
||||
|
||||
1. From this directory, run:
|
||||
ant
|
||||
|
||||
- To install the built artifacts into your local Maven cache:
|
||||
|
||||
1. From this directory, run:
|
||||
ant install-maven
|
||||
|
||||
- For a complete tutorial, see:
|
||||
|
||||
http://blog.springsource.com/2009/03/03/building-spring-3
|
||||
|
||||
|
||||
DEVELOPERS
|
||||
- To build a new Spring Framework distribution for release:
|
||||
|
||||
1. Update the files containing the version number to reflect the new release
|
||||
version, if necessary.
|
||||
|
||||
build.properties
|
||||
build-spring-framework/resources/readme.txt
|
||||
spring-framework/src/spring-framework-reference.xml
|
||||
|
||||
2. From this directory, run:
|
||||
|
||||
ant jar package
|
||||
|
||||
The release archive will be created and placed in:
|
||||
target/artifacts
|
||||
@@ -0,0 +1,970 @@
|
||||
SPRING FRAMEWORK CHANGELOG
|
||||
==========================
|
||||
http://www.springsource.org
|
||||
|
||||
|
||||
Changes in version 3.1.4 (2013-01-23)
|
||||
-------------------------------------
|
||||
|
||||
* overhauled non-void JavaBean write method support (SPR-10029)
|
||||
* SpEL support for static finals on interfaces (SPR-10125)
|
||||
* BridgeMethodResolver properly handles bridge methods in interfaces (SPR-9330)
|
||||
* LocalVariableTableParameterNameDiscoverer works for bridge methods as well (SPR-9429)
|
||||
* CachedIntrospectionResults uses full WeakReference for any non-safe ClassLoader arrangement (SPR-10028)
|
||||
* CachedIntrospectionResults.clearClassLoader(null) removes cached classes for the system class loader (SPR-9189)
|
||||
* DefaultListableBeanFactory avoids wide/interleaved metadata locks to avoid deadlock potential (SPR-10020)
|
||||
* fixed CGLIB proxy class leaks through further equals/hashCode implementations in Spring AOP pointcuts (SPR-8008)
|
||||
* ConfigurationClassPostProcessor consistently uses ClassLoader, not loading core JDK classes via ASM (SPR-10058)
|
||||
* MessageSourceResourceBundle overrides JDK 1.6 containsKey method, avoiding NPE in getKeys (SPR-10136)
|
||||
* SpringBeanAutowiringInterceptor eagerly releases BeanFactory if post-construction fails (SPR-10013)
|
||||
* added "exposeAccessContext" flag JndiRmiClientInterceptor/ProxyFactoryBean (for WebLogic; SPR-9428)
|
||||
* MBeanExporter does not log warnings for manually unregistered MBeans (SPR-9451)
|
||||
* AbstractCacheManager accepts no caches defined, allowing for EHCache default cache setup (SPR-7955)
|
||||
* reintroduced "mode" and "proxy-target-class" attributes in spring-task-3.1.xsd (SPR-10177)
|
||||
* improved defensiveness of JDBC 3.0 ParameterMetaData calls for parameter type determination (SPR-10084)
|
||||
* JpaTransactionManager etc finds default EntityManagerFactory in parent context as well (SPR-10160)
|
||||
* tx timeouts for JPA translate to "javax.persistence.query.timeout" only (for EclipseLink compatibility; SPR-10068)
|
||||
* DefaultMessageListenerContainer allows for concurrent subscription consumers on WebLogic/ActiveMQ (SPR-10037)
|
||||
* DefaultMessageListenerContainer clears resources of paused tasks when shutting down after stop (SPR-10092)
|
||||
* JmsTemplate uses configured receiveTimeout if shorter than remaining transaction timeout (SPR-10109)
|
||||
* added MappingJackson2MessageConverter for JMS (SPR-10099)
|
||||
* ResourceDatabasePopulator explicitly closes its LineNumberReader (SPR-9912)
|
||||
* MimeMessageHelper encodes attachment filename if not ASCII compliant (SPR-9258)
|
||||
* FreeMarkerConfigurationFactory properly supports TemplateLoaders when recreating Configurations (SPR-9389)
|
||||
* SpringContextResourceAdapter implements equals/hashCode according to the JCA 1.5 contract (SPR-9162)
|
||||
* ContextLoader properly detects pre-refreshed WebApplicationContext (SPR-9996)
|
||||
* AbstractCachingViewResolver uses a cache limit of 1024 by default, avoiding overflow for redirect URLs (SPR-10065)
|
||||
* fixed HierarchicalUriComponents equals implementation (SPR-10088)
|
||||
* MockHttpServletRequest's getParameter(Values) returns null for null parameter name (SPR-10192)
|
||||
* MockHttpServletResponse's getHeaderNames declares Collection instead of Set for Servlet 3.0 compatibility (SPR-9885)
|
||||
* ResourcePropertySource supports JDK 5-style Properties XML (SPR-9896)
|
||||
|
||||
|
||||
Changes in version 3.1.3 (2012-10-31)
|
||||
-------------------------------------
|
||||
|
||||
* fixed cache handling for JNLP connections
|
||||
* LinkedCaseInsensitiveMap checks for uniqueness of case-insensitive keys now
|
||||
* ResourceBundleMessageSource supports "defaultEncoding", "fallbackToSystemLocale", "cacheSeconds"
|
||||
* BeanWrapper does not fall back to String constructor if ConversionService attempt failed before
|
||||
* @Import'ed configuration classes get properly registered in case of same class name
|
||||
* @Autowired-driven ObjectFactory/Provider resolution works in non-singleton beans as well
|
||||
* @Resource processing properly works with scoped beans and prototypes again
|
||||
* allow replaced-method 'arg-type' matches against element body as well as 'match' attribute
|
||||
* fixed potential race condition in concurrent calling of autowired methods on a prototype bean
|
||||
* cancel on a Future returned by a TaskScheduler works reliably
|
||||
* LoadTimeWeaverAware beans are consistently being created early for JPA weaving to work reliably
|
||||
* Spring-backed DataSources consistently implement JDBC 4.0's Wrapper interface
|
||||
* optimized ResourceDatabasePopulator to work around JDK 1.7 substring performance regression
|
||||
* deprecated SimpleJdbcTestUtils in favor of JdbcTestUtils
|
||||
* introduced "countRowsInTableWhere()" and "dropTables()" in JdbcTestUtils
|
||||
* same-named unit from persistence.xml overrides in case of conflict with default unit
|
||||
* JPA persistence.xml files may use jar-file entries relative to the unit root (as per the JPA spec)
|
||||
* added "jtaDataSource" property to JPA LocalContainerEntityManagerFactoryBean (for default units)
|
||||
* Hibernate 4 LocalSessionFactoryBuilder sets thread context ClassLoader (for JBoss 7 compatibility)
|
||||
* Jaxb2Marshaller performs proper "supports" check for scanned packages
|
||||
* media types in HTTP Accept headers can be parsed with single quotes (-> Android 2.x)
|
||||
* MediaType's include method now recognizes wildcards in media types with a suffix
|
||||
* added support for recognizing wildcards in media types with a suffix
|
||||
* UriComponentsBuilder is capable of handling opaque URIs as well
|
||||
* CookieGenerator supports "cookieHttpOnly" flag for Servlet 3.0
|
||||
* HttpComponentsHttpInvokerRequestExecutor explicitly releases connection on HttpComponents 4.2
|
||||
* improved no-match handling for @RequestMapping methods
|
||||
* dynamic return value types for @MVC methods
|
||||
* fixed issue with resolution of WebDataBinder argument
|
||||
* fixed issue with resolving Errors controller argument
|
||||
* now decoding target parameters prior to saving a FlashMap
|
||||
* prevent response updates if @ResponseStatus has a reason
|
||||
* improved regex for parsing query params
|
||||
* optimized use of AntPathStringMatcher
|
||||
* optimized use of HandlerMethod and subclasses
|
||||
* fixed issue in message conversion where producible and acceptable headers are equally specific
|
||||
* fixed NullPointerException in AbstractMessageConverterMethodProcessor
|
||||
* fixed side effect from caching in AnnotationMethodHandlerExceptionResolver
|
||||
* DispatcherPortlet uses a forward for rendering a view as resource response
|
||||
* fixed Portlet request mapping priorities in cross-controller case
|
||||
|
||||
|
||||
Changes in version 3.1.2 (2012-07-09)
|
||||
-------------------------------------
|
||||
|
||||
* removed INDEX.LIST entries from Spring jar META-INF dirs
|
||||
* fixed OSGi metadata for optional "javax.inject" package import
|
||||
* fixed AbstractResource's InputStream-based "contentLength()" implementation
|
||||
* fixed MutablePropertySources "get" implementation to correctly return null if not found
|
||||
* fixed @PropertySource placeholder resolution to apply to all specified values
|
||||
* JDBC parameter binding uses JDBC 3.0 ParameterMetaData (if available) for type determination
|
||||
* added "jtaTransactionManager" property to Hibernate 4 LocalSessionFactoryBean/Builder
|
||||
* EhCacheFactoryBean applies listeners and enabled/disabled flags to existing cache regions as well
|
||||
* added "repeatCount" bean property to Quartz SimpleTriggerFactoryBean
|
||||
* support executor qualification with @Async#value
|
||||
* ServletContextResource's getFile implementation falls back to getRealPath for non-existent files
|
||||
* fixed StandardServletMultipartResolver compatibility with Resin (only deleting actual file parts)
|
||||
* fixed RequestConditionHolder to return null when no match is found
|
||||
* fixed concurrency issue in AnnotationMethodHandlerExceptionResolver
|
||||
* fixed issue with parsing invalid Content-Type or Accept headers
|
||||
* added "defaultCharset" property to StringHttpMessageConverter
|
||||
* added Jackson 2 HttpMessageConverter and View types
|
||||
* translate IOException on EOF from Jackson to HttpMessageNotReadableException
|
||||
* fix content negotiation issue when sorting selected media types by quality value
|
||||
* raise RestClientException instead of IllegalArgumentException for unknown status codes
|
||||
* discover controllers based on type-level @RequestMapping in new @MVC support classes
|
||||
* fixed issue with suffix pattern in AnnotationMethodHandlerAdapter
|
||||
* merge rather than add URI vars in ExtendedServletRequestDataBinder
|
||||
* raise RestClientException for unknown HTTP status codes
|
||||
* fixed issue with encoded params in UriComponentsBuilder
|
||||
* XStreamMarshaller converts StreamException to Spring exception in case of unmarshalling an empty stream
|
||||
* corrected DispatcherPortlet behavior to not forward event exceptions to the render phase by default
|
||||
|
||||
|
||||
Changes in version 3.1.1 (2012-02-16)
|
||||
-------------------------------------
|
||||
|
||||
* official support for Hibernate 4.0.0/4.0.1 as well as Hibernate 4.1
|
||||
* JBossNativeJdbcExtractor is compatible with JBoss AS 7 as well
|
||||
* restored JBossLoadTimeWeaver compatibility with JBoss AS 5.1
|
||||
* Provider injection works with generically typed collections of beans as well
|
||||
* @ActiveProfiles mechanism in test context framework works with @ImportResource as well
|
||||
* context:property-placeholder's "file-encoding" attribute value is being applied correctly
|
||||
* clarified Resource's "getFilename" method to return null if resource type does not have a filename
|
||||
* Resource "contentLength()" implementations work with OSGi bundle resources and JBoss VFS resources
|
||||
* PathMatchingResourcePatternResolver preserves caching for JNLP (Java Web Start) jar connections
|
||||
* optimized converter lookup in GenericConversionService to avoid contention in JDK proxy check
|
||||
* DataBinder correctly handles ParseException from Formatter for String->String case
|
||||
* CacheNamespaceHandler actually parses cache:annotation-driven's "key-generator" attribute
|
||||
* introduced CustomSQLExceptionTranslatorRegistry/Registrar for JDBC error code translation
|
||||
* officially deprecated TopLinkJpaDialect in favor of EclipseLink and Spring's EclipseLinkJpaDialect
|
||||
* fixed LocalContainerEntityManagerFactoryBean's "packagesToScan" to avoid additional provider scan
|
||||
* LocalContainerEntityManagerFactoryBean's "persistenceUnitName" applies to "packagesToScan" as well
|
||||
* DefaultPersistenceUnitManager uses containing jar as persistence unit root URL for default unit
|
||||
* added protected "isPersistenceUnitOverrideAllowed()" method to DefaultPersistenceUnitManager
|
||||
* Hibernate synchronization properly unbinds Session even in case of afterCompletion exception
|
||||
* Hibernate exception translation covers NonUniqueObjectException to DuplicateKeyException case
|
||||
* Hibernate 4 LocalSessionFactoryBean implements PersistenceExceptionTranslator interface as well
|
||||
* Hibernate 4 LocalSessionFactoryBean does not insist on a "dataSource" reference being set
|
||||
* added "entityInterceptor" property to Hibernate 4 LocalSessionFactoryBean
|
||||
* added "getConfiguration" accessor to Hibernate 4 LocalSessionFactoryBean
|
||||
* added "durability" and "description" properties to JobDetailFactoryBean
|
||||
* fixed QuartzJobBean and MethodInvokingJobDetailFactoryBean for compatibility with Quartz 2.0/2.1
|
||||
* JMS CachingConnectionFactory never caches consumers for temporary queues and topics
|
||||
* JMS SimpleMessageListenerContainer silently falls back to lazy registration of consumers
|
||||
* added "receive-timeout" attribute to jms:listener-container element in JMS namespace
|
||||
* ServletServerHttpRequest/Response fall back on the Content-Type and encoding of the request
|
||||
* preserve quotes in MediaType parameters
|
||||
* added "normalize()" method to UriComponents
|
||||
* remove empty path segments from input to UriComponentsBuilder
|
||||
* added "fromRequestUri(request)" and "fromCurrentRequestUri()" methods to ServletUriComponentsBuilder
|
||||
* Servlet/PortletContextResource's "isReadable()" implementation returns false for directories
|
||||
* allow adding flash attributes in methods with a ModelAndView return value
|
||||
* make flash attributes available in the model of Parameterizable/UrlFilenameViewController
|
||||
* revised the FlashMapManager contract and implementation to address a flaw in its design
|
||||
* removed check for HTTP POST when resolving multipart request controller method arguments
|
||||
* fixed request mapping bug involving direct vs pattern path matches with HTTP methods
|
||||
* updated @RequestMapping and reference docs wrt differences between @MVC 3.1 and @MVC 2.5-3.0
|
||||
* improved @SessionAttributes handling to provide better support for clustered sessions
|
||||
* added property to RedirectView to disable expanding URI variables in redirect URL
|
||||
|
||||
|
||||
Changes in version 3.1 GA (2011-12-12)
|
||||
--------------------------------------
|
||||
|
||||
* SmartLifecycle beans in Lifecycle dependency graphs are only being started when isAutoStartup=true
|
||||
* ConversionService is able to work with "Collections.emptyList()" as target type (again)
|
||||
* restored DataBinder's ability to bind to an auto-growing List with unknown element type
|
||||
* added SmartValidator interface with general support for validation hints
|
||||
* added custom @Validated annotation with support for JSR-303 validation groups
|
||||
* JSR-303 SpringValidatorAdapter and MVC data binding provide support for validation groups
|
||||
* restored SpringValidatorAdapter's ability to handle bean constraints with property paths
|
||||
* added MethodValidationInterceptor/PostProcessor for Hibernate Validator 4.2 based method validation
|
||||
* fixed QuartzJobBean to work with Quartz 2.0/2.1 as well
|
||||
* @Transactional qualifiers match against transaction manager definitions in parent contexts as well
|
||||
* optimized AnnotationTransactionAspect and AnnotationCacheAspect pointcuts to avoid runtime checks
|
||||
* renamed @CacheEvict's "afterInvocation" attribute to "beforeInvocation" (for better readability)
|
||||
* added "mappingResources" property to LocalContainerEntityManagerFactoryBean (pointing to orm.xml)
|
||||
* Hibernate 4.0 variant of HibernateTransactionManager properly works with Open Session in View now
|
||||
* JmsInvokerClientInterceptor/FactoryBean always uses createConnection/createSession when on JMS 1.1
|
||||
* added out-of-the-box MappingJacksonMessageConverter impl for Spring's JMS MessageConverter facility
|
||||
* DispatcherServlet's "dispatchOptionsRequest" only sets the default 'Allow' header if actually needed
|
||||
* ResourceHttpRequestHandler sends content without content-type header if no media type found
|
||||
* ResourceHttpRequestHandler and ContentNegotiatingViewResolver use consistent mime type resolution
|
||||
* simplified support package layout in "web.method" and "web.servlet.mvc.method"
|
||||
* added "useTrailingSlashMatch" property to RequestMappingHandlerMapping
|
||||
* Portlet MVC annotation mapping allows for distributing action names across controllers
|
||||
* added String constants to MediaType
|
||||
|
||||
|
||||
Changes in version 3.1 RC2 (2011-11-28)
|
||||
---------------------------------------
|
||||
|
||||
* fixed OSGi manifest for spring-web bundle to not require Apache HttpComponents anymore
|
||||
* fixed GenericTypeResolver to consistently return null if not resolvable
|
||||
* added proper "contentLength()" implementation to ByteArrayResource
|
||||
* refined Resource "exists()" check for HTTP URLs to always return false for 404 status
|
||||
* LocaleEditor and StringToLocaleConverter do not restrict variant part through validation
|
||||
* LinkedCaseInsensitiveMap overrides putAll method as well (for IBM JDK 1.6 compatibility)
|
||||
* optimized DefaultListableBeanFactory's PropertyDescriptor caching for concurrent access
|
||||
* renamed ValueWrapperImpl to SimpleValueWrapper (for use in Cache implementations)
|
||||
* exposed EHCache 1.7's "statisticsEnabled"/"sampledStatisticsEnabled" on EhCacheFactoryBean
|
||||
* SpringValidatorAdapter accepts non-indexed set paths (for Hibernate Validator compatibility)
|
||||
* TransactionSynchronizationManager eagerly cleans up void ResourceHolders on any access
|
||||
* SimpleJdbcTestUtils executeSqlScript properly closes its LineNumberReader after use
|
||||
* JDO PersistenceManager synchronization performs close attempt after completion (if necessary)
|
||||
* JPA EntityManagerFactoryUtils silently ignores IllegalArgumentExceptions from setHint calls
|
||||
* fixed HibernateTransactionManager for Hibernate 4.0 to refer to correct openSession() method
|
||||
* added "namingStrategy" property to Hibernate 4 LocalSessionFactoryBean variant
|
||||
* HibernateJpaDialect does NOT expose underlying Session for underlying SessionFactory anymore
|
||||
* fixed MethodInvokingJobDetailFactoryBean's Quartz 2.0 support
|
||||
* added Quartz 2.1 compatibility while preserving Quartz 2.0 support
|
||||
* introduced JobDetail/CronTrigger/SimpleTriggerFactoryBean variants for Quartz 2.0/2.1 support
|
||||
* added "forwarder" property to ConnectorServerFactoryBean, accepting an MBeanServerForwarder
|
||||
* RmiClientInterceptor detects nested SocketException as connect failure as well
|
||||
* fixed StandardServlet/PortletEnvironment to check for JNDI (for Google App Engine compatibility)
|
||||
* Servlet/PortletContextResource's getFile prefers "file:" URL resolution over calling getRealPath
|
||||
* Portlet session mutex uses global session attribute to be shared among all portlets in the session
|
||||
* using original request URI in FlashMap matching logic to account for URL rewriting
|
||||
* now supporting target request with multiple parameter values in FlashMap matching logic
|
||||
* fixed issue in SimpleMappingExceptionResolver causing exception when setting "statusCodes" property
|
||||
* added ignoreDefaultModelOnRedirect attribute to <mvc:annotation-driven/>
|
||||
* added methods to UriComponentsBuilder for replacing the path or the query
|
||||
* support UriComponentsBuilder as @Controller method argument
|
||||
* added ServletUriComponentsBuilder to build a UriComponents instance starting with a ServletRequest
|
||||
* fixed issue with cache ignoring prototype-scoped controllers in RequestMappingHandlerAdapter
|
||||
* fixed issue with setting Content-Length header depending on the charset of the response
|
||||
* fixed @RequestMapping header matching to correctly process negated header conditions
|
||||
* added getObjectMapper() accessor to MappingJacksonHttpMessageConverter
|
||||
* AbstractCachingViewResolver caches unresolved view names by default ("cacheUnresolved"=true)
|
||||
* form input tag now allows type values other than "text" such as HTML5-specific types
|
||||
* form hidden tag now supports "disabled" attribute
|
||||
* fixed "formMultiSelect"/"formCheckboxes" FreeMarker macros to compare against actual field value
|
||||
* MockHttpServletRequest/Response now keep contentType field and Content-Type header in sync
|
||||
* updated Spring MVC configuration section to include MVC Java config and the MVC namespace
|
||||
|
||||
|
||||
Changes in version 3.1 RC1 (2011-10-11)
|
||||
---------------------------------------
|
||||
|
||||
* upgraded to JUnit 4.9
|
||||
* updated Quartz support package for Quartz 2.0 compatibility
|
||||
* support for load-time weaving on WebSphere 7 and 8
|
||||
* updated JBossLoadTimeWeaver to automatically detect and support JBoss AS 7 as well
|
||||
* added support for Hibernate 4.0 (HibernateJpaDialect as well as natively in orm.hibernate4)
|
||||
* added 'destroy method inference' (SPR-8751)
|
||||
* prepared Spring's DataSource and RowSet adapters for forward compatibility with JDBC 4.1
|
||||
* introduced ForkJoinPoolFactoryBean for Java 7 (alternative: add new jsr166.jar to Java 6)
|
||||
* introduced extended WritableResource interface
|
||||
* ConversionService prevents Converter from trying to convert to a subtype of its actual target type
|
||||
* CollectionCollection/MapToMapConverter preserve original Collection/Map if no converted elements
|
||||
* DefaultListableBeanFactory is only deserializable through a SerializedBeanFactoryReference
|
||||
* DefaultListableBeanFactory's getBean(name, type) attempts type conversion if necessary
|
||||
* DefaultListableBeanFactory allows for init methods to register further bean definitions (again)
|
||||
* XmlBeanDefinitionReader accepts description subelement within map entry as well (as per the XSD)
|
||||
* ConfigurationClassPostProcessor supports use of same processor instance with several factories
|
||||
* SpringBeanAutowiringSupport is able to process @Value annotations on any given target instance
|
||||
* introduced @EnableAspectJAutoProxy
|
||||
* overridden @PersistenceContext annotations on subclass methods are being processed correctly
|
||||
* DataBinder uses a default limit of 256 for array/collection auto-growing
|
||||
* added "autoGrowNestedPaths" property to ConfigurableWebBindingInitializer
|
||||
* added "getMultipartContentType(String)" method to MultipartRequest interface
|
||||
* added headers support to MultipartFile abstraction (actually supported on Servlet 3.0)
|
||||
* revised Servlet 3.0 based StandardServletMultipartResolver for correct param/file distinction
|
||||
* MultipartFilter uses a Servlet 3.0 based StandardServletMultipartResolver by default
|
||||
* added RequestPartServletServerHttpRequest and corresponding @RequestPart support in Spring MVC
|
||||
* added "connectTimeout" and "readTimeout" properties to Simple/CommonsClientHttpRequestFactory
|
||||
* added flash attribute support through FlashMap and FlashMapManager abstractions
|
||||
* added RedirectAttributes abstraction as supported method argument type of @RequestMapping methods
|
||||
* added "ignoreDefaultModelOnRedirect" flag to RequestMappingHandlerAdapter
|
||||
* fixed @ExceptionHandler exception type matching (ExceptionDepthComparator)
|
||||
* ResourceHttpRequestHandler detects invalid directory traversal in given path
|
||||
* HtmlUtils properly escapes single quotes as well
|
||||
* Spring JSP tags do not use their own expression support on Servlet 3.0 containers by default
|
||||
* added support for web.xml context-param "springJspExpressionSupport" (explicit "true"/"false")
|
||||
* ContextLoader and FrameworkServlet support "contextId" parameter for custom serialization id
|
||||
* added "acceptProxyClasses" flag to RemoteInvocationSerializingExporter
|
||||
* refined WebLogic RMI descriptor to only mark 'getTargetInterfaceName' method as idempotent
|
||||
* revised JMS CachedConnectionFactory to avoid unnecessary rollback calls on Session return
|
||||
* fixed JMS CachedConnectionFactory to fully synchronize its Session list
|
||||
* JpaTransactionManager etc can find EntityManagerFactory by "persistenceUnitName" property now
|
||||
* HibernateJpaDialect exposes underlying Session for underlying SessionFactory
|
||||
* deprecated JpaTemplate/JpaInterceptor/JpaDaoSupport and JdoTemplate/JdoInterceptor/JdoDaoSupport
|
||||
* updated H2 error codes in sql-error-codes.xml
|
||||
* fixed NamedParameterJdbcTemplate to use correct maximum type for queryForInt/Long
|
||||
* jdbc:script's "separator" and "execution" attributes work nested with embedded-database as well
|
||||
* added "encoding" attribute to jdbc:script element
|
||||
* JavaMailSenderImpl detects and respects "mail.transport.protocol" property in existing Session
|
||||
* added ConcurrentMapCacheManager, dynamically building ConcurrentMapCache instances at runtime
|
||||
* added "disabled" property to EhCacheFactoryBean
|
||||
* introduced generic invokeMethod() in ReflectionTestUtils
|
||||
* introduced DelegatingSmartContextLoader as new default ContextLoader for TestContext framework
|
||||
* deprecated @ExpectedException
|
||||
* AnnotationConfigContextLoader now detects default configuration classes within test classes
|
||||
* TestContext now uses MergedContextConfiguration for the ContextCache key
|
||||
* extended Servlet API mocks for Servlet 3.0 forward compatibility as far as possible
|
||||
* made MockHttpServletResponse compatible with Servlet 3.0 getHeader(s) method returning Strings
|
||||
* added getHeaderValue(s) method to MockHttpServletResponse for raw value access
|
||||
|
||||
|
||||
Changes in version 3.1 M2 (2011-06-08)
|
||||
--------------------------------------
|
||||
|
||||
* revised TypeDescriptor signature and implementation for clearer handling of nested generics
|
||||
* full support for arbitrary nesting of collections in fields
|
||||
* proper type detection in nested collections within arrays
|
||||
* collection/array conversion returns original collection if possible (instead of first element)
|
||||
* AnnotatedBeanDefinitionReader now inherits Environment of supplied BeanDefinitionRegistry
|
||||
* eliminated @Feature support in favor of @Enable* and framework-provided @Configuration classes
|
||||
* introduced @EnableTransactionManagement, @EnableScheduling, etc
|
||||
* add Java config alternative to MVC namespace via @EnableWebMvc annotation
|
||||
* introduce HandlerMethod abstraction selecting and invoking @RequestMapping methods
|
||||
* add HandlerMethod-based implementations of HandlerMapping, HandlerAdapter, HandlerExceptionResolver
|
||||
* merge @PathVariables in the model before rendering except for JSON/XML serialization/marshalling.
|
||||
* use @PathVariables in addition to request parameters in data binding
|
||||
* support URI variable placeholders in "redirect:" prefixed view names
|
||||
* add flag to extract value from single-key model in MappingJacksonJsonView
|
||||
* support @Valid on @RequestBody method arguments
|
||||
* allow bean references in mvc:interceptor namespace elements
|
||||
* consolidate initialization and use of MappedInterceptors in AbstractHandlerMapping
|
||||
* added Servlet 3.0 based WebApplicationInitializer mechanism for programmatic bootstrapping
|
||||
* added Servlet 3.0 based StandardServletMultipartResolver
|
||||
* added "packagesToScan" feature to LocalContainerEntityManagerFactoryBean (avoiding persistence.xml)
|
||||
* fixed JPA 2.0 timeout hints to correctly specify milliseconds
|
||||
* added support for shutdown scripts to DataSourceInitializer (see "databaseCleaner" property)
|
||||
* added "separator" and "execution" attributes to jdbc:script element
|
||||
* revised cache abstraction to focus on minimal atomic access operations
|
||||
* updated Quartz package to support Quartz 1.8 as well (note: not fully supporting Quartz 2.0 yet)
|
||||
* RemoteExporter uses an opaque proxy for 'serviceInterface' (no AOP interfaces exposed)
|
||||
* introduced AnnotationConfigContextLoader to provide TestContext support for @Configuration classes
|
||||
* introduced @ActiveProfiles for declarative configuration of bean definition profiles in tests
|
||||
* TestContext generates context cache key based on all applicable configuration metadata
|
||||
* deprecated AbstractJUnit38SpringContextTests and AbstractTransactionalJUnit38SpringContextTests
|
||||
|
||||
|
||||
Changes in version 3.1 M1 (2011-02-11)
|
||||
--------------------------------------
|
||||
|
||||
* upgraded to JUnit 4.8.1 and TestNG 5.12.1
|
||||
* fixed aspects bundle to declare dependencies for @Async aspect as well
|
||||
* introduced Environment abstraction with flexible placeholder resolution
|
||||
* introduced support for environment profiles in XML bean definition files
|
||||
* introduced @Profile annotation for configuration classes and individual component classes
|
||||
* introduced PropertySourcesPlaceholderConfigurer as alternative to PropertyPlaceholderConfigurer
|
||||
* introduced "c:" namespace for constructor argument shortcuts (analogous to the "p:" namespace)
|
||||
* introduced @FeatureConfiguration classes with @Feature methods that return FeatureSpecifications
|
||||
* added TxAnnotationDriven, MvcAnnotationDriven, etc. as out-of-the-box FeatureSpecifications
|
||||
* introduced caching abstraction and cache annotation support
|
||||
* moved EhCache FactoryBeans from context-support to context module
|
||||
* EhCacheManagerFactoryBean properly closes "ehcache.xml" input stream, if any
|
||||
* exceptions thrown by @Scheduled methods will be propagated to a registered ErrorHandler
|
||||
* ProxyCreationContext uses "ThreadLocal.remove()" over "ThreadLocal.set(null)" as well
|
||||
* BeanDefinitionVisitor now actually visits factory method names
|
||||
* fixed potential InjectionMetadata NPE when using SpringBeanAutowiringInterceptor
|
||||
* fixed AbstractBindingResult to avoid NPE in "hashCode()" if target is null
|
||||
* Servlet/PortletRequestDataBinder perform unwrapping for MultipartRequest as well
|
||||
* ResourceHttpRequestHandler does not set Content-Length header for 304 response
|
||||
* LocaleChangeInterceptor validates locale values in order to prevent XSS vulnerability
|
||||
|
||||
|
||||
Changes in version 3.0.5 (2010-10-20)
|
||||
-------------------------------------
|
||||
|
||||
* support for Hibernate 3.6 final
|
||||
* added core serializer abstraction with default implementations using Java Serialization
|
||||
* consistent use of JDK 1.5's "ThreadLocal.remove()" over "ThreadLocal.set(null)"
|
||||
* fixed JodaTimeContextHolder to use a non-inheritable ThreadLocal and expose a reset method
|
||||
* revised "ClassUtils.isAssignable" semantics to cover primitives vs wrappers in both directions
|
||||
* optimized AnnotationUtils findAnnotation performance for repeated search on same interfaces
|
||||
* ConversionService protects itself against infinite recursion in ObjectToCollectionConverter
|
||||
* fixed TypeDescriptor to correctly resolve nested collections and their element types
|
||||
* BeanWrapper does not attempt to populate Map values on access (just auto-grows Map itself)
|
||||
* fixed Autowired/CommonAnnotationBeanPostProcessor to prevent race condition in skipping check
|
||||
* fixed @Value injection to correctly cache temporary null results for non-singleton beans
|
||||
* ApplicationContext registers context-specific ClassArrayEditor for its bean ClassLoader
|
||||
* refined ApplicationContext singleton processing to not fail for manually registered null instances
|
||||
* fixed ApplicationContext event processing for repeated invocations to non-singleton listener beans
|
||||
* optimized @Bean error messages for static factory methods as well as for argument type mismatches
|
||||
* modified expression parsing to pass full TypeDescriptor context through to ConversionService calls
|
||||
* adapted expression parser's Constructor/MethodResolver to accept TypeDescriptors instead of raw types
|
||||
* SpEL supports projection on any kind of Collection (not just on Lists and arrays)
|
||||
* SpEL MapAccessor consistently rejects "target.key" style access to Maps if no such key is found
|
||||
* SpEL method invocations prefer method with fewest parameters (e.g. no-arg over vararg)
|
||||
* AspectJExpressionPointcut uses bean ClassLoader for initializing the AspectJ pointcut parser
|
||||
* added AnnotationAsyncExecutionAspect as AspectJ-based variant of @Async processing
|
||||
* added mode="proxy"/"aspectj" and proxy-target-class options to task:annotation-driven
|
||||
* JDBC bundle uses local ClassLoader as bean ClassLoader for "sql-error-codes.xml" parsing
|
||||
* EmbeddedDatabaseFactory shuts down database when failing to populate it in "initDatabase()"
|
||||
* embedded database support now also works with Derby >= 10.6
|
||||
* "jdbc:embedded-database" uses id as database name to allow multiple ones in parallel
|
||||
* ResourceDatabasePopulator throws descriptive ScriptStatementFailedException with resource details
|
||||
* added configurable Connection/Statement/ResultSet target types to Jdbc4NativeJdbcExtractor
|
||||
* added OracleJdbc4NativeJdbcExtractor with pre-configured Oracle JDBC API types
|
||||
* DefaultLobHandler's "wrapAsLob" mode works with PostgreSQL's "getAsciiStream()" requirement
|
||||
* ResultSetWrappingSqlRowSet (as used by JdbcTemplate's "queryForRowSet") supports column labels now
|
||||
* LocalSessionFactoryBean's "entityCacheStrategies" works with region names on Hibernate 3.6 as well
|
||||
* fixed DefaultMessageListenerContainer's no-message-received commit to work without Session caching
|
||||
* DefaultMessageListenerContainer's skips no-message-received commit on Tibco (avoiding a deadlock)
|
||||
* JaxWsPortClientInterceptor does not fall back to annotation-specified name as portName anymore
|
||||
* UriTemplate is serializable now
|
||||
* fixed AnnotationMethodHandlerAdapter's caching to avoid concurrency issues in RequestMappingInfo
|
||||
* fixed @MVC processing of parameter-level annotations to work with interface-based proxies again
|
||||
* revised @RequestParam processing to support CSV-to-array/collection binding with ConversionService
|
||||
* fixed EvalTag's EvaluationContext caching to properly handle JSP tag caching across requests
|
||||
* AbstractJasperReportsView only sets locale model attributes if not present already
|
||||
* DispatcherPortlet throws custom NoHandlerFoundException instead of misleading UnavailableException
|
||||
* DispatcherPortlet copies all action parameters to render parameters in case of an action exception
|
||||
* DispatcherPortlet's default resource serving explicitly prevents access to WEB-INF and META-INF
|
||||
* Portlet @ExceptionHandler methods allow for writing the response directly (like in the Servlet case)
|
||||
* MockHttpServletRequest/HttpSession/etc returns independent Enumeration from "getAttributeNames()"
|
||||
|
||||
|
||||
Changes in version 3.0.4 (2010-08-19)
|
||||
-------------------------------------
|
||||
|
||||
* support for Hibernate Core 3.6, Hibernate Validator 4.1, EclipseLink 2.1, EHCache 2.2
|
||||
* OSGi manifest version range accepts EHCache 2.x as well
|
||||
* added "contentLength()" method to Resource abstraction
|
||||
* URL-based Resource variants introspect "last-modified" and "content-length" response headers
|
||||
* refined "exists()" check for UrlResource (HEAD request) and ClassPathResource (URL resolution)
|
||||
* ConversionService is able to deal with empty collections and nested collections (fixed regression)
|
||||
* ConversionService properly handles nested Resource arrays in Map values (fixed regression)
|
||||
* ConversionService does not accidentally use copy constructor for same type
|
||||
* fixed double ConversionFailedException nesting for ObjectToObjectConverter invocations
|
||||
* BeanWrapper preserves annotation information for individual array/list/map elements
|
||||
* Spring's constructor resolution consistently finds non-public multi-arg constructors
|
||||
* revised constructor argument caching, avoiding a race condition for converted argument values
|
||||
* SpEL passes full collection type context (generics, annotations) to ConversionService
|
||||
* SpEL 'select last' operator now works consistently with maps
|
||||
* BeanWrapper/DataBinder's "autoGrowNestedPaths" works for Maps as well
|
||||
* fixed concurrency issue in TypedStringValue, showing for nested typed Maps in prototype beans
|
||||
* fixed WeakReferenceMonitor to never stop its monitoring thread if an entry has been registered
|
||||
* fixed CronTrigger to correctly parse month parts expressed as numbers (1-12 instead of 0-11)
|
||||
* TaskExecutorFactoryBean (as used by task:executor) exposes full ThreadPoolTaskExecutor type
|
||||
* JmsResourceHolder does not ignore IllegalStateException from locally synchronized transaction
|
||||
* fixed JMS CachingConnectionFactory to correctly cache a producer without fixed destination as well
|
||||
* DefaultMessageListenerContainer triggers Session commit even if no message has been received
|
||||
* DefaultMessageListenerContainer supports client id setting even for non-shared Connections
|
||||
* Spring's MessageEndpointFactory classes are now JCA 1.6 compliant as well
|
||||
* AbstractJaxWsServiceExporter supports "bindingType" bean property, overriding @BindingType
|
||||
* AbstractJaxWsServiceExporter supports "webServiceFeatures" bean property on JAX-WS 2.2
|
||||
* JaxWsPortProxyFactoryBean takes "wsdlDocumentUrl", "namespaceUri" etc defaults from @WebService
|
||||
* Jaxb2Marshaller's "marshallerProperties" Map accepts any value type
|
||||
* SpringTemplateLoader for FreeMarker supports last-modified timestamp through Resource abstraction
|
||||
* HibernateJpaDialect correctly closes borrowed connections even for nested JDBC executions
|
||||
* DefaultJdoDialect supports JDO 3.0 query timeout facility (as supported by DataNucleus 2.1)
|
||||
* transaction names based on method id from most specific method (target class instead of interface)
|
||||
* added "validationMessageSource" to LocalValidatorFactoryBean, for Spring-based validation messages
|
||||
* Spring field error arguments include actually declared annotation attributes in alphabetical order
|
||||
* JSR-303 Pattern message resolvable through Spring MessageSource (despite special characters)
|
||||
* DispatcherServlet applies default view name translation to error views as well
|
||||
* mvc:annotation-driven reliably detects JSR-303 and JAXB2 in an OSGi environment as well
|
||||
* revised @MVC handler method resolution with respect to handler methods on generic interfaces
|
||||
* @MVC handler methods reliably resolve MultipartRequest arguments with HiddenHttpMethodFilter
|
||||
* WebDataBinder and @MVC request params detect and introspect MultipartFile arrays as well
|
||||
* fixed @PathVariable regression in combination with ConversionService usage on DataBinder
|
||||
* @CookieValue returns decoded cookie value in a Servlet environment (analogous to @RequestParam)
|
||||
* MVC HandlerExceptionResolvers prevent caching for exception views if preventResponseCaching=true
|
||||
* @ExceptionHandler works for inherited method and CGLIB proxies on Portlet controllers as well
|
||||
* Portlet @MVC's implicit render model will be updated at the end of the event phase
|
||||
* Portlet AbstractController consistently uses session mutex if "synchronizeOnSession" is active
|
||||
* PortletWrappingController supports Portlet 2.0 resource and event requests as well
|
||||
* fixed JSP EvalTag to render null result as empty String instead of "null" String
|
||||
* JSP EvalTag resolves "@myBeanName" references in expressions against the WebApplicationContext
|
||||
* added support for static resource serving: ResourceHttpRequestHandler, mvc:resources
|
||||
* revised DispatcherServlet's last-modified handling to properly work with scoped controllers
|
||||
* MockMultipartHttpServletRequest pre-defines method "POST" and content type "multipart/form-data"
|
||||
|
||||
|
||||
Changes in version 3.0.3 (2010-06-15)
|
||||
-------------------------------------
|
||||
|
||||
* Spring autodetects JodaTime 1.3 or higher (as required), ignoring older JodaTime versions
|
||||
* clarified that Spring's Jackson support requires Jackson 1.3 or higher
|
||||
* JPA 2.0 support tested and supported with Hibernate 3.5.2 and OpenJPA 2.0.0 GA as well
|
||||
* revised VFS support for Spring's component scanning to work on JBoss AS 6.0.0 M3 as well
|
||||
* fixed URIEditor's URI construction to consider fragment as well
|
||||
* added default InputSourceEditor for SAX InputSource construction with a URL String as system id
|
||||
* CachedIntrospectionResults only caches GenericTypeAwarePropertyDescriptors if fully safe
|
||||
* revised BeanWrapper's exception wrapping to consistently handle ConversionExceptions
|
||||
* DefaultListableBeanFactory checks for alias circle on registerAlias (avoiding endless loop)
|
||||
* ConversionService is able to apply Converters to interface-based array elements
|
||||
* ConversionService fully supports conversion from String to MediaType now (through 'valueOf')
|
||||
* revised exception handling in ObjectToObjectConverter, avoiding InvocationTargetExceptions
|
||||
* a context ConversionService is able to override an ApplicationContext's resource editors
|
||||
* refined LifecycleProcessor exception handling, properly wrapping a start exception from a bean
|
||||
* revised DefaultLifecycleProcessor's handling of circular dependencies to avoid stack overflow
|
||||
* fixed constructor argument caching for prototypes with multiple constructor matches
|
||||
* specific detection of CGLIB subclasses in order to properly handle CGLIB interfaces
|
||||
* registerDependentBean resolves to the canonical bean name in order to handle alias references
|
||||
* fixed registerResolvableDependency mechanism to correctly handle non-serializable factory objects
|
||||
* added "expose-proxy" attribute to aop namespace (enforcing AopContext proxy exposure with CGLIB)
|
||||
* revised AbstractInterceptorDrivenBeanDefinitionDecorator for further alignment with auto-proxying
|
||||
* BeanDefinitionVisitor/PropertyPlaceholderConfigurer finds and resolves values in arrays as well
|
||||
* property placeholders can deal with nested expressions which happen to use the same suffix
|
||||
* SpEL's Elvis operator is able to deal with #{${myProp}?:defaultValue} case if myProp is empty
|
||||
* introduced EmbeddedValueResolverAware callback interface for convenient placeholder resolution
|
||||
* @Transactional qualifier value matches against @Qualifier annotations on @Bean methods as well
|
||||
* setTransactionIsolation on JDBC Connection only called when actually necessary (for PostgreSQL)
|
||||
* added limit for parsed SQL cache to NamedParameterJdbcTemplate (default is 256; configurable)
|
||||
* CachingConnectionFactory detects destination equality for WebSphere MQ as well (using toString)
|
||||
* DefaultPersistenceUnitManager's getPersistenceUnitInfo method has 2.5 compatible signature again
|
||||
* DefaultMessageListenerContainer reacts to maxConcurrentConsumers reduction for long-lived tasks
|
||||
* added "idleConsumerLimit" bean property to DefaultMessageListenerContainer (default is 1)
|
||||
* AsyncAnnotationBeanPostProcessor consistently adds @Async processing as first Advisor in the chain
|
||||
* ScheduledTaskRegistrar (as used for @Scheduled processing) properly shuts down its default executor
|
||||
* CronTrigger defensively protects itself against accidental re-fires if a task runs too early
|
||||
* MailSendException includes all messages as failed messages in case of a connect failure
|
||||
* added support for JAX-WS 2.1 WebServiceFeatures to JaxWsPortClientInterceptor/PortProxyFactoryBean
|
||||
* added XmlAwareFormHttpMessageConverter, taking over the 3.0.2-introduced XML multipart support
|
||||
* ServletContextResourcePatternResolver handles "/WEB-INF/lib/*.jar!/**/context.xml" style patterns
|
||||
* fixed MVC mapping regression for servlet url-pattern "/" case on servers other than WebSphere
|
||||
* MVC mappings properly apply even to welcome file entries that forward to a DispatcherServlet
|
||||
* fixed @ExceptionHandler resolution in case of multiple matches at different inheritance levels
|
||||
* revised Portlet SessionStatus.setComplete() to avoid re-exposure of attributes in render phase
|
||||
* shortened Portlet MVC's implicit model render parameter name to "implicitModel"
|
||||
* added convenient "checkRefresh" bean property to TilesConfigurer
|
||||
* TilesConfigurer's "definitionsFactoryClass" property applies common Tiles DefinitionsFactory setup
|
||||
* JSP FormTag calculates proper default form action even when using a rewrite filter on WebSphere
|
||||
* JSP HiddenInputTag allows for using common HTML attributes (equivalent to LabelTag)
|
||||
* fixed JSP ErrorsTag to avoid invalid "*.errors" id, using form object name as id prefix instead
|
||||
* fixed JSP SelectTag's support for rendering enum constants
|
||||
* JSP Radiobutton/CheckboxesTag utilizes PropertyEditor/ConversionService for label rendering
|
||||
* MockHttpServletResponse supports multiple includes
|
||||
|
||||
|
||||
Changes in version 3.0.2 (2010-04-02)
|
||||
-------------------------------------
|
||||
|
||||
* fixed cross-module version ranges in OSGi manifests
|
||||
* fixed contents of org.springframework.web.struts jar
|
||||
* upgraded to Hibernate Validator 4.0.2 and Jackson 1.4.2
|
||||
* compatibility with Hibernate 3.5 final (native and also as a JPA 2.0 provider)
|
||||
* compatibility with OpenJPA 2.0 (support for JPA 2.0 persistence.xml versioning)
|
||||
* compatibility with Hessian 4.0 (in terms of exception propagation)
|
||||
* compatibility with JasperReports 3.x (in terms of resource management)
|
||||
* restored full compatibility with Servlet 2.4 containers on all VMs
|
||||
* PropertyEditor lookup fallback works on Google App Engine as well
|
||||
* fixed TypeDescriptor/MethodParameter toString for all cases in debug log messages
|
||||
* widened AbstractFactoryBean's "getObjectType" signature to return any Class as well
|
||||
* BeanPostProcessors are allowed to return a null bean value in the middle of the chain
|
||||
* autowire="byType" ignores parameter name when choosing a primary bean, as defined
|
||||
* ObjectFactoryCreatingFactoryBean creates a serializable ObjectFactory reference
|
||||
* added ProviderCreatingFactoryBean, exposing a serializable JSR-330 Provider reference
|
||||
* "conversionService" bean will be ignored if it is not of type ConversionService
|
||||
* revised AbstractInterceptorDrivenBeanDefinitionDecorator for alignment with auto-proxying
|
||||
* SimpleJdbcCall's "returningResultSet" accepts any plain RowMapper now
|
||||
* added public "validateDatabaseSchema" method to Hibernate LocalSessionFactoryBean
|
||||
* HibernateJpaDialect borrows JDBC Connection on demand (supporting aggressive release)
|
||||
* JCA listener containers delegate to wrapped Transaction handle (for Geronimo compatibility)
|
||||
* @Transactional qualifiers work in unit tests as well (TransactionalTestExecutionListener)
|
||||
* @Value processing works in test instances (using the test context framework) as well now
|
||||
* @DirtiesContext is now inherited for class-level usage
|
||||
* NativeWebRequest detects native MultipartRequest when decorated by HiddenHttpMethodFilter
|
||||
* WebRequestInterceptor exposes HttpServletResponse through NativeWebRequest (after downcast)
|
||||
* WebContentInterceptor does not restrict HTTP methods by default anymore
|
||||
* WebApplicationObjectSupport's initServletContext will be called only once in any scenario
|
||||
* DispatcherPortlet passes handler instance into HandlerExceptionResolver for action exception
|
||||
* DispatcherPortlet applies preHandleRender callbacks in case of action exception as well
|
||||
* UrlPathHelper cuts off trailing servlet-path slashes for root mappings (on WebSphere)
|
||||
* introduced support for HttpEntity and ResponseEntity wrappers, adding context to body values
|
||||
* fixed DataBinder's conversion error handling for direct field access with ConversionService
|
||||
* @InitBinder methods support all applicable Spring 3.0 parameter annotations as well
|
||||
* fixed @RequestParam(required=false) regression for @InitBinder methods
|
||||
* @ExceptionHandler methods consistently receive original exception
|
||||
* fixed indexed property binding regression in form tag library
|
||||
* fixed @Configurable issue with null bean name
|
||||
|
||||
|
||||
Changes in version 3.0.1 (2010-02-18)
|
||||
-------------------------------------
|
||||
|
||||
* upgraded to AspectJ 1.6.8
|
||||
* full support for JPA 2.0 persistence schema and PersistenceUnitInfo SPI
|
||||
* support for JPA PersistenceContext/Unit injection on Google App Engine
|
||||
* support for Hibernate 3.5 (as native Hibernate API and as JPA 2.0 provider)
|
||||
* support for Tiles 2.2.1 (preserving compatibility with Tiles 2.1.2 and above)
|
||||
* consistent treatment of unresolvable placeholders for Resource and Resource array properties
|
||||
* ConversionFailedException exDLBFposes offending value through public "getValue()" method
|
||||
* fixed BeanFactory's "getBeansWithAnnotation" to ignore beans with non-determinable type
|
||||
* widened FactoryBean's "getObjectType" signature to return any Class (Class<?>)
|
||||
* do not ever consider Object as a candidate type for autowiring by type (autowire="byType")
|
||||
* BeanDefinitionReader and ClassPath/FileSystemXmlApplicationContext use varargs where possible
|
||||
* introduced BeanDefinitionRegistryPostProcessor extension to BeanFactoryPostProcessor
|
||||
* @Configuration classes support definition of BeanFactoryPostProcessor beans
|
||||
* component-scan's scoped-proxy attribute applies to scope-annotated singleton beans as well
|
||||
* generic ApplicationListener event type gets detected through AOP proxy as well
|
||||
* ApplicationListeners will only be executed once per event (even for scripted objects)
|
||||
* ApplicationListeners will get detected lazily as well (e.g. on @Bean's concrete result)
|
||||
* inner bean ApplicationListeners will be invoked through their proxy (if any)
|
||||
* fixed SimpleApplicationEventMulticaster's retriever caching to allow for proper removal
|
||||
* context-specific "conversionService" bean may refer to annotation-configured converter beans
|
||||
* refined DefaultLifecycleProcessor's start/stop logging and stop exception handling
|
||||
* DefaultLifecycleProcessor allows for overriding specific hooks in subclasses
|
||||
* BeanNameAutoProxyCreator detects alias matches for specified bean names
|
||||
* proxies with AspectJ pointcuts are fully serializable within a BeanFactory now
|
||||
* SharedEntityManagerCreator's EntityManager proxies are fully serializable now
|
||||
* Query call chaining works with shared EntityManager proxy outside of transaction as well
|
||||
* TransactionInterceptor is able to serialize "transactionManagerBeanName" as well
|
||||
* non-matching @Transactional qualifier value will lead to IllegalStateException
|
||||
* fixed WebSphereUowTransactionManager regression: correctly roll back in case of exception
|
||||
* JndiObjectFactoryBean explicitly only chooses public interfaces as default proxy interfaces
|
||||
* added vararg variants of query methods to JdbcTemplate (as known from SimpleJdbcTemplate)
|
||||
* MBeanClientInterceptor/MBeanProxyFactoryBean understands CompositeData/TabularData arrays
|
||||
* added "workManagerMBeanName" property to JBossWorkManagerTaskExecutor
|
||||
* task:executor's id value is now used as thread name prefix of ThreadPoolTaskExecutor
|
||||
* fixed @Scheduled processing to kick in once only even in an ApplicationContext hierarchy
|
||||
* fixed MediaType's Comparable behavior to do a full comparison, aligned with equals behavior
|
||||
* added "sortBySpecificity" method to MediaType, for typical use with accept header matching
|
||||
* MimeMessageHelper encodes from, to, cc, bcc String addresses with given encoding as well
|
||||
* changed HttpStatus.REQUEST_TOO_LONG constant to REQUEST_ENTITY_TOO_LARGE
|
||||
* relaxed generic Class declaration in HttpMessageConverter's canRead/canWrite/read signatures
|
||||
* fixed "mvc:view-controller" to work in a fully isolated fashion on Spring Dynamic Modules
|
||||
* DefaultRequestToViewNameTranslator strips trailing slashes as well (can also be turned off)
|
||||
* @RequestParam/RequestHeader/CookieValue's defaultValue allows for declaring empty String
|
||||
* @SessionAttributes works when used on an annotated controller interface with AOP proxying
|
||||
* WebRequest is a resolvable dependency in Servlet/Portlet web application contexts
|
||||
* revised JSP-based views to never fail when trying to set Servlet API forward attributes
|
||||
* lenient evaluation of boolean 'true' attribute expressions in JSP form tag library
|
||||
* added new spring:eval tag for evaluating SpEL expressions from JSP pages
|
||||
* SpringBeanAutowiringSupport works in extra ClassLoaders as well (e.g. WebLogic JAX-WS)
|
||||
|
||||
|
||||
Changes in version 3.0.0.GA (2009-12-16)
|
||||
----------------------------------------
|
||||
|
||||
* component scanning autodetects the new EE 6 "javax.annotation.ManagedBean" stereotype
|
||||
* updated JPA 2.0 support to the final spec (tested compatibility with EclipseLink 2.0 GA)
|
||||
* full support for GlassFish V3 GA (includes component scanning and load-time weaving)
|
||||
* upgraded to JRuby 1.4 (while remaining compatible with JRuby 1.1 and above)
|
||||
* bean property names are matched leniently ("title" and "Title"; "ISBN" and "iSBN")
|
||||
* bean properties of type enum array/collection can be populated with comma-separated String
|
||||
* removed getBeansWithAnnotation(Class,boolean,boolean) method from ListableBeanFactory
|
||||
* PropertyPlaceholderConfigurer is compatible with Spring 2.5 extensions (again)
|
||||
* SmartLifecycle beans will get auto-started on demand even if marked as lazy-init
|
||||
* MBeanExporter detects FactoryBean-exported resources independent from declaration order
|
||||
* refactored SpelExpressionParser to accept SpelParserConfiguration object with boolean flags
|
||||
* revised TypeDescriptor's valueOf and forObject factory methods with some level of caching
|
||||
* revised GenericConverter's "getConvertibleTypes" signature to return Set of ConvertiblePair
|
||||
* GenericConversionService prefers matches against inherited interfaces over superclasses
|
||||
* renamed ConverterRegistry's addGenericConverter(GenericConverter) method to addConverter
|
||||
* no default converters for Object-to-Map and Map-To-Object anymore
|
||||
* default converter for String-to-Properties parsing only applies for actual Properties objects
|
||||
* default ObjectToStringConverter only stringifies objects that indicate proper toString behavior
|
||||
* added "converters" property to FormattingConversionServiceFactoryBean as well
|
||||
* full support for formatters and formatting annotations on array/collection elements
|
||||
* no default number formatter (relying on plain java.lang.Number parsing and rendering)
|
||||
* no default formatters for Date/Calendar (requiring explicit use of @DateTimeFormat)
|
||||
* BeanValidationPostProcessor runs in before-initialization phase (before init methods) by default
|
||||
* removed MultipartRequest mixin interface again (avoiding a package dependency cycle)
|
||||
* revised RestTemplate method signatures to accept Object values instead of just Strings
|
||||
* revised path variable extraction to properly deal with dots in variable values (again)
|
||||
* reintroduced createBinder template method in Servlet/Portlet AnnotationMethodHandlerAdapter
|
||||
|
||||
|
||||
Changes in version 3.0.0.RC3 (2009-12-01)
|
||||
-----------------------------------------
|
||||
|
||||
* prepared for Grails and ROO requirements
|
||||
* restored compatibility with Apache CXF
|
||||
* fixed bean definition import via "classpath*:" URLs
|
||||
* added chaining-capable "add" method to MutablePropertyValues
|
||||
* constructor arguments can be overridden by name in child bean definitions
|
||||
* BeanDefinitions return isSingleton()=true by default again, with scope name empty
|
||||
* init/destroy methods get processed in the order of declaration at each hierarchy level
|
||||
* fixed lookup of LifecycleProcessor bean in a Spring Dynamic Modules environment
|
||||
* refined lifecycle processing through introduction of startup/shutdown phases
|
||||
* fixed transaction synchronization setup with TransactionAwareDataSourceProxy involved
|
||||
* added support for Hibernate 3.3 RegionFactory cache SPI to LocalSessionFactoryBean
|
||||
* JSR-303 SpringValidatorAdapter uses field name as first argument (analogous to bind errors)
|
||||
* replaced DefaultConversionService with ConversionServiceFactory(Bean)
|
||||
* revised FormatterRegistry interface and FormattingConversionServiceFactoryBean setup
|
||||
* mvc:annotation-driven exposes default Validator and ConversionService as top-level beans
|
||||
* mvc:annotation-driven registers applicable HttpMessageConverters by default, if available
|
||||
* added interceptors support to mvc namespace, for path-based interceptor mappings
|
||||
|
||||
|
||||
Changes in version 3.0.0.RC2 (2009-11-13)
|
||||
-----------------------------------------
|
||||
|
||||
* updated to final versions of JSR-330 "javax.inject" and JSR-303 "javax.validation" APIs
|
||||
* full compliance with the JSR-330 TCK (i.e. full compliance with the final specification)
|
||||
* support for Hibernate Validator 4.0 GA (as the JSR-303 reference implementation)
|
||||
* added support for load-time weaving in JBoss 5.x
|
||||
* added support for recent EHCache 1.6 configuration properties to EHCacheFactoryBean
|
||||
* added AnnotatedBeanDefinitionReader helper for programmatic registration of annotated classes
|
||||
* added AnnotationConfig(Web)ApplicationContext for convenient registration/scanning of classes
|
||||
* added GenericXmlApplicationContext with flexible configuration options for its XML support
|
||||
* AbstractApplicationContext can also start up in case of system properties access failure
|
||||
* internal MergedBeanDefinitionPostProcessors apply after all other post-processors
|
||||
* inner beans detected as ApplicationListeners as well (only supported for inner singletons)
|
||||
* child bean definition's scope attribute can be inherited from parent bean definition now
|
||||
* introduced SmartLifecycle interface with auto-startup and shutdown order support
|
||||
* introduced LifecycleProcessor delegate, customizable through "lifecycleProcessor" bean
|
||||
* MessageListenerContainers and Quartz SchedulerFactoryBean start up on refresh instead of init
|
||||
* added initialize-database tag to jdbc namespace for populating external data sources with data
|
||||
* PathMatchingResourcePatternResolver leniently ignores non-existing root directories
|
||||
* DefaultConversionService understands "on"/"off", "yes"/"no", "1"/"0" as boolean values
|
||||
* CustomEditorConfigurer supports PropertyEditor instances again (with deprecation warning)
|
||||
* revised MethodParameter's annotation accessor methods
|
||||
* ClassUtils is now parameterized with Class<?> and Class<T> where appropriate
|
||||
* DataBinder now accepts var-args to set allowed, disallowed, and required fields
|
||||
* DataBinder auto-grows nested paths on traversal (avoiding NullValueInNestedPathException)
|
||||
* fixed enum binding regression with WebRequestDataBinder (as used by @MVC data binding now)
|
||||
* fixed FieldError to expose rejected input value as String value instead of as array
|
||||
* JSR-303 Validator will only register validation failures if no binding failure happened
|
||||
* ContentNegotiatingViewResolver works with ignoreAcceptHeader and defaultContentType as well
|
||||
* added Spring MVC namespace, with convenient mvc:annotation-driven configuration element
|
||||
* default number and datetime formatters configured when using the Spring MVC namespace
|
||||
* full support for datetime formatting using the Joda Time library (automatically enabled)
|
||||
* added convenient @NumberFormat and @DateTimeFormat annotations for declarative formatting
|
||||
* implicit T.valueOf(S) and constructor T(S) lookup if no explicit S->T converter matches
|
||||
* AbstractExcelView is compatible with Apache POI 3.0 as well as 3.5 now
|
||||
* TilesConfigurer only sets up EL support if JSP 2.1 is present (for JSP 2.0 compatibility)
|
||||
* re-introduced Struts 1.x support ("org.springframework.web.struts") in deprecated form
|
||||
* deprecated scheduling support for JDK 1.3 Timer ("org.springframework.scheduling.timer")
|
||||
* deprecated remoting support for JAX-RPC (in favor of JAX-WS)
|
||||
|
||||
|
||||
Changes in version 3.0.0.RC1 (2009-09-25)
|
||||
-----------------------------------------
|
||||
|
||||
* upgraded to CGLIB 2.2, AspectJ 1.6.5, Groovy 1.6.3, EHCache 1.6.2, JUnit 4.7, TestNG 5.10
|
||||
* introduced early support for JSR-330 "javax.inject" annotations (for autowiring)
|
||||
* introduced early support for JSR-303 Bean Validation (setup and MVC integration)
|
||||
* added default editors for "java.util.Currency" and "java.util.TimeZone"
|
||||
* refined PathMatchingResourcePatternResolver's treatment of non-readable directories
|
||||
* PathMatchingResourcePatternResolver understands VFS resources (i.e. works on JBoss 5.x)
|
||||
* revised AccessControlContext access from BeanFactory
|
||||
* AbstractBeanDefinitionParser can deal with null return value as well
|
||||
* PropertyOverrideConfigurer's "ignoreInvalidKeys" ignores invalid property names as well
|
||||
* PropertyPlaceholderConfigurer supports "${myKey:myDefaultValue}" defaulting syntax
|
||||
* BeanFactory's default type conversion falls back to String constructor on target type
|
||||
* BeanFactory tries to create unknown collection implementation types via default constructor
|
||||
* BeanFactory supports ObjectFactory as a dependency type for @Autowired and @Value
|
||||
* BeanFactory supports JSR-330 Provider interface as a dependency type for @Inject
|
||||
* BeanFactory prefers local primary bean to primary bean in parent factory
|
||||
* protected @Autowired method can be overridden with non-annotated method to suppress injection
|
||||
* private @Autowired methods with same signature will be called individually across a hierarchy
|
||||
* @PostConstruct processed top-down (base class first); @PreDestroy bottom-up (subclass first)
|
||||
* ConfigurationClassPostProcessor detect @Bean methods on registered plain bean classes as well
|
||||
* support for default "conversionService" bean in an ApplicationContext
|
||||
* MBeanServerFactoryBean returns JDK 1.5 platform MBeanServer for agent id "" (empty String)
|
||||
* changed NamedParameter/SimpleJdbcOperations parameter signatures to accept any Map value type
|
||||
* refined logging in JMS SingleConnectionFactory and DefaultMessageListenerContainer
|
||||
* introduced "ui.format" package as an alternative to PropertyEditors for data binding
|
||||
* @RequestMapping annotation now supported for annotated interfaces (and JDK proxies) as well
|
||||
* @RequestParam and co support placeholders and expressions in their defaultValue attributes
|
||||
* @Value expressions supported as MVC handler method arguments as well (against request scope)
|
||||
* JSR-303 support for validation of @MVC handler method arguments driven by @Valid annotations
|
||||
* refined response handling for @ExceptionHandler methods
|
||||
* @ResponseStatus usage in handler methods detected by RedirectView
|
||||
* all @SessionAttributes get exposed to the model before handler method execution
|
||||
* @Event/ResourceMapping uniquely mapped to through event/resource id, even across controllers
|
||||
* MultipartRequest is available as a mixin interface on (Native)WebRequest as well
|
||||
* removed outdated "cacheJspExpressions" feature from ExpressionEvaluationUtils
|
||||
* introduced common ErrorHandler strategy, supported by message listener container
|
||||
* Jpa/JdoTransactionManager passes resolved timeout into Jpa/JdoDialect's beginTransaction
|
||||
* HibernateJpaDialect applies timeout onto native Hibernate Transaction before begin call
|
||||
* Spring's Hibernate support is now compatible with Hibernate 3.5 beta 1 as well
|
||||
* Spring's JPA support is now fully compatible with JPA 2.0 as in EclipseLink 2.0.0.M7
|
||||
* SpringJUnit4ClassRunner is now compatible with JUnit 4.5, 4.6, and 4.7
|
||||
* SpringJUnit4ClassRunner once again supports collective timeouts for repeated tests
|
||||
* deprecated @NotTransactional annotation for test classes in favor of @BeforeTransaction
|
||||
|
||||
|
||||
Changes in version 3.0.0.M4 (2009-08-10)
|
||||
----------------------------------------
|
||||
|
||||
* upgraded to JUnit 4.6, TestNG 5.9, and EasyMock 2.5.1
|
||||
* updated all Spring Framework OSGI manifests to list unversioned imports explicitly
|
||||
* relaxed several OSGi bundle dependencies (optional, extended version ranges)
|
||||
* revised Java 6 checks to test for the presence of specific Java 6 interfaces/classes only
|
||||
* replaced Commons Collections dependency with Spring-provided LinkedCaseInsensitiveMap
|
||||
* case-insensitive Maps and key Sets preserve original casing for introspection/logging
|
||||
* constructor argument type matching supports arrays and simple class names now
|
||||
* XML constructor-arg element allows for specifying a constructor argument by name now
|
||||
* XML import elements with relative resource patterns are supported as well now
|
||||
* introduced non-lenient constructor resolution mode for BeanDefinitions (for RFC-124)
|
||||
* revised DefaultListableBeanFactory's access control when running within a SecurityManager
|
||||
* BeanWrapper and DefaultListableBeanFactory accept a custom ConversionService now
|
||||
* DefaultListableBeanFactory references are serializable now when initialized with an id
|
||||
* scoped proxies are serializable now, for web scopes as well as for singleton beans
|
||||
* injected request/session references are serializable proxies for the current request now
|
||||
* Servlet/Portlet ApplicationContexts use a specific id based on servlet/portlet name
|
||||
* ReloadableResourceBundleMessageSource correctly calculates filenames for all locales now
|
||||
* @PostConstruct works for multiple private init methods of the same name in a hierarchy
|
||||
* @Primary/@Lazy/@DependsOn supported as meta-annotations as well
|
||||
* @Bean/@Scope etc supported as meta-annotations on factory methods as well now
|
||||
* @Required does not get processed on beans returned by @Bean factory methods
|
||||
* @Import detects and accepts existing configuration class of the desired type
|
||||
* @Transactional supports qualifier value for choosing between multiple transaction managers
|
||||
* WebSphereUowTransactionManager falls back to UOWManagerFactory lookup by default
|
||||
* JMS SingleConnectionFactory performs start call within connection monitor (for Oracle AQ)
|
||||
* @ManagedResource is marked as inherited now, for generic management-aware base classes
|
||||
* introduced dedicated @ManagedMetric annotation for metric attributes in a JMX environment
|
||||
* added task namespace with scheduler/executor configuration and scheduled task definitions
|
||||
* added jdbc namespace with embedded-database tag (supporting HSQL, H2, and Derby)
|
||||
* Hibernate AnnotationSessionFactoryBean detects Hibernate's special @Entity annotation too
|
||||
* added SimpleJaxWsServiceExporter workaround for WebLogic 10.3's address format requirements
|
||||
* added support for @WebServiceProvider annotation to Spring's JaxWsServiceExporters
|
||||
* updated Hessian support for Hessian 3.2 compatibility (requiring Hessian 3.2 or above now)
|
||||
* updated Tiles support for Tiles 2.1 compatibility (requiring Tiles 2.1.2 or above now)
|
||||
* Velocity/FreeMarker/TilesViewResolver only returns a view if the target resource exists now
|
||||
* @DirtiesContext is now supported at the test class level with configurable class modes
|
||||
* added beforeTestClass() and afterTestClass() to the TestExecutionListener API
|
||||
* ProfileValueUtils now enforces class-level overrides for @IfProfileValue
|
||||
* @ContextConfiguration's loader attribute is now inherited if not declared locally
|
||||
* TransactionalTestExecutionListener no longer flushes transactions before rolling back
|
||||
|
||||
|
||||
Changes in version 3.0.0.M3 (2009-05-06)
|
||||
----------------------------------------
|
||||
|
||||
* Spring 3.0 includes reference documentation now
|
||||
* Spring 3.0 is shipping with proper Maven POMs now
|
||||
* updated to JRuby 1.2 (remaining compatible with JRuby 1.1 and above)
|
||||
* updated to Hessian 3.2.1 (remaining compatible with Hessian 3.1.3 and above)
|
||||
* updated to FreeMarker 2.3.15 (for exposure of FreeMarkerServlet-style HTTP scopes)
|
||||
* removed Axis 1.x support package, keeping basic JAX-RPC support only (next to JAX-WS)
|
||||
* introduced explicit XML array element in spring-beans-3.0.xsd
|
||||
* introduced new type conversion SPI and converter API in spring-core convert package
|
||||
* introduced annotated @Bean factory methods and JavaConfig-style @Configuration classes
|
||||
* introduced @Primary, @Lazy and @DependsOn annotations for scanned components
|
||||
* custom stereotype annotations can be meta-annotated with @Service, @Controller etc as well
|
||||
* @Scope and @Transactional are now supported as meta-annotations on custom annotations
|
||||
* @Autowired uses field/parameter name as fallback qualifier value
|
||||
* qualifier annotations can be used at method level as well (applying to all parameters)
|
||||
* @Value annotation can be used at method level as well (e.g. on bean property setters)
|
||||
* @Value values may use ${...} placeholders (driven by PropertyPlaceholderConfigurer)
|
||||
* @Resource names may use ${...} placeholders (driven by PropertyPlaceholderConfigurer)
|
||||
* fixed EL evaluation of prepared constructor arguments for repeated prototype creation
|
||||
* ConstructorArgumentValues exposed indexed arguments in the order of definition
|
||||
* AutowiredAnnotationBeanPostProcessor calculates cached arguments in a synchronized block
|
||||
* declarative destroy-method="..." specifications get validated at bean creation time
|
||||
* component-scan's "base-package" attribute supports spaces as separators as well
|
||||
* CachedIntrospectionResults always caches bean classes except in case of custom BeanInfo
|
||||
* GenericTypeResolver's type variable cache uses weak values (for OSGi compatibility)
|
||||
* fixed CachingMapDecorator to support garbage-collected weak references (again)
|
||||
* AOP ProxyFactory excludes non-public interfaces when autodetecting proxy interfaces
|
||||
* added DuplicateKeyException to DAO exception hierachy
|
||||
* added EmbeddedDatabase support in spring-jdbc embedded package, with initial HSQL support
|
||||
* SessionAwareMessageListener supports generic declaration of concrete JMS Message type
|
||||
* RmiServiceExporter and RmiRegistryFactoryBean synchronize registry lookup/creation
|
||||
* added "unregisterManagedResource" method to MBeanExporter/MBeanExportOperations
|
||||
* TimerTaskExecutor creates non-daemon Timer and uses bean name as default Timer name
|
||||
* added TaskScheduler interface and Trigger abstraction
|
||||
* added ConcurrentTaskScheduler and ThreadPoolTaskScheduler
|
||||
* added CommonJ TimerManagerTaskScheduler
|
||||
* added CronTrigger implementation for cron expression support
|
||||
* renamed "contextProperties" attribute to "contextParameters" (matching web.xml naming)
|
||||
* "contextParameters" contains Servlet/PortletConfig parameters as well
|
||||
* added default "servletContext" and "servletConfig" environment beans
|
||||
* added default "portletContext" and "portletConfig" environment beans
|
||||
* added default web scope "application", wrapping a ServletContext/PortletContext
|
||||
* JSF FacesContext and ExternalContext are resolvable dependencies by default, if available
|
||||
* FacesRequestAttributes (as used by RequestContextHolder) can access global Portlet session
|
||||
* revised @RequestMapping semantics for REST support purposes
|
||||
* request handler methods with @ModelAttribute annotation always return a model attribute
|
||||
* introduced @ExceptionHandler annotation for used in annotated web controllers
|
||||
* introduced ModelAndViewResolver SPI for custom handler method return types
|
||||
* FreeMarkerView can be initialized with ServletContext only (e.g. for testing)
|
||||
* MockPortletSession supports destruction of session attributes on invalidation
|
||||
* completed upgrade of the TestContext Framework to JUnit 4.5
|
||||
* SpringJUnit4ClassRunner subclasses can now override the default ContextLoader class
|
||||
* added "value" alias for @ContextConfiguration's "locations" attribute
|
||||
|
||||
|
||||
Changes in version 3.0.0.M2 (2009-02-25)
|
||||
----------------------------------------
|
||||
|
||||
* revised expression parser API design
|
||||
* added SimpleThreadScope implementation
|
||||
* refined OSGi version constraints for "javax.annotation" and "junit.framework"
|
||||
* "systemProperties" bean is not considered a default match for type Properties anymore
|
||||
* SimpleAliasRegistry's "getAliases" method returns transitive aliases now
|
||||
* SimpleAliasRegistry detects resolved aliases that loop back to the original name
|
||||
* PropertyPlaceholderConfigurer does not modify Map in case of equal String keys
|
||||
* improved NoClassDefFoundError handling during constructor resolution
|
||||
* inner class names in Java source style ("java.lang.Thread.State") supported as well
|
||||
* pre-converted property values are preserved more eagerly for re-created beans
|
||||
* prototype beans receive independent collection/array even when based on single value
|
||||
* registered plain singletons will be fully matched according to their qualifiers
|
||||
* @Qualifier value matching takes chained aliases of target beans into account as well
|
||||
* ASM-based AnnotationMetadata fully resolves class arguments and enums into Java types
|
||||
* ProceedingJoinPoint resolves parameter names using ASM-based parameter name discovery
|
||||
* MethodInvocations and ProceedingJoinPoints always expose original method (not bridge)
|
||||
* bridge method resolution works with Hibernate-generated CGLIB proxies as well
|
||||
* generic collection type resolution respects upper bound (e.g. ? extends Number) as well
|
||||
* TypeUtils detects variations of ParameterizedType/GenericArrayType assignability as well
|
||||
* ReflectionUtils findMethod detects methods on "java.lang.Object" as well
|
||||
* UrlResource eagerly closes HTTP connections in case of "getInputStream()" failure
|
||||
* PathMatchingResourcePatternResolver avoids NPE when initialized with null ClassLoader
|
||||
* all "taskExecutor" bean properties now accept any "java.util.concurrent.Executor"
|
||||
* added "Future submit(Runnable)" and "Future submit(Callable)" to AsyncTaskExecutor
|
||||
* SimpleAsyncTaskExecutor supports a custom "java.util.concurrent.ThreadFactory"
|
||||
* SchedulingTaskExecutor interface extends AsyncTaskExecutor now
|
||||
* added ThreadPoolExecutorFactoryBean (exposing the native ExecutorService interface)
|
||||
* added ExecutorServiceAdapter class as a standard wrapper for a Spring TaskExecutor
|
||||
* reduced backport-concurrent support to TaskExecutor adapters
|
||||
* added @Async annotation and AsyncAnnotationAdvisor (namespace support coming in M3)
|
||||
* EJB 3.1's @Asynchronous annotation gets detected and supported by default as well
|
||||
* ApplicationListener beans get obtained on demand, supporting non-singletons as well
|
||||
* ApplicationListeners will be called in the order according to the Ordered contract
|
||||
* generified ApplicationListener interface, narrowing the event type to be received
|
||||
* introduced SmartApplicationListener interface for supported event/source types
|
||||
* generified Transaction/Hibernate/Jdo/JpaCallback with generic "doInXxx" return type
|
||||
* HibernateOperations uses generic parameter/return types where possible
|
||||
* JdoOperations uses generic parameter/return types where possible (following JDO 2.1)
|
||||
* removed "flush" operation from JdoDialect (fully relying on JDO 2.0+ compliance now)
|
||||
* added JDO 2.1 compliant StandardPersistenceManagerProxy/SpringPersistenceManagerProxy
|
||||
* Spring-created EntityManagers support JPA 2.0 draft API ("unwrap", "getQueryBuilder")
|
||||
* Spring initiates JPA 2.0 query timeout with remaining Spring transaction timeout
|
||||
* added support for WebSphere's ResourceAdapter-managed messaging transactions
|
||||
* made SpringBeanAutowiringInterceptor callback signature compatible with WebSphere
|
||||
* WebSphereUowTransactionManager preserves original exception in case of rollback
|
||||
* added "flush()" method to TransactionStatus and TransactionSynchronization interfaces
|
||||
* test context manager automatically flushes transactions before rolling back
|
||||
* DefaultLobHandler uses explicit Blob/Clob access for reading when "wrapAsLob"=true
|
||||
* fixed JmsException/JmsUtils to fully avoid NPEs in case of cause messages being null
|
||||
* fixed MessageListenerAdapter's "getSubscriptionName()" to work without delegate as well
|
||||
* fixed HTTP invoker to support resolution of multi-level primitive array classes again
|
||||
* deprecated support for JMS 1.0.2 providers (JmsTemplate102 etc)
|
||||
* introduced top-level HTTP support package "org.springframework.http"
|
||||
* introduced RestTemplate facility in package "org.springframework.web.client"
|
||||
* introduced OXM support package (originating from Spring Web Services)
|
||||
* introduced OXM-based MarshallingMessageConverter for Spring JMS
|
||||
* introduced OXM-based MarshallingView for Spring MVC
|
||||
* refined @PathVariable handling in MVC handler methods
|
||||
* updated Spring Portlet MVC infrastructure and mocks for Portlet API 2.0
|
||||
* added resource and event methods to Portlet HandlerAdapter/HandlerInterceptor
|
||||
* added resolveException method for resource requests to HandlerExceptionResolver
|
||||
* introduced Resource/EventAwareController subinterfaces of Portlet Controller
|
||||
* introduced @Action/@Render/@Resource/@EventMapping annotations for Portlet MVC
|
||||
* added @RequestHeader support for Portlet MVC (based on Portlet request properties)
|
||||
* introduced @CookieValue annotation for Servlet and Portlet MVC handler methods
|
||||
* @RequestMapping type-level param constraints taken into account consistently
|
||||
* optional boolean parameters in MVC handler methods resolve to "false" if not present
|
||||
* "url" macro in "spring.ftl" performs standard Servlet URL encoding automatically
|
||||
|
||||
|
||||
Changes in version 3.0.0.M1 (2008-12-05)
|
||||
----------------------------------------
|
||||
|
||||
* revised project layout and build system (module-based sources, bundle repository)
|
||||
* updated entire codebase for Java 5 code style (generics, varargs, StringBuilder)
|
||||
* updated to JUnit 4.5 and JRuby 1.1
|
||||
* removed WebLogic 8.1 and WebSphere 5.1 support
|
||||
* removed native TopLink API support (superseded by JPA)
|
||||
* removed Commons Attributes support (superseded by Java 5 annotations)
|
||||
* removed Jakarta JSTL support for JSP 1.2 (superseded by JSP 2.0)
|
||||
* removed outdated Struts 1.x Action delegation support
|
||||
* removed ContextLoaderServlet and Log4jConfigServlet
|
||||
* deprecated form controller hierarchy in favor of @MVC form object handling
|
||||
* deprecated JUnit 3.8 test class hierarchy in favor of test context framework
|
||||
* revised TaskExecutor interface to extend "java.util.concurrent.Executor" now
|
||||
* introduced Spring EL parser in org.springframework.expression package
|
||||
* introduced #{...} expression support in bean definitions
|
||||
* introduced @Value annotation for embedded expression support
|
||||
* introduced @PathVariable annotation for MVC handler methods
|
||||
* introduced ShallowEtagHeaderFilter
|
||||
* introduced AbstractAtomFeedView and AbstractRssFeedView
|
||||
* introduced default value support for @RequestParam
|
||||
* introduced @RequestHeader annotation for MVC handler methods
|
||||
* introduced "spring:url" and "spring:param" JSP tags
|
||||
@@ -0,0 +1,261 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
=======================================================================
|
||||
|
||||
SPRING FRAMEWORK 3.1 SUBCOMPONENTS:
|
||||
|
||||
Spring Framework 3.1 includes a number of subcomponents with
|
||||
separate copyright notices and license terms. The product that
|
||||
includes this file does not necessarily use all the open source
|
||||
subcomponents referred to below. Your use of the source
|
||||
code for these subcomponents is subject to the terms and
|
||||
conditions of the following licenses.
|
||||
|
||||
>>> asm-2.2.3:
|
||||
|
||||
Copyright (c) 2000-2005 INRIA, France Telecom
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holders nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Copyright (c) 1999-2009, OW2 Consortium <http://www.ow2.org/>
|
||||
|
||||
=======================================================================
|
||||
|
||||
To the extent any open source subcomponents are licensed under the EPL and/or other
|
||||
similar licenses that require the source code and/or modifications to
|
||||
source code to be made available (as would be noted above), you may obtain a
|
||||
copy of the source code corresponding to the binaries for such open source
|
||||
components and modifications thereto, if any, (the "Source Files"), by
|
||||
downloading the Source Files from http://www.springsource.org/download,
|
||||
or by sending a request, with your name and address to: VMware, Inc., 3401 Hillview
|
||||
Avenue, Palo Alto, CA 94304, United States of America or email info@vmware.com. All
|
||||
such requests should clearly specify: OPEN SOURCE FILES REQUEST, Attention General
|
||||
Counsel. VMware shall mail a copy of the Source Files to you on a CD or equivalent
|
||||
physical medium. This offer to obtain a copy of the Source Files is valid for three
|
||||
years from the date you acquired this Software product.
|
||||
@@ -0,0 +1,9 @@
|
||||
Spring Framework 3.1
|
||||
Copyright (c) 2002-2011 SpringSource, a division of VMware, Inc.
|
||||
|
||||
This product is licensed to you under the Apache License, Version 2.0 (the "License").
|
||||
You may not use this product except in compliance with the License.
|
||||
|
||||
This product may include a number of subcomponents with separate copyright notices and
|
||||
license terms. Your use of the source code for the these subcomponents is subject to
|
||||
the terms and conditions of the subcomponent's license, as noted in the LICENSE file.
|
||||
@@ -0,0 +1,26 @@
|
||||
SPRING FRAMEWORK 3.1.4 (January 2013)
|
||||
-------------------------------------
|
||||
http://www.springsource.org
|
||||
|
||||
1. INTRODUCTION
|
||||
|
||||
Spring Framework 3.1 builds on the Spring Framework 3.0 foundation with
|
||||
a focus on Java-based application configuration and MVC enhancements.
|
||||
|
||||
2. RELEASE NOTES
|
||||
|
||||
This release comes with complete reference documentation. For further
|
||||
details, consult the provided javadoc for specific packages and classes.
|
||||
|
||||
3. DISTRIBUTION JAR FILES
|
||||
|
||||
The Spring Framework module jar files can be found in the 'dist'
|
||||
directory. Note that this release does not contain a 'spring.jar' file
|
||||
anymore, in contrast to previous Spring generations. Furthermore, the jar
|
||||
file names now follow bundle repository conventions.
|
||||
|
||||
4. GETTING STARTED
|
||||
|
||||
Please consult the blog examples at http://blog.springsource.com as well
|
||||
as sections of interest in the reference documentation. Sample
|
||||
applications and related material are provided as separate downloads.
|
||||
-445
@@ -1,445 +0,0 @@
|
||||
plugins {
|
||||
id 'io.spring.dependency-management' version '1.0.11.RELEASE' apply false
|
||||
id 'io.spring.nohttp' version '0.0.10'
|
||||
id 'io.freefair.aspectj' version '6.2.0' apply false
|
||||
id 'org.jetbrains.dokka' version '1.6.10' apply false
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.5.32' apply false
|
||||
id 'org.jetbrains.kotlin.plugin.serialization' version "1.5.32" apply false
|
||||
id 'org.asciidoctor.jvm.convert' version '3.3.2'
|
||||
id 'org.asciidoctor.jvm.pdf' version '3.3.2'
|
||||
id 'org.unbroken-dome.xjc' version '2.0.0' apply false
|
||||
id 'com.github.ben-manes.versions' version '0.39.0'
|
||||
id 'com.github.johnrengelman.shadow' version '7.0.0' apply false
|
||||
id 'de.undercouch.download' version '4.1.2'
|
||||
id 'me.champeau.jmh' version "0.6.6" apply false
|
||||
}
|
||||
|
||||
ext {
|
||||
moduleProjects = subprojects.findAll { it.name.startsWith("spring-") }
|
||||
javaProjects = subprojects - project(":framework-bom")
|
||||
withoutJclOverSlf4j = {
|
||||
exclude group: "org.slf4j", name: "jcl-over-slf4j"
|
||||
}
|
||||
}
|
||||
|
||||
configure(allprojects) { project ->
|
||||
apply plugin: "io.spring.dependency-management"
|
||||
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom "com.fasterxml.jackson:jackson-bom:2.12.7"
|
||||
mavenBom "io.netty:netty-bom:4.1.111.Final"
|
||||
mavenBom "io.projectreactor:reactor-bom:2020.0.45"
|
||||
mavenBom "io.r2dbc:r2dbc-bom:Arabba-SR13"
|
||||
mavenBom "io.rsocket:rsocket-bom:1.1.3"
|
||||
mavenBom "org.eclipse.jetty:jetty-bom:9.4.54.v20240208"
|
||||
mavenBom "org.jetbrains.kotlin:kotlin-bom:1.5.32"
|
||||
mavenBom "org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.5.2"
|
||||
mavenBom "org.jetbrains.kotlinx:kotlinx-serialization-bom:1.2.2"
|
||||
mavenBom "org.junit:junit-bom:5.8.2"
|
||||
}
|
||||
dependencies {
|
||||
dependencySet(group: 'org.apache.logging.log4j', version: '2.21.1') {
|
||||
entry 'log4j-api'
|
||||
entry 'log4j-core'
|
||||
entry 'log4j-jul'
|
||||
entry 'log4j-slf4j-impl'
|
||||
}
|
||||
dependency "org.slf4j:slf4j-api:1.7.36"
|
||||
dependency("com.google.code.findbugs:findbugs:3.0.1") {
|
||||
exclude group: "dom4j", name: "dom4j"
|
||||
}
|
||||
dependency "com.google.code.findbugs:jsr305:3.0.2"
|
||||
|
||||
dependencySet(group: 'org.aspectj', version: '1.9.7') {
|
||||
entry 'aspectjrt'
|
||||
entry 'aspectjtools'
|
||||
entry 'aspectjweaver'
|
||||
}
|
||||
dependencySet(group: 'org.codehaus.groovy', version: '3.0.9') {
|
||||
entry 'groovy'
|
||||
entry 'groovy-jsr223'
|
||||
entry 'groovy-templates' // requires findbugs for warning-free compilation
|
||||
entry 'groovy-test'
|
||||
entry 'groovy-xml'
|
||||
}
|
||||
|
||||
dependency "io.reactivex:rxjava:1.3.8"
|
||||
dependency "io.reactivex:rxjava-reactive-streams:1.2.1"
|
||||
dependency "io.reactivex.rxjava2:rxjava:2.2.21"
|
||||
dependency "io.reactivex.rxjava3:rxjava:3.1.8"
|
||||
dependency "io.smallrye.reactive:mutiny:1.9.0"
|
||||
dependency "io.projectreactor.tools:blockhound:1.0.8.RELEASE"
|
||||
|
||||
dependency "com.caucho:hessian:4.0.63"
|
||||
dependency "com.fasterxml:aalto-xml:1.3.1"
|
||||
dependency("com.fasterxml.woodstox:woodstox-core:6.2.8") {
|
||||
exclude group: "stax", name: "stax-api"
|
||||
}
|
||||
dependency "com.google.code.gson:gson:2.8.9"
|
||||
dependency "com.google.protobuf:protobuf-java-util:3.19.3"
|
||||
dependency "com.googlecode.protobuf-java-format:protobuf-java-format:1.4"
|
||||
dependency("com.thoughtworks.xstream:xstream:1.4.19") {
|
||||
exclude group: "xpp3", name: "xpp3_min"
|
||||
exclude group: "xmlpull", name: "xmlpull"
|
||||
}
|
||||
dependency "org.apache.johnzon:johnzon-jsonb:1.2.18"
|
||||
dependency("org.codehaus.jettison:jettison:1.3.8") {
|
||||
exclude group: "stax", name: "stax-api"
|
||||
}
|
||||
dependencySet(group: 'org.jibx', version: '1.3.3') {
|
||||
entry 'jibx-bind'
|
||||
entry 'jibx-run'
|
||||
}
|
||||
dependency "org.ogce:xpp3:1.1.6"
|
||||
dependency "org.yaml:snakeyaml:1.33"
|
||||
|
||||
dependency "com.h2database:h2:2.1.214"
|
||||
dependency "com.github.ben-manes.caffeine:caffeine:2.9.3"
|
||||
dependency "com.github.librepdf:openpdf:1.3.33"
|
||||
dependency "com.rometools:rome:1.18.0"
|
||||
dependency "commons-io:commons-io:2.5"
|
||||
dependency "io.vavr:vavr:0.10.4"
|
||||
dependency "net.sf.jopt-simple:jopt-simple:5.0.4"
|
||||
dependencySet(group: 'org.apache.activemq', version: '5.16.2') {
|
||||
entry 'activemq-broker'
|
||||
entry('activemq-kahadb-store') {
|
||||
exclude group: "org.springframework", name: "spring-context"
|
||||
}
|
||||
entry 'activemq-stomp'
|
||||
}
|
||||
dependency "org.apache.bcel:bcel:6.0"
|
||||
dependency "org.apache.commons:commons-pool2:2.9.0"
|
||||
dependencySet(group: 'org.apache.derby', version: '10.14.2.0') {
|
||||
entry 'derby'
|
||||
entry 'derbyclient'
|
||||
}
|
||||
dependency "org.apache.poi:poi-ooxml:4.1.2"
|
||||
dependency "org.apache-extras.beanshell:bsh:2.0b6"
|
||||
dependency "org.freemarker:freemarker:2.3.31"
|
||||
dependency "org.hsqldb:hsqldb:2.5.2"
|
||||
dependency "org.quartz-scheduler:quartz:2.3.2"
|
||||
dependency "org.codehaus.fabric3.api:commonj:1.1.0"
|
||||
dependency "net.sf.ehcache:ehcache:2.10.6"
|
||||
dependency "org.ehcache:jcache:1.0.1"
|
||||
dependency "org.ehcache:ehcache:3.4.0"
|
||||
dependency "org.hibernate:hibernate-core:5.4.33.Final"
|
||||
dependency "org.hibernate:hibernate-validator:6.2.5.Final"
|
||||
dependency "org.webjars:webjars-locator-core:0.48"
|
||||
dependency "org.webjars:underscorejs:1.8.3"
|
||||
|
||||
dependencySet(group: 'org.apache.tomcat', version: '9.0.82') {
|
||||
entry 'tomcat-util'
|
||||
entry('tomcat-websocket') {
|
||||
exclude group: "org.apache.tomcat", name: "tomcat-servlet-api"
|
||||
exclude group: "org.apache.tomcat", name: "tomcat-websocket-api"
|
||||
}
|
||||
}
|
||||
dependencySet(group: 'org.apache.tomcat.embed', version: '9.0.82') {
|
||||
entry 'tomcat-embed-core'
|
||||
entry 'tomcat-embed-websocket'
|
||||
}
|
||||
dependencySet(group: 'io.undertow', version: '2.2.29.Final') {
|
||||
entry 'undertow-core'
|
||||
entry('undertow-servlet') {
|
||||
exclude group: "org.jboss.spec.javax.servlet", name: "jboss-servlet-api_4.0_spec"
|
||||
exclude group: "org.jboss.spec.javax.annotation", name: "jboss-annotations-api_1.3_spec"
|
||||
}
|
||||
entry('undertow-websockets-jsr') {
|
||||
exclude group: "org.jboss.spec.javax.websocket", name: "jboss-websocket-api_1.1_spec"
|
||||
}
|
||||
}
|
||||
|
||||
dependency "org.eclipse.jetty:jetty-reactive-httpclient:1.1.13"
|
||||
dependency 'org.apache.httpcomponents.client5:httpclient5:5.1.3'
|
||||
dependency 'org.apache.httpcomponents.core5:httpcore5-reactive:5.1.3'
|
||||
dependency("org.apache.httpcomponents:httpclient:4.5.13") {
|
||||
exclude group: "commons-logging", name: "commons-logging"
|
||||
}
|
||||
dependency("org.apache.httpcomponents:httpasyncclient:4.1.5") {
|
||||
exclude group: "commons-logging", name: "commons-logging"
|
||||
}
|
||||
dependencySet(group: 'com.squareup.okhttp3', version: '3.14.9') {
|
||||
entry 'okhttp'
|
||||
entry 'mockwebserver'
|
||||
}
|
||||
|
||||
dependency "org.jruby:jruby:9.2.20.1"
|
||||
dependency "org.python:jython-standalone:2.7.1"
|
||||
dependency "org.mozilla:rhino:1.7.11"
|
||||
|
||||
dependency "commons-fileupload:commons-fileupload:1.4"
|
||||
dependency "org.synchronoss.cloud:nio-multipart-parser:1.1.0"
|
||||
|
||||
dependency("org.dom4j:dom4j:2.1.3") {
|
||||
exclude group: "jaxen", name: "jaxen"
|
||||
exclude group: "net.java.dev.msv", name: "xsdlib"
|
||||
exclude group: "pull-parser", name: "pull-parser"
|
||||
exclude group: "xpp3", name: "xpp3"
|
||||
}
|
||||
dependency("jaxen:jaxen:1.2.0") {
|
||||
exclude group: "dom4j", name: "dom4j"
|
||||
}
|
||||
|
||||
dependency("junit:junit:4.13.2") {
|
||||
exclude group: "org.hamcrest", name: "hamcrest-core"
|
||||
}
|
||||
dependency("de.bechte.junit:junit-hierarchicalcontextrunner:4.12.1") {
|
||||
exclude group: "junit", name: "junit"
|
||||
}
|
||||
dependency "org.testng:testng:7.4.0"
|
||||
dependency "org.junit.support:testng-engine:1.0.4"
|
||||
dependency "org.hamcrest:hamcrest:2.2"
|
||||
dependency "org.awaitility:awaitility:3.1.6"
|
||||
dependency "org.assertj:assertj-core:3.24.2"
|
||||
dependencySet(group: 'org.xmlunit', version: '2.9.0') {
|
||||
entry 'xmlunit-assertj'
|
||||
entry('xmlunit-matchers') {
|
||||
exclude group: "org.hamcrest", name: "hamcrest-core"
|
||||
}
|
||||
}
|
||||
dependencySet(group: 'org.mockito', version: '4.9.0') { // spring-beans tests fail with 4.10+
|
||||
entry('mockito-core') {
|
||||
exclude group: "org.hamcrest", name: "hamcrest-core"
|
||||
}
|
||||
entry 'mockito-junit-jupiter'
|
||||
}
|
||||
dependency "io.mockk:mockk:1.12.1"
|
||||
|
||||
dependency("net.sourceforge.htmlunit:htmlunit:2.70.0") {
|
||||
exclude group: "commons-logging", name: "commons-logging"
|
||||
}
|
||||
dependency("org.seleniumhq.selenium:htmlunit-driver:2.70.0") {
|
||||
exclude group: "commons-logging", name: "commons-logging"
|
||||
}
|
||||
dependency("org.seleniumhq.selenium:selenium-java:3.141.59") {
|
||||
exclude group: "commons-logging", name: "commons-logging"
|
||||
exclude group: "io.netty", name: "netty"
|
||||
}
|
||||
dependency "org.skyscreamer:jsonassert:1.5.0"
|
||||
dependency "com.jayway.jsonpath:json-path:2.7.0"
|
||||
dependency "org.bouncycastle:bcpkix-jdk18on:1.71"
|
||||
|
||||
dependencySet(group: 'org.apache.tiles', version: '3.0.8') {
|
||||
entry 'tiles-api'
|
||||
entry('tiles-core', withoutJclOverSlf4j)
|
||||
entry('tiles-servlet', withoutJclOverSlf4j)
|
||||
entry('tiles-jsp', withoutJclOverSlf4j)
|
||||
entry('tiles-el', withoutJclOverSlf4j)
|
||||
entry('tiles-extras') {
|
||||
exclude group: "org.springframework", name: "spring-web"
|
||||
exclude group: "org.slf4j", name: "jcl-over-slf4j"
|
||||
}
|
||||
}
|
||||
dependency("org.apache.taglibs:taglibs-standard-jstlel:1.2.5") {
|
||||
exclude group: "org.apache.taglibs", name: "taglibs-standard-spec"
|
||||
}
|
||||
|
||||
dependency "com.ibm.websphere:uow:6.0.2.17"
|
||||
dependency "com.jamonapi:jamon:2.82"
|
||||
dependency "joda-time:joda-time:2.10.13"
|
||||
dependency "org.eclipse.persistence:org.eclipse.persistence.jpa:2.7.12"
|
||||
dependency "org.javamoney:moneta:1.3"
|
||||
|
||||
dependency "com.sun.activation:javax.activation:1.2.0"
|
||||
dependency "com.sun.mail:javax.mail:1.6.2"
|
||||
dependencySet(group: 'com.sun.xml.bind', version: '2.3.0.1') {
|
||||
entry 'jaxb-core'
|
||||
entry 'jaxb-impl'
|
||||
entry 'jaxb-xjc'
|
||||
}
|
||||
|
||||
dependency "javax.activation:javax.activation-api:1.2.0"
|
||||
dependency "javax.annotation:javax.annotation-api:1.3.2"
|
||||
dependency "javax.cache:cache-api:1.1.0"
|
||||
dependency "javax.ejb:javax.ejb-api:3.2"
|
||||
dependency "javax.el:javax.el-api:3.0.1-b04"
|
||||
dependency "javax.enterprise.concurrent:javax.enterprise.concurrent-api:1.0"
|
||||
dependency "javax.faces:javax.faces-api:2.2"
|
||||
dependency "javax.inject:javax.inject:1"
|
||||
dependency "javax.inject:javax.inject-tck:1"
|
||||
dependency "javax.interceptor:javax.interceptor-api:1.2.2"
|
||||
dependency "javax.jms:javax.jms-api:2.0.1"
|
||||
dependency "javax.json:javax.json-api:1.1.4"
|
||||
dependency "javax.json.bind:javax.json.bind-api:1.0"
|
||||
dependency "javax.mail:javax.mail-api:1.6.2"
|
||||
dependency "javax.money:money-api:1.0.3"
|
||||
dependency "javax.resource:javax.resource-api:1.7.1"
|
||||
dependency "javax.servlet:javax.servlet-api:4.0.1"
|
||||
dependency "javax.servlet.jsp:javax.servlet.jsp-api:2.3.2-b02"
|
||||
dependency "javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1"
|
||||
dependency "javax.transaction:javax.transaction-api:1.3"
|
||||
dependency "javax.validation:validation-api:2.0.1.Final"
|
||||
dependency "javax.websocket:javax.websocket-api:1.1"
|
||||
dependency "javax.xml.bind:jaxb-api:2.3.1"
|
||||
dependency "javax.xml.ws:jaxws-api:2.3.1"
|
||||
|
||||
dependency "org.eclipse.persistence:javax.persistence:2.2.0"
|
||||
|
||||
// Substitute for "javax.management:jmxremote_optional:1.0.1_04" which
|
||||
// is not available on Maven Central
|
||||
dependency "org.glassfish.external:opendmk_jmxremote_optional_jar:1.0-b01-ea"
|
||||
dependency "org.glassfish:javax.el:3.0.1-b08"
|
||||
dependency "org.glassfish.main:javax.jws:4.0-b33"
|
||||
dependency "org.glassfish.tyrus:tyrus-container-servlet:1.13.1"
|
||||
}
|
||||
generatedPomCustomization {
|
||||
enabled = false
|
||||
}
|
||||
resolutionStrategy {
|
||||
cacheChangingModulesFor 0, "seconds"
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url "https://repo.spring.io/libs-spring-framework-build" }
|
||||
}
|
||||
}
|
||||
configurations.all {
|
||||
resolutionStrategy {
|
||||
cacheChangingModulesFor 0, "seconds"
|
||||
cacheDynamicVersionsFor 0, "seconds"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configure([rootProject] + javaProjects) { project ->
|
||||
group = "org.springframework"
|
||||
|
||||
apply plugin: "java"
|
||||
apply plugin: "java-test-fixtures"
|
||||
apply plugin: "checkstyle"
|
||||
apply plugin: 'org.springframework.build.compile'
|
||||
apply from: "${rootDir}/gradle/toolchains.gradle"
|
||||
apply from: "${rootDir}/gradle/ide.gradle"
|
||||
|
||||
pluginManager.withPlugin("kotlin") {
|
||||
apply plugin: "org.jetbrains.dokka"
|
||||
apply from: "${rootDir}/gradle/docs-dokka.gradle"
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
languageVersion = "1.3"
|
||||
apiVersion = "1.3"
|
||||
freeCompilerArgs = ["-Xjsr305=strict", "-Xsuppress-version-warnings", "-Xopt-in=kotlin.RequiresOptIn"]
|
||||
allWarningsAsErrors = true
|
||||
}
|
||||
}
|
||||
compileTestKotlin {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = ["-Xjsr305=strict"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
include(["**/*Tests.class", "**/*Test.class"])
|
||||
systemProperty("java.awt.headless", "true")
|
||||
systemProperty("testGroups", project.properties.get("testGroups"))
|
||||
systemProperty("io.netty.leakDetection.level", "paranoid")
|
||||
}
|
||||
|
||||
checkstyle {
|
||||
toolVersion = "10.12.7"
|
||||
configDirectory.set(rootProject.file("src/checkstyle"))
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-params")
|
||||
testImplementation("org.junit.platform:junit-platform-suite-api")
|
||||
testImplementation("org.mockito:mockito-core")
|
||||
testImplementation("org.mockito:mockito-junit-jupiter")
|
||||
testImplementation("io.mockk:mockk")
|
||||
testImplementation("org.assertj:assertj-core")
|
||||
// Pull in the latest JUnit 5 Launcher API to ensure proper support in IDEs.
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
|
||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||
testRuntimeOnly("org.junit.platform:junit-platform-suite-engine")
|
||||
testRuntimeOnly("org.apache.logging.log4j:log4j-core")
|
||||
testRuntimeOnly("org.apache.logging.log4j:log4j-jul")
|
||||
testRuntimeOnly("org.apache.logging.log4j:log4j-slf4j-impl")
|
||||
// JSR-305 only used for non-required meta-annotations
|
||||
compileOnly("com.google.code.findbugs:jsr305")
|
||||
testCompileOnly("com.google.code.findbugs:jsr305")
|
||||
checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:0.0.42")
|
||||
}
|
||||
|
||||
ext.javadocLinks = [
|
||||
"https://docs.oracle.com/javase/8/docs/api/",
|
||||
"https://docs.oracle.com/javaee/7/api/",
|
||||
"https://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/", // CommonJ
|
||||
"https://www.ibm.com/docs/api/v1/content/SSEQTP_8.5.5/com.ibm.websphere.javadoc.doc/web/apidocs/",
|
||||
"https://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
|
||||
"https://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
|
||||
"https://tiles.apache.org/tiles-request/apidocs/",
|
||||
"https://tiles.apache.org/framework/apidocs/",
|
||||
"https://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
|
||||
// Temporarily commenting out Ehcache and Quartz since javadoc on JDK 8 cannot access them.
|
||||
// "https://www.ehcache.org/apidocs/2.10.4/",
|
||||
// "https://www.quartz-scheduler.org/api/2.3.0/",
|
||||
"https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/2.12.7/",
|
||||
"https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/2.12.7/",
|
||||
"https://www.javadoc.io/doc/com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.12.7/",
|
||||
"https://hc.apache.org/httpcomponents-client-5.1.x/current/httpclient5/apidocs/",
|
||||
"https://projectreactor.io/docs/test/release/api/",
|
||||
"https://junit.org/junit4/javadoc/4.13.2/",
|
||||
// Disabling linking to JUnit 5.8.2, since the `package-list` file no longer exists due to
|
||||
// https://github.com/junit-team/junit5/commit/67ad4e545518b0ce2b0e7c96df31a669866d5003.
|
||||
// "https://junit.org/junit5/docs/5.8.2/api/",
|
||||
"https://www.reactive-streams.org/reactive-streams-1.0.3-javadoc/",
|
||||
"https://javadoc.io/static/io.rsocket/rsocket-core/1.1.1/",
|
||||
// Temporarily commenting out R2DBC since javadoc on JDK 8 cannot access it.
|
||||
// "https://r2dbc.io/spec/0.8.5.RELEASE/api/",
|
||||
// The external Javadoc link for JSR 305 must come last to ensure that types from
|
||||
// JSR 250 (such as @PostConstruct) are still supported. This is due to the fact
|
||||
// that JSR 250 and JSR 305 both define types in javax.annotation, which results
|
||||
// in a split package, and the javadoc tool does not support split packages
|
||||
// across multiple external Javadoc sites.
|
||||
"https://www.javadoc.io/doc/com.google.code.findbugs/jsr305/3.0.2/"
|
||||
] as String[]
|
||||
}
|
||||
|
||||
configure(moduleProjects) { project ->
|
||||
apply from: "${rootDir}/gradle/spring-module.gradle"
|
||||
}
|
||||
|
||||
configure(rootProject) {
|
||||
description = "Spring Framework"
|
||||
|
||||
apply plugin: "kotlin"
|
||||
apply plugin: "io.spring.nohttp"
|
||||
apply plugin: 'org.springframework.build.api-diff'
|
||||
apply from: "${rootDir}/gradle/publications.gradle"
|
||||
apply from: "${rootDir}/gradle/docs.gradle"
|
||||
|
||||
nohttp {
|
||||
source.exclude "**/test-output/**"
|
||||
allowlistFile = project.file("src/nohttp/allowlist.lines")
|
||||
def rootPath = file(rootDir).toPath()
|
||||
def projectDirs = allprojects.collect { it.projectDir } + "${rootDir}/spring-core-test" + "${rootDir}/buildSrc" + "${rootDir}/framework-docs"
|
||||
projectDirs.forEach { dir ->
|
||||
[ 'bin', 'build', 'out', '.settings' ]
|
||||
.collect { rootPath.relativize(new File(dir, it).toPath()) }
|
||||
.forEach { source.exclude "$it/**" }
|
||||
[ '.classpath', '.project' ]
|
||||
.collect { rootPath.relativize(new File(dir, it).toPath()) }
|
||||
.forEach { source.exclude "$it" }
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named("checkstyleNohttp").configure {
|
||||
maxHeapSize = "1g"
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifact docsZip
|
||||
artifact schemaZip
|
||||
artifact distZip
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
version=3.1.5
|
||||
|
||||
natural.name=spring-framework
|
||||
project.name=Spring Framework
|
||||
project.key=SPR
|
||||
ivy.cache.dir=${basedir}/../ivy-cache
|
||||
integration.repo.dir=${basedir}/../integration-repo
|
||||
license.dir=${basedir}/../build-spring-framework/resources
|
||||
javadoc.exclude.package.names=org/springframework/samples/**
|
||||
javadoc.max.memory=1024M
|
||||
test.vm.args=-Xmx1024M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError
|
||||
compiler.args=-enableJavadoc -warn:none
|
||||
|
||||
## common osgi ranges used in template.mf files
|
||||
spring.osgi.range.nq=${version:[=.=.=, =.=.+1)}
|
||||
spring.osgi.range="${spring.osgi.range.nq}"
|
||||
aj.osgi.range="[1.6.8, 2.0.0)"
|
||||
|
||||
## For GA releases
|
||||
#release.type=release
|
||||
#build.stamp=RELEASE
|
||||
|
||||
## For milestone releases
|
||||
#release.type=milestone
|
||||
#build.stamp=M1
|
||||
|
||||
## For trunk development / ci builds
|
||||
release.type=integration
|
||||
build.stamp=BUILD-SNAPSHOT
|
||||
|
||||
#bundlor
|
||||
fail.on.warnings=false
|
||||
@@ -0,0 +1,4 @@
|
||||
# common dependency versions
|
||||
aspectj.version=1.6.8.RELEASE
|
||||
junit.version=4.9.0
|
||||
testng.version=5.12.1
|
||||
@@ -1,35 +0,0 @@
|
||||
# Spring Framework Build
|
||||
|
||||
This folder contains the custom plugins and conventions for the Spring Framework build.
|
||||
They are declared in the `build.gradle` file in this folder.
|
||||
|
||||
## Build Conventions
|
||||
|
||||
### Compiler conventions
|
||||
|
||||
The `org.springframework.build.compile` plugin applies the Java compiler conventions to the build.
|
||||
|
||||
## Build Plugins
|
||||
|
||||
### Optional dependencies
|
||||
|
||||
The `org.springframework.build.optional-dependencies` plugin creates a new `optional`
|
||||
Gradle configuration - it adds the dependencies to the project's compile and runtime classpath
|
||||
but doesn't affect the classpath of dependent projects.
|
||||
This plugin does not provide a `provided` configuration, as the native `compileOnly` and `testCompileOnly`
|
||||
configurations are preferred.
|
||||
|
||||
### API Diff
|
||||
|
||||
This plugin uses the [Gradle JApiCmp](https://github.com/melix/japicmp-gradle-plugin) plugin
|
||||
to generate API Diff reports for each Spring Framework module. This plugin is applied once on the root
|
||||
project and creates tasks in each framework module. Unlike previous versions of this part of the build,
|
||||
there is no need for checking out a specific tag. The plugin will fetch the JARs we want to compare the
|
||||
current working version with. You can generate the reports for all modules or a single module:
|
||||
|
||||
```
|
||||
./gradlew apiDiff -PbaselineVersion=5.1.0.RELEASE
|
||||
./gradlew :spring-core:apiDiff -PbaselineVersion=5.1.0.RELEASE
|
||||
```
|
||||
|
||||
The reports are located under `build/reports/api-diff/$OLDVERSION_to_$NEWVERSION/`.
|
||||
@@ -1,29 +0,0 @@
|
||||
plugins {
|
||||
id 'java-gradle-plugin'
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "me.champeau.gradle:japicmp-gradle-plugin:0.3.0"
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
plugins {
|
||||
apiDiffPlugin {
|
||||
id = "org.springframework.build.api-diff"
|
||||
implementationClass = "org.springframework.build.api.ApiDiffPlugin"
|
||||
}
|
||||
compileConventionsPlugin {
|
||||
id = "org.springframework.build.compile"
|
||||
implementationClass = "org.springframework.build.compile.CompilerConventionsPlugin"
|
||||
}
|
||||
optionalDependenciesPlugin {
|
||||
id = "org.springframework.build.optional-dependencies"
|
||||
implementationClass = "org.springframework.build.optional.OptionalDependenciesPlugin"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
org.gradle.caching=true
|
||||
@@ -1,115 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.build.api;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import me.champeau.gradle.japicmp.JapicmpPlugin;
|
||||
import me.champeau.gradle.japicmp.JapicmpTask;
|
||||
import org.gradle.api.Plugin;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.artifacts.Configuration;
|
||||
import org.gradle.api.artifacts.Dependency;
|
||||
import org.gradle.api.plugins.JavaBasePlugin;
|
||||
import org.gradle.api.plugins.JavaPlugin;
|
||||
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin;
|
||||
import org.gradle.api.tasks.TaskProvider;
|
||||
import org.gradle.jvm.tasks.Jar;
|
||||
|
||||
/**
|
||||
* {@link Plugin} that applies the {@code "japicmp-gradle-plugin"}
|
||||
* and create tasks for all subprojects, diffing the public API one by one
|
||||
* and creating the reports in {@code "build/reports/api-diff/$OLDVERSION_to_$NEWVERSION/"}.
|
||||
* <p>{@code "./gradlew apiDiff -PbaselineVersion=5.1.0.RELEASE"} will output the
|
||||
* reports for the API diff between the baseline version and the current one for all modules.
|
||||
* You can limit the report to a single module with
|
||||
* {@code "./gradlew :spring-core:apiDiff -PbaselineVersion=5.1.0.RELEASE"}.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
*/
|
||||
public class ApiDiffPlugin implements Plugin<Project> {
|
||||
|
||||
public static final String TASK_NAME = "apiDiff";
|
||||
|
||||
private static final String BASELINE_VERSION_PROPERTY = "baselineVersion";
|
||||
|
||||
private static final List<String> PACKAGE_INCLUDES = Collections.singletonList("org.springframework.*");
|
||||
|
||||
@Override
|
||||
public void apply(Project project) {
|
||||
if (project.hasProperty(BASELINE_VERSION_PROPERTY) && project.equals(project.getRootProject())) {
|
||||
project.getPluginManager().apply(JapicmpPlugin.class);
|
||||
project.getPlugins().withType(JapicmpPlugin.class,
|
||||
plugin -> applyApiDiffConventions(project));
|
||||
}
|
||||
}
|
||||
|
||||
private void applyApiDiffConventions(Project project) {
|
||||
String baselineVersion = project.property(BASELINE_VERSION_PROPERTY).toString();
|
||||
project.subprojects(subProject -> createApiDiffTask(baselineVersion, subProject));
|
||||
}
|
||||
|
||||
private void createApiDiffTask(String baselineVersion, Project project) {
|
||||
if (isProjectEligible(project)) {
|
||||
JapicmpTask apiDiff = project.getTasks().create(TASK_NAME, JapicmpTask.class);
|
||||
apiDiff.setDescription("Generates an API diff report with japicmp");
|
||||
apiDiff.setGroup(JavaBasePlugin.DOCUMENTATION_GROUP);
|
||||
|
||||
apiDiff.setOldClasspath(project.files(createBaselineConfiguration(baselineVersion, project)));
|
||||
TaskProvider<Jar> jar = project.getTasks().withType(Jar.class).named("jar");
|
||||
apiDiff.setNewArchives(project.getLayout().files(jar.get().getArchiveFile().get().getAsFile()));
|
||||
apiDiff.setNewClasspath(getRuntimeClassPath(project));
|
||||
apiDiff.setPackageIncludes(PACKAGE_INCLUDES);
|
||||
apiDiff.setOnlyModified(true);
|
||||
apiDiff.setIgnoreMissingClasses(true);
|
||||
// Ignore Kotlin metadata annotations since they contain
|
||||
// illegal HTML characters and fail the report generation
|
||||
apiDiff.setAnnotationExcludes(Collections.singletonList("@kotlin.Metadata"));
|
||||
|
||||
apiDiff.setHtmlOutputFile(getOutputFile(baselineVersion, project));
|
||||
|
||||
apiDiff.dependsOn(project.getTasks().getByName("jar"));
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isProjectEligible(Project project) {
|
||||
return project.getPlugins().hasPlugin(JavaPlugin.class)
|
||||
&& project.getPlugins().hasPlugin(MavenPublishPlugin.class);
|
||||
}
|
||||
|
||||
private Configuration createBaselineConfiguration(String baselineVersion, Project project) {
|
||||
String baseline = String.join(":",
|
||||
project.getGroup().toString(), project.getName(), baselineVersion);
|
||||
Dependency baselineDependency = project.getDependencies().create(baseline + "@jar");
|
||||
return project.getRootProject().getConfigurations().detachedConfiguration(baselineDependency);
|
||||
}
|
||||
|
||||
private Configuration getRuntimeClassPath(Project project) {
|
||||
return project.getConfigurations().getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME);
|
||||
}
|
||||
|
||||
private File getOutputFile(String baseLineVersion, Project project) {
|
||||
Path outDir = Paths.get(project.getRootProject().getBuildDir().getAbsolutePath(),
|
||||
"reports", "api-diff",
|
||||
baseLineVersion + "_to_" + project.getRootProject().getVersion());
|
||||
return project.file(outDir.resolve(project.getName() + ".html").toString());
|
||||
}
|
||||
|
||||
}
|
||||
-89
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.build.compile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.gradle.api.Plugin;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.plugins.JavaLibraryPlugin;
|
||||
import org.gradle.api.plugins.JavaPlugin;
|
||||
import org.gradle.api.plugins.JavaPluginConvention;
|
||||
import org.gradle.api.tasks.compile.JavaCompile;
|
||||
|
||||
/**
|
||||
* {@link Plugin} that applies conventions for compiling Java sources in Spring Framework.
|
||||
*
|
||||
* @author Brian Clozel
|
||||
* @author Sam Brannen
|
||||
* @author Sebastien Deleuze
|
||||
*/
|
||||
public class CompilerConventionsPlugin implements Plugin<Project> {
|
||||
|
||||
private static final List<String> COMPILER_ARGS;
|
||||
|
||||
private static final List<String> TEST_COMPILER_ARGS;
|
||||
|
||||
static {
|
||||
List<String> commonCompilerArgs = Arrays.asList(
|
||||
"-Xlint:serial", "-Xlint:cast", "-Xlint:classfile", "-Xlint:dep-ann",
|
||||
"-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", "-Xlint:overrides",
|
||||
"-Xlint:path", "-Xlint:processing", "-Xlint:static", "-Xlint:try", "-Xlint:-options",
|
||||
"-parameters"
|
||||
);
|
||||
COMPILER_ARGS = new ArrayList<>();
|
||||
COMPILER_ARGS.addAll(commonCompilerArgs);
|
||||
COMPILER_ARGS.addAll(Arrays.asList(
|
||||
"-Xlint:varargs", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
|
||||
"-Xlint:unchecked", "-Werror"
|
||||
));
|
||||
TEST_COMPILER_ARGS = new ArrayList<>();
|
||||
TEST_COMPILER_ARGS.addAll(commonCompilerArgs);
|
||||
TEST_COMPILER_ARGS.addAll(Arrays.asList("-Xlint:-varargs", "-Xlint:-fallthrough", "-Xlint:-rawtypes",
|
||||
"-Xlint:-deprecation", "-Xlint:-unchecked"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(Project project) {
|
||||
project.getPlugins().withType(JavaLibraryPlugin.class, javaPlugin -> applyJavaCompileConventions(project));
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies the common Java compiler options for main sources, test fixture sources, and
|
||||
* test sources.
|
||||
* @param project the current project
|
||||
*/
|
||||
private void applyJavaCompileConventions(Project project) {
|
||||
JavaPluginConvention java = project.getConvention().getPlugin(JavaPluginConvention.class);
|
||||
project.getTasks().withType(JavaCompile.class)
|
||||
.matching(compileTask -> compileTask.getName().equals(JavaPlugin.COMPILE_JAVA_TASK_NAME))
|
||||
.forEach(compileTask -> {
|
||||
compileTask.getOptions().setCompilerArgs(COMPILER_ARGS);
|
||||
compileTask.getOptions().setEncoding("UTF-8");
|
||||
});
|
||||
project.getTasks().withType(JavaCompile.class)
|
||||
.matching(compileTask -> compileTask.getName().equals(JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME)
|
||||
|| compileTask.getName().equals("compileTestFixturesJava"))
|
||||
.forEach(compileTask -> {
|
||||
compileTask.getOptions().setCompilerArgs(TEST_COMPILER_ARGS);
|
||||
compileTask.getOptions().setEncoding("UTF-8");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
-59
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.build.optional;
|
||||
|
||||
import org.gradle.api.Plugin;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.artifacts.Configuration;
|
||||
import org.gradle.api.attributes.Usage;
|
||||
import org.gradle.api.plugins.JavaPlugin;
|
||||
import org.gradle.api.plugins.JavaPluginConvention;
|
||||
import org.gradle.api.tasks.SourceSetContainer;
|
||||
import org.gradle.plugins.ide.eclipse.EclipsePlugin;
|
||||
import org.gradle.plugins.ide.eclipse.model.EclipseModel;
|
||||
|
||||
/**
|
||||
* A {@code Plugin} that adds support for Maven-style optional dependencies. Creates a new
|
||||
* {@code optional} configuration. The {@code optional} configuration is part of the
|
||||
* project's compile and runtime classpaths but does not affect the classpath of
|
||||
* dependent projects.
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
*/
|
||||
public class OptionalDependenciesPlugin implements Plugin<Project> {
|
||||
|
||||
/**
|
||||
* Name of the {@code optional} configuration.
|
||||
*/
|
||||
public static final String OPTIONAL_CONFIGURATION_NAME = "optional";
|
||||
|
||||
@Override
|
||||
public void apply(Project project) {
|
||||
Configuration optional = project.getConfigurations().create("optional");
|
||||
optional.setCanBeConsumed(false);
|
||||
optional.setCanBeResolved(false);
|
||||
project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> {
|
||||
SourceSetContainer sourceSets = project.getConvention().getPlugin(JavaPluginConvention.class)
|
||||
.getSourceSets();
|
||||
sourceSets.all((sourceSet) -> {
|
||||
project.getConfigurations().getByName(sourceSet.getCompileClasspathConfigurationName()).extendsFrom(optional);
|
||||
project.getConfigurations().getByName(sourceSet.getRuntimeClasspathConfigurationName()).extendsFrom(optional);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
# properties used by Bamboo build plan at http://build.springframework.org/build/admin/buildConfiguration.action?buildKey=SPR-TRUNKQUICK
|
||||
# run in conjunction with ANT_OPTS='-XX:MaxPermSize=512m -Xmx1024m'
|
||||
compiler.args=-enableJavadoc -warn:none
|
||||
java.awt.headless=true
|
||||
ci.build=true
|
||||
test.vm.args=-XX:MaxPermSize=512m -Xmx1024m
|
||||
@@ -1,59 +0,0 @@
|
||||
== Spring Framework Concourse pipeline
|
||||
|
||||
NOTE: CI is being migrated to GitHub Actions.
|
||||
|
||||
The Spring Framework uses https://concourse-ci.org/[Concourse] for its CI build and other automated tasks.
|
||||
The Spring team has a dedicated Concourse instance available at https://ci.spring.io with a build pipeline
|
||||
for https://ci.spring.io/teams/spring-framework/pipelines/spring-framework-5.3.x[Spring Framework 5.3.x].
|
||||
|
||||
=== Setting up your development environment
|
||||
|
||||
If you're part of the Spring Framework project on GitHub, you can get access to CI management features.
|
||||
First, you need to go to https://ci.spring.io and install the client CLI for your platform (see bottom right of the screen).
|
||||
|
||||
You can then login with the instance using:
|
||||
|
||||
[source]
|
||||
----
|
||||
$ fly -t spring login -n spring-framework -c https://ci.spring.io
|
||||
----
|
||||
|
||||
Once logged in, you should get something like:
|
||||
|
||||
[source]
|
||||
----
|
||||
$ fly ts
|
||||
name url team expiry
|
||||
spring https://ci.spring.io spring-framework Wed, 25 Mar 2020 17:45:26 UTC
|
||||
----
|
||||
|
||||
=== Pipeline configuration and structure
|
||||
|
||||
The build pipelines are described in `pipeline.yml` file.
|
||||
|
||||
This file is listing Concourse resources, i.e. build inputs and outputs such as container images, artifact repositories, source repositories, notification services, etc.
|
||||
|
||||
It also describes jobs (a job is a sequence of inputs, tasks and outputs); jobs are organized by groups.
|
||||
|
||||
The `pipeline.yml` definition contains `((parameters))` which are loaded from the `parameters.yml` file or from our https://docs.cloudfoundry.org/credhub/[credhub instance].
|
||||
|
||||
You'll find in this folder the following resources:
|
||||
|
||||
* `pipeline.yml` the build pipeline
|
||||
* `parameters.yml` the build parameters used for the pipeline
|
||||
* `images/` holds the container images definitions used in this pipeline
|
||||
* `scripts/` holds the build scripts that ship within the CI container images
|
||||
* `tasks` contains the task definitions used in the main `pipeline.yml`
|
||||
|
||||
=== Updating the build pipeline
|
||||
|
||||
Updating files on the repository is not enough to update the build pipeline, as changes need to be applied.
|
||||
|
||||
The pipeline can be deployed using the following command:
|
||||
|
||||
[source]
|
||||
----
|
||||
$ fly -t spring set-pipeline -p spring-framework-5.3.x -c ci/pipeline.yml -l ci/parameters.yml
|
||||
----
|
||||
|
||||
NOTE: This assumes that you have credhub integration configured with the appropriate secrets.
|
||||
@@ -1,20 +0,0 @@
|
||||
changelog:
|
||||
repository: spring-projects/spring-framework
|
||||
sections:
|
||||
- title: ":star: New Features"
|
||||
labels:
|
||||
- "type: enhancement"
|
||||
- title: ":lady_beetle: Bug Fixes"
|
||||
labels:
|
||||
- "type: bug"
|
||||
- "type: regression"
|
||||
- title: ":notebook_with_decorative_cover: Documentation"
|
||||
labels:
|
||||
- "type: documentation"
|
||||
- title: ":hammer: Dependency Upgrades"
|
||||
sort: "title"
|
||||
labels:
|
||||
- "type: dependency-upgrade"
|
||||
contributors:
|
||||
exclude:
|
||||
names: ["bclozel", "jhoeller", "poutsma", "rstoyanchev", "sbrannen", "sdeleuze", "snicoll", "simonbasle"]
|
||||
@@ -1,10 +0,0 @@
|
||||
logging:
|
||||
level:
|
||||
io.spring.concourse: DEBUG
|
||||
spring:
|
||||
main:
|
||||
banner-mode: off
|
||||
sonatype:
|
||||
exclude:
|
||||
- 'build-info\.json'
|
||||
- '.*\.zip'
|
||||
@@ -1,21 +0,0 @@
|
||||
== CI Images
|
||||
|
||||
These images are used by CI to run the actual builds.
|
||||
|
||||
To build the image locally run the following from this directory:
|
||||
|
||||
----
|
||||
$ docker build --no-cache -f <image-folder>/Dockerfile .
|
||||
----
|
||||
|
||||
For example
|
||||
|
||||
----
|
||||
$ docker build --no-cache -f spring-framework-ci-image/Dockerfile .
|
||||
----
|
||||
|
||||
To test run:
|
||||
|
||||
----
|
||||
$ docker run -it --entrypoint /bin/bash <SHA>
|
||||
----
|
||||
@@ -1,10 +0,0 @@
|
||||
FROM ubuntu:jammy-20240125
|
||||
|
||||
ADD setup.sh /setup.sh
|
||||
ADD get-jdk-url.sh /get-jdk-url.sh
|
||||
RUN ./setup.sh java8
|
||||
|
||||
ENV JAVA_HOME /opt/openjdk/java8
|
||||
ENV JDK17 /opt/openjdk/java17
|
||||
|
||||
ENV PATH $JAVA_HOME/bin:$PATH
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
java8)
|
||||
echo "https://github.com/bell-sw/Liberica/releases/download/8u402%2B7/bellsoft-jdk8u402+7-linux-amd64.tar.gz"
|
||||
;;
|
||||
java17)
|
||||
echo "https://github.com/bell-sw/Liberica/releases/download/17.0.10%2B13/bellsoft-jdk17.0.10+13-linux-amd64.tar.gz"
|
||||
;;
|
||||
*)
|
||||
echo $"Unknown java version"
|
||||
exit 1
|
||||
esac
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
###########################################################
|
||||
# UTILS
|
||||
###########################################################
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update
|
||||
apt-get install --no-install-recommends -y tzdata ca-certificates net-tools libxml2-utils git curl libudev1 libxml2-utils iptables iproute2 jq fontconfig
|
||||
ln -fs /usr/share/zoneinfo/UTC /etc/localtime
|
||||
dpkg-reconfigure --frontend noninteractive tzdata
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
curl https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.4/concourse-java.sh > /opt/concourse-java.sh
|
||||
|
||||
###########################################################
|
||||
# JAVA
|
||||
###########################################################
|
||||
|
||||
mkdir -p /opt/openjdk
|
||||
pushd /opt/openjdk > /dev/null
|
||||
for jdk in java8 java17
|
||||
do
|
||||
JDK_URL=$( /get-jdk-url.sh $jdk )
|
||||
mkdir $jdk
|
||||
pushd $jdk > /dev/null
|
||||
curl -L ${JDK_URL} | tar zx --strip-components=1
|
||||
test -f bin/java
|
||||
test -f bin/javac
|
||||
popd > /dev/null
|
||||
done
|
||||
popd
|
||||
|
||||
###########################################################
|
||||
# GRADLE ENTERPRISE
|
||||
###########################################################
|
||||
cd /
|
||||
mkdir ~/.gradle
|
||||
echo 'systemProp.user.name=concourse' > ~/.gradle/gradle.properties
|
||||
@@ -1,10 +0,0 @@
|
||||
github-repo: "https://github.com/spring-projects/spring-framework.git"
|
||||
github-repo-name: "spring-projects/spring-framework"
|
||||
sonatype-staging-profile: "org.springframework"
|
||||
docker-hub-organization: "springci"
|
||||
artifactory-server: "https://repo.spring.io"
|
||||
branch: "5.3.x"
|
||||
milestone: "5.3.x"
|
||||
build-name: "spring-framework"
|
||||
pipeline-name: "spring-framework"
|
||||
concourse-url: "https://ci.spring.io"
|
||||
-291
@@ -1,291 +0,0 @@
|
||||
anchors:
|
||||
git-repo-resource-source: &git-repo-resource-source
|
||||
uri: ((github-repo))
|
||||
username: ((github-username))
|
||||
password: ((github-ci-release-token))
|
||||
branch: ((branch))
|
||||
gradle-enterprise-task-params: &gradle-enterprise-task-params
|
||||
DEVELOCITY_ACCESS_KEY: ((gradle_enterprise_secret_access_key))
|
||||
sonatype-task-params: &sonatype-task-params
|
||||
SONATYPE_USERNAME: ((sonatype-username))
|
||||
SONATYPE_PASSWORD: ((sonatype-password))
|
||||
SONATYPE_URL: ((sonatype-url))
|
||||
SONATYPE_STAGING_PROFILE: ((sonatype-staging-profile))
|
||||
artifactory-task-params: &artifactory-task-params
|
||||
ARTIFACTORY_SERVER: ((artifactory-server))
|
||||
ARTIFACTORY_USERNAME: ((artifactory-username))
|
||||
ARTIFACTORY_PASSWORD: ((artifactory-password))
|
||||
build-project-task-params: &build-project-task-params
|
||||
BRANCH: ((branch))
|
||||
<<: *gradle-enterprise-task-params
|
||||
docker-resource-source: &docker-resource-source
|
||||
username: ((docker-hub-username))
|
||||
password: ((docker-hub-password))
|
||||
changelog-task-params: &changelog-task-params
|
||||
name: generated-changelog/tag
|
||||
tag: generated-changelog/tag
|
||||
body: generated-changelog/changelog.md
|
||||
github-task-params: &github-task-params
|
||||
GITHUB_USERNAME: ((github-username))
|
||||
GITHUB_TOKEN: ((github-ci-release-token))
|
||||
|
||||
resource_types:
|
||||
- name: registry-image
|
||||
type: registry-image
|
||||
source:
|
||||
<<: *docker-resource-source
|
||||
repository: concourse/registry-image-resource
|
||||
tag: 1.8.0
|
||||
- name: artifactory-resource
|
||||
type: registry-image
|
||||
source:
|
||||
<<: *docker-resource-source
|
||||
repository: springio/artifactory-resource
|
||||
tag: 0.0.18
|
||||
- name: github-release
|
||||
type: registry-image
|
||||
source:
|
||||
<<: *docker-resource-source
|
||||
repository: concourse/github-release-resource
|
||||
tag: 1.8.0
|
||||
- name: github-status-resource
|
||||
type: registry-image
|
||||
source:
|
||||
<<: *docker-resource-source
|
||||
repository: dpb587/github-status-resource
|
||||
tag: master
|
||||
resources:
|
||||
- name: git-repo
|
||||
type: git
|
||||
icon: github
|
||||
source:
|
||||
<<: *git-repo-resource-source
|
||||
- name: ci-images-git-repo
|
||||
type: git
|
||||
icon: github
|
||||
source:
|
||||
uri: ((github-repo))
|
||||
branch: ((branch))
|
||||
paths: ["ci/images/*"]
|
||||
- name: ci-image
|
||||
type: registry-image
|
||||
icon: docker
|
||||
source:
|
||||
<<: *docker-resource-source
|
||||
repository: ((docker-hub-organization))/spring-framework-ci
|
||||
tag: ((milestone))
|
||||
- name: artifactory-repo
|
||||
type: artifactory-resource
|
||||
icon: package-variant
|
||||
source:
|
||||
uri: ((artifactory-server))
|
||||
username: ((artifactory-username))
|
||||
password: ((artifactory-password))
|
||||
build_name: ((build-name))
|
||||
- name: github-pre-release
|
||||
type: github-release
|
||||
icon: briefcase-download-outline
|
||||
source:
|
||||
owner: spring-projects
|
||||
repository: spring-framework
|
||||
access_token: ((github-ci-release-token))
|
||||
pre_release: true
|
||||
release: false
|
||||
- name: github-release
|
||||
type: github-release
|
||||
icon: briefcase-download
|
||||
source:
|
||||
owner: spring-projects
|
||||
repository: spring-framework
|
||||
access_token: ((github-ci-release-token))
|
||||
pre_release: false
|
||||
jobs:
|
||||
- name: build-ci-images
|
||||
plan:
|
||||
- get: git-repo
|
||||
- get: ci-images-git-repo
|
||||
trigger: true
|
||||
- task: build-ci-image
|
||||
privileged: true
|
||||
file: git-repo/ci/tasks/build-ci-image.yml
|
||||
output_mapping:
|
||||
image: ci-image
|
||||
vars:
|
||||
ci-image-name: ci-image
|
||||
<<: *docker-resource-source
|
||||
- put: ci-image
|
||||
params:
|
||||
image: ci-image/image.tar
|
||||
- name: stage-milestone
|
||||
serial: true
|
||||
plan:
|
||||
- get: ci-image
|
||||
- get: git-repo
|
||||
trigger: false
|
||||
- task: stage
|
||||
image: ci-image
|
||||
file: git-repo/ci/tasks/stage-version.yml
|
||||
params:
|
||||
RELEASE_TYPE: M
|
||||
<<: *gradle-enterprise-task-params
|
||||
- put: artifactory-repo
|
||||
params: &artifactory-params
|
||||
signing_key: ((signing-key))
|
||||
signing_passphrase: ((signing-passphrase))
|
||||
repo: libs-staging-local
|
||||
folder: distribution-repository
|
||||
build_uri: "https://ci.spring.io/teams/${BUILD_TEAM_NAME}/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}"
|
||||
build_number: "${BUILD_PIPELINE_NAME}-${BUILD_JOB_NAME}-${BUILD_NAME}"
|
||||
disable_checksum_uploads: true
|
||||
threads: 8
|
||||
artifact_set:
|
||||
- include:
|
||||
- "/**/spring-*.zip"
|
||||
properties:
|
||||
"zip.name": "spring-framework"
|
||||
"zip.displayname": "Spring Framework"
|
||||
"zip.deployed": "false"
|
||||
- include:
|
||||
- "/**/spring-*-docs.zip"
|
||||
properties:
|
||||
"zip.type": "docs"
|
||||
- include:
|
||||
- "/**/spring-*-dist.zip"
|
||||
properties:
|
||||
"zip.type": "dist"
|
||||
- include:
|
||||
- "/**/spring-*-schema.zip"
|
||||
properties:
|
||||
"zip.type": "schema"
|
||||
- put: git-repo
|
||||
params:
|
||||
repository: stage-git-repo
|
||||
- name: promote-milestone
|
||||
serial: true
|
||||
plan:
|
||||
- get: ci-image
|
||||
- get: git-repo
|
||||
trigger: false
|
||||
- get: artifactory-repo
|
||||
trigger: false
|
||||
passed: [stage-milestone]
|
||||
params:
|
||||
download_artifacts: false
|
||||
save_build_info: true
|
||||
- task: promote
|
||||
file: git-repo/ci/tasks/promote-version.yml
|
||||
params:
|
||||
RELEASE_TYPE: M
|
||||
<<: *artifactory-task-params
|
||||
- task: generate-changelog
|
||||
file: git-repo/ci/tasks/generate-changelog.yml
|
||||
params:
|
||||
RELEASE_TYPE: M
|
||||
<<: *github-task-params
|
||||
- put: github-pre-release
|
||||
params:
|
||||
<<: *changelog-task-params
|
||||
- name: stage-rc
|
||||
serial: true
|
||||
plan:
|
||||
- get: ci-image
|
||||
- get: git-repo
|
||||
trigger: false
|
||||
- task: stage
|
||||
image: ci-image
|
||||
file: git-repo/ci/tasks/stage-version.yml
|
||||
params:
|
||||
RELEASE_TYPE: RC
|
||||
<<: *gradle-enterprise-task-params
|
||||
- put: artifactory-repo
|
||||
params:
|
||||
<<: *artifactory-params
|
||||
- put: git-repo
|
||||
params:
|
||||
repository: stage-git-repo
|
||||
- name: promote-rc
|
||||
serial: true
|
||||
plan:
|
||||
- get: ci-image
|
||||
- get: git-repo
|
||||
trigger: false
|
||||
- get: artifactory-repo
|
||||
trigger: false
|
||||
passed: [stage-rc]
|
||||
params:
|
||||
download_artifacts: false
|
||||
save_build_info: true
|
||||
- task: promote
|
||||
file: git-repo/ci/tasks/promote-version.yml
|
||||
params:
|
||||
RELEASE_TYPE: RC
|
||||
<<: *artifactory-task-params
|
||||
- task: generate-changelog
|
||||
file: git-repo/ci/tasks/generate-changelog.yml
|
||||
params:
|
||||
RELEASE_TYPE: RC
|
||||
<<: *github-task-params
|
||||
- put: github-pre-release
|
||||
params:
|
||||
<<: *changelog-task-params
|
||||
- name: stage-release
|
||||
serial: true
|
||||
plan:
|
||||
- get: ci-image
|
||||
- get: git-repo
|
||||
trigger: false
|
||||
- task: stage
|
||||
image: ci-image
|
||||
file: git-repo/ci/tasks/stage-version.yml
|
||||
params:
|
||||
RELEASE_TYPE: RELEASE
|
||||
<<: *gradle-enterprise-task-params
|
||||
- put: artifactory-repo
|
||||
params:
|
||||
<<: *artifactory-params
|
||||
- put: git-repo
|
||||
params:
|
||||
repository: stage-git-repo
|
||||
- name: promote-release
|
||||
serial: true
|
||||
plan:
|
||||
- get: ci-image
|
||||
- get: git-repo
|
||||
trigger: false
|
||||
- get: artifactory-repo
|
||||
trigger: false
|
||||
passed: [stage-release]
|
||||
params:
|
||||
download_artifacts: true
|
||||
save_build_info: true
|
||||
- task: promote
|
||||
file: git-repo/ci/tasks/promote-version.yml
|
||||
params:
|
||||
RELEASE_TYPE: RELEASE
|
||||
<<: *artifactory-task-params
|
||||
<<: *sonatype-task-params
|
||||
- name: create-github-release
|
||||
serial: true
|
||||
plan:
|
||||
- get: ci-image
|
||||
- get: git-repo
|
||||
- get: artifactory-repo
|
||||
trigger: true
|
||||
passed: [promote-release]
|
||||
params:
|
||||
download_artifacts: false
|
||||
save_build_info: true
|
||||
- task: generate-changelog
|
||||
file: git-repo/ci/tasks/generate-changelog.yml
|
||||
params:
|
||||
RELEASE_TYPE: RELEASE
|
||||
<<: *github-task-params
|
||||
- put: github-release
|
||||
params:
|
||||
<<: *changelog-task-params
|
||||
|
||||
groups:
|
||||
- name: "releases"
|
||||
jobs: ["stage-milestone", "stage-rc", "stage-release", "promote-milestone", "promote-rc", "promote-release", "create-github-release"]
|
||||
- name: "ci-images"
|
||||
jobs: ["build-ci-images"]
|
||||
@@ -1,2 +0,0 @@
|
||||
source /opt/concourse-java.sh
|
||||
setup_symlinks
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
CONFIG_DIR=git-repo/ci/config
|
||||
version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' )
|
||||
|
||||
java -jar /github-changelog-generator.jar \
|
||||
--spring.config.location=${CONFIG_DIR}/changelog-generator.yml \
|
||||
${version} generated-changelog/changelog.md
|
||||
|
||||
echo ${version} > generated-changelog/version
|
||||
echo v${version} > generated-changelog/tag
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
CONFIG_DIR=git-repo/ci/config
|
||||
|
||||
version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/' )
|
||||
export BUILD_INFO_LOCATION=$(pwd)/artifactory-repo/build-info.json
|
||||
|
||||
java -jar /concourse-release-scripts.jar \
|
||||
--spring.config.location=${CONFIG_DIR}/release-scripts.yml \
|
||||
publishToCentral $RELEASE_TYPE $BUILD_INFO_LOCATION artifactory-repo || { exit 1; }
|
||||
|
||||
java -jar /concourse-release-scripts.jar \
|
||||
--spring.config.location=${CONFIG_DIR}/release-scripts.yml \
|
||||
promote $RELEASE_TYPE $BUILD_INFO_LOCATION || { exit 1; }
|
||||
|
||||
echo "Promotion complete"
|
||||
echo $version > version/version
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
source $(dirname $0)/common.sh
|
||||
repository=$(pwd)/distribution-repository
|
||||
|
||||
pushd git-repo > /dev/null
|
||||
git fetch --tags --all > /dev/null
|
||||
popd > /dev/null
|
||||
|
||||
git clone git-repo stage-git-repo > /dev/null
|
||||
|
||||
pushd stage-git-repo > /dev/null
|
||||
|
||||
snapshotVersion=$( awk -F '=' '$1 == "version" { print $2 }' gradle.properties )
|
||||
if [[ $RELEASE_TYPE = "M" ]]; then
|
||||
stageVersion=$( get_next_milestone_release $snapshotVersion)
|
||||
nextVersion=$snapshotVersion
|
||||
elif [[ $RELEASE_TYPE = "RC" ]]; then
|
||||
stageVersion=$( get_next_rc_release $snapshotVersion)
|
||||
nextVersion=$snapshotVersion
|
||||
elif [[ $RELEASE_TYPE = "RELEASE" ]]; then
|
||||
stageVersion=$( get_next_release $snapshotVersion)
|
||||
nextVersion=$( bump_version_number $snapshotVersion)
|
||||
else
|
||||
echo "Unknown release type $RELEASE_TYPE" >&2; exit 1;
|
||||
fi
|
||||
|
||||
echo "Staging $stageVersion (next version will be $nextVersion)"
|
||||
sed -i "s/version=$snapshotVersion/version=$stageVersion/" gradle.properties
|
||||
|
||||
git config user.name "Spring Builds" > /dev/null
|
||||
git config user.email "spring-builds@users.noreply.github.com" > /dev/null
|
||||
git add gradle.properties > /dev/null
|
||||
git commit -m"Release v$stageVersion" > /dev/null
|
||||
git tag -a "v$stageVersion" -m"Release v$stageVersion" > /dev/null
|
||||
|
||||
./gradlew --no-daemon --max-workers=4 -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository
|
||||
|
||||
git reset --hard HEAD^ > /dev/null
|
||||
if [[ $nextVersion != $snapshotVersion ]]; then
|
||||
echo "Setting next development version (v$nextVersion)"
|
||||
sed -i "s/version=$snapshotVersion/version=$nextVersion/" gradle.properties
|
||||
git add gradle.properties > /dev/null
|
||||
git commit -m"Next development version (v$nextVersion)" > /dev/null
|
||||
fi;
|
||||
|
||||
echo "Staging Complete"
|
||||
|
||||
popd > /dev/null
|
||||
@@ -1,30 +0,0 @@
|
||||
---
|
||||
platform: linux
|
||||
image_resource:
|
||||
type: registry-image
|
||||
source:
|
||||
repository: concourse/oci-build-task
|
||||
tag: 0.10.0
|
||||
username: ((docker-hub-username))
|
||||
password: ((docker-hub-password))
|
||||
inputs:
|
||||
- name: ci-images-git-repo
|
||||
outputs:
|
||||
- name: image
|
||||
caches:
|
||||
- path: ci-image-cache
|
||||
params:
|
||||
CONTEXT: ci-images-git-repo/ci/images
|
||||
DOCKERFILE: ci-images-git-repo/ci/images/ci-image/Dockerfile
|
||||
DOCKER_HUB_AUTH: ((docker-hub-auth))
|
||||
run:
|
||||
path: /bin/sh
|
||||
args:
|
||||
- "-c"
|
||||
- |
|
||||
mkdir -p /root/.docker
|
||||
cat > /root/.docker/config.json <<EOF
|
||||
{ "auths": { "https://index.docker.io/v1/": { "auth": "$DOCKER_HUB_AUTH" }}}
|
||||
EOF
|
||||
build
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
---
|
||||
platform: linux
|
||||
image_resource:
|
||||
type: registry-image
|
||||
source:
|
||||
repository: springio/github-changelog-generator
|
||||
tag: '0.0.8'
|
||||
username: ((docker-hub-username))
|
||||
password: ((docker-hub-password))
|
||||
inputs:
|
||||
- name: git-repo
|
||||
- name: artifactory-repo
|
||||
outputs:
|
||||
- name: generated-changelog
|
||||
params:
|
||||
GITHUB_ORGANIZATION:
|
||||
GITHUB_REPO:
|
||||
GITHUB_USERNAME:
|
||||
GITHUB_TOKEN:
|
||||
RELEASE_TYPE:
|
||||
run:
|
||||
path: git-repo/ci/scripts/generate-changelog.sh
|
||||
@@ -1,25 +0,0 @@
|
||||
---
|
||||
platform: linux
|
||||
image_resource:
|
||||
type: registry-image
|
||||
source:
|
||||
repository: springio/concourse-release-scripts
|
||||
tag: '0.4.0'
|
||||
username: ((docker-hub-username))
|
||||
password: ((docker-hub-password))
|
||||
inputs:
|
||||
- name: git-repo
|
||||
- name: artifactory-repo
|
||||
outputs:
|
||||
- name: version
|
||||
params:
|
||||
RELEASE_TYPE:
|
||||
ARTIFACTORY_SERVER:
|
||||
ARTIFACTORY_USERNAME:
|
||||
ARTIFACTORY_PASSWORD:
|
||||
SONATYPE_USER:
|
||||
SONATYPE_PASSWORD:
|
||||
SONATYPE_URL:
|
||||
SONATYPE_STAGING_PROFILE:
|
||||
run:
|
||||
path: git-repo/ci/scripts/promote-version.sh
|
||||
@@ -1,17 +0,0 @@
|
||||
---
|
||||
platform: linux
|
||||
inputs:
|
||||
- name: git-repo
|
||||
outputs:
|
||||
- name: stage-git-repo
|
||||
- name: distribution-repository
|
||||
params:
|
||||
RELEASE_TYPE:
|
||||
CI: true
|
||||
GRADLE_ENTERPRISE_CACHE_USERNAME:
|
||||
GRADLE_ENTERPRISE_CACHE_PASSWORD:
|
||||
GRADLE_ENTERPRISE_URL: https://ge.spring.io
|
||||
caches:
|
||||
- path: gradle
|
||||
run:
|
||||
path: git-repo/ci/scripts/stage-version.sh
|
||||
@@ -0,0 +1,267 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<profiles version="11">
|
||||
<profile kind="CodeFormatterProfile" name="Spring" version="11">
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
||||
</profile>
|
||||
</profiles>
|
||||
@@ -1,23 +0,0 @@
|
||||
description = "Spring Framework (Bill of Materials)"
|
||||
|
||||
apply plugin: 'java-platform'
|
||||
apply from: "$rootDir/gradle/publications.gradle"
|
||||
|
||||
group = "org.springframework"
|
||||
|
||||
dependencies {
|
||||
constraints {
|
||||
parent.moduleProjects.sort { "$it.name" }.each {
|
||||
api it
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifactId = 'spring-framework-bom'
|
||||
from components.javaPlatform
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
version=5.3.37
|
||||
org.gradle.jvmargs=-Xmx2048m
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
kotlin.stdlib.default.dependency=false
|
||||
@@ -1,30 +0,0 @@
|
||||
tasks.findByName("dokkaHtmlPartial")?.configure {
|
||||
outputDirectory.set(new File(buildDir, "docs/kdoc"))
|
||||
dokkaSourceSets {
|
||||
configureEach {
|
||||
sourceRoots.setFrom(file("src/main/kotlin"))
|
||||
classpath.from(sourceSets["main"].runtimeClasspath)
|
||||
externalDocumentationLink {
|
||||
url.set(new URL("https://docs.spring.io/spring-framework/docs/5.3.x/javadoc-api/"))
|
||||
}
|
||||
externalDocumentationLink {
|
||||
url.set(new URL("https://projectreactor.io/docs/core/release/api/"))
|
||||
}
|
||||
externalDocumentationLink {
|
||||
url.set(new URL("https://www.reactive-streams.org/reactive-streams-1.0.3-javadoc/"))
|
||||
}
|
||||
externalDocumentationLink {
|
||||
url.set(new URL("https://kotlin.github.io/kotlinx.coroutines/"))
|
||||
}
|
||||
externalDocumentationLink {
|
||||
url.set(new URL("https://javadoc.io/doc/org.hamcrest/hamcrest/2.1/"))
|
||||
}
|
||||
externalDocumentationLink {
|
||||
url.set(new URL("https://javadoc.io/doc/javax.servlet/javax.servlet-api/latest/"))
|
||||
}
|
||||
externalDocumentationLink {
|
||||
url.set(new URL("https://javadoc.io/static/io.rsocket/rsocket-core/1.1.1/"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,249 +0,0 @@
|
||||
configurations {
|
||||
asciidoctorExt
|
||||
}
|
||||
|
||||
dependencies {
|
||||
asciidoctorExt("io.spring.asciidoctor:spring-asciidoctor-extensions-block-switch:0.6.1")
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url "https://repo.spring.io/release"
|
||||
mavenContent {
|
||||
includeGroup "io.spring.asciidoctor"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce Javadoc for all Spring Framework modules in "build/docs/javadoc"
|
||||
*/
|
||||
task api(type: Javadoc) {
|
||||
group = "Documentation"
|
||||
description = "Generates aggregated Javadoc API documentation."
|
||||
title = "${rootProject.description} ${version} API"
|
||||
|
||||
dependsOn {
|
||||
moduleProjects.collect {
|
||||
it.tasks.getByName("jar")
|
||||
}
|
||||
}
|
||||
doFirst {
|
||||
classpath = files(
|
||||
// ensure the javadoc process can resolve types compiled from .aj sources
|
||||
project(":spring-aspects").sourceSets.main.output
|
||||
)
|
||||
classpath += files(moduleProjects.collect { it.sourceSets.main.compileClasspath })
|
||||
}
|
||||
|
||||
options {
|
||||
encoding = "UTF-8"
|
||||
memberLevel = JavadocMemberLevel.PROTECTED
|
||||
author = true
|
||||
header = rootProject.description
|
||||
use = true
|
||||
overview = "src/docs/api/overview.html"
|
||||
stylesheetFile = file("src/docs/api/stylesheet.css")
|
||||
splitIndex = true
|
||||
links(project.ext.javadocLinks)
|
||||
addBooleanOption('Xdoclint:syntax', true) // only check syntax with doclint
|
||||
addBooleanOption('Xwerror', true) // fail build on Javadoc warnings
|
||||
if (JavaVersion.current().isJava9Compatible()) {
|
||||
addBooleanOption('html5', true)
|
||||
}
|
||||
}
|
||||
source moduleProjects.collect { project ->
|
||||
project.sourceSets.main.allJava
|
||||
}
|
||||
maxMemory = "1024m"
|
||||
destinationDir = file("$buildDir/docs/javadoc")
|
||||
}
|
||||
|
||||
/**
|
||||
* Produce KDoc for all Spring Framework modules in "build/docs/kdoc"
|
||||
*/
|
||||
pluginManager.withPlugin("kotlin") {
|
||||
tasks.dokkaHtmlMultiModule.configure {
|
||||
dependsOn {
|
||||
tasks.getByName("api")
|
||||
}
|
||||
moduleName.set("spring-framework")
|
||||
outputDirectory.set(project.file("$buildDir/docs/kdoc"))
|
||||
}
|
||||
}
|
||||
|
||||
task downloadResources(type: Download) {
|
||||
src "https://repo.spring.io/artifactory/snapshot/io/spring/docresources/" +
|
||||
"spring-doc-resources/0.2.6-SNAPSHOT/spring-doc-resources-0.2.6-20210308.231804-2.zip"
|
||||
dest project.file("$buildDir/docs/spring-doc-resources.zip")
|
||||
onlyIfModified true
|
||||
useETag "all"
|
||||
}
|
||||
|
||||
task extractDocResources(type: Copy, dependsOn: downloadResources) {
|
||||
from project.zipTree(downloadResources.dest);
|
||||
into "$buildDir/docs/spring-docs-resources/"
|
||||
}
|
||||
|
||||
asciidoctorj {
|
||||
def docRoot = 'https://docs.spring.io'
|
||||
def docsSpringFramework = "${docRoot}/spring-framework/docs/${project.version}"
|
||||
version = '2.4.1'
|
||||
fatalWarnings ".*"
|
||||
options doctype: 'book', eruby: 'erubis'
|
||||
attributes([
|
||||
icons: 'font',
|
||||
idprefix: '',
|
||||
idseparator: '-',
|
||||
docinfo: 'shared,private-header', // https://docs.asciidoctor.org/asciidoctor/latest/docinfo/
|
||||
revnumber: project.version,
|
||||
sectanchors: '',
|
||||
sectnums: '',
|
||||
'source-highlighter': 'highlight.js',
|
||||
highlightjsdir: 'js/highlight',
|
||||
'highlightjs-theme': 'googlecode',
|
||||
stylesdir: 'css/',
|
||||
stylesheet: 'stylesheet.css',
|
||||
'spring-version': project.version,
|
||||
'spring-framework-main-code': 'https://github.com/spring-projects/spring-framework/tree/main',
|
||||
'doc-root': docRoot,
|
||||
'docs-spring-framework': docsSpringFramework,
|
||||
'api-spring-framework': "${docsSpringFramework}/javadoc-api/org/springframework"
|
||||
])
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the Spring Framework Reference documentation from "src/docs/asciidoc"
|
||||
* in "build/docs/ref-docs/html5".
|
||||
*/
|
||||
asciidoctor {
|
||||
baseDirFollowsSourceDir()
|
||||
configurations 'asciidoctorExt'
|
||||
sources {
|
||||
include '*.adoc'
|
||||
}
|
||||
outputDir "$buildDir/docs/ref-docs/html5"
|
||||
logDocuments = true
|
||||
resources {
|
||||
from(sourceDir) {
|
||||
include 'images/*.png', 'css/**', 'js/**'
|
||||
}
|
||||
from extractDocResources
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the Spring Framework Reference documentation from "src/docs/asciidoc"
|
||||
* in "build/docs/ref-docs/pdf".
|
||||
*/
|
||||
asciidoctorPdf {
|
||||
baseDirFollowsSourceDir()
|
||||
configurations 'asciidoctorExt'
|
||||
sources {
|
||||
include '*.adoc'
|
||||
}
|
||||
outputDir "$buildDir/docs/ref-docs/pdf"
|
||||
logDocuments = true
|
||||
}
|
||||
|
||||
/**
|
||||
* Zip all docs (API and reference) into a single archive
|
||||
*/
|
||||
task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor', 'asciidoctorPdf', 'dokkaHtmlMultiModule']) {
|
||||
group = "Distribution"
|
||||
description = "Builds -${archiveClassifier} archive containing api and reference " +
|
||||
"for deployment at https://docs.spring.io/spring-framework/docs/."
|
||||
|
||||
archiveBaseName.set("spring-framework")
|
||||
archiveClassifier.set("docs")
|
||||
from("src/dist") {
|
||||
include "changelog.txt"
|
||||
}
|
||||
from (api) {
|
||||
into "javadoc-api"
|
||||
}
|
||||
from ("$asciidoctor.outputDir") {
|
||||
into "reference/html"
|
||||
}
|
||||
from ("$asciidoctorPdf.outputDir") {
|
||||
into "reference/pdf"
|
||||
}
|
||||
from (dokkaHtmlMultiModule.outputDirectory) {
|
||||
into "kdoc-api"
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Zip all Spring Framework schemas into a single archive
|
||||
*/
|
||||
task schemaZip(type: Zip) {
|
||||
group = "Distribution"
|
||||
archiveBaseName.set("spring-framework")
|
||||
archiveClassifier.set("schema")
|
||||
description = "Builds -${archiveClassifier} archive containing all " +
|
||||
"XSDs for deployment at https://springframework.org/schema."
|
||||
duplicatesStrategy DuplicatesStrategy.EXCLUDE
|
||||
moduleProjects.each { module ->
|
||||
def Properties schemas = new Properties();
|
||||
|
||||
module.sourceSets.main.resources.find {
|
||||
(it.path.endsWith("META-INF/spring.schemas") || it.path.endsWith("META-INF\\spring.schemas"))
|
||||
}?.withInputStream { schemas.load(it) }
|
||||
|
||||
for (def key : schemas.keySet()) {
|
||||
def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
|
||||
assert shortName != key
|
||||
File xsdFile = module.sourceSets.main.resources.find {
|
||||
(it.path.endsWith(schemas.get(key)) || it.path.endsWith(schemas.get(key).replaceAll('\\/','\\\\')))
|
||||
}
|
||||
assert xsdFile != null
|
||||
into (shortName) {
|
||||
from xsdFile.path
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a distribution zip with everything:
|
||||
* docs, schemas, jars, source jars, javadoc jars
|
||||
*/
|
||||
task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
|
||||
group = "Distribution"
|
||||
archiveBaseName.set("spring-framework")
|
||||
archiveClassifier.set("dist")
|
||||
description = "Builds -${archiveClassifier} archive, containing all jars and docs, " +
|
||||
"suitable for community download page."
|
||||
|
||||
ext.baseDir = "spring-framework-${project.version}";
|
||||
|
||||
from("src/docs/dist") {
|
||||
include "readme.txt"
|
||||
include "license.txt"
|
||||
include "notice.txt"
|
||||
into "${baseDir}"
|
||||
expand(copyright: new Date().format("yyyy"), version: project.version)
|
||||
}
|
||||
|
||||
from(zipTree(docsZip.archiveFile)) {
|
||||
into "${baseDir}/docs"
|
||||
}
|
||||
|
||||
from(zipTree(schemaZip.archiveFile)) {
|
||||
into "${baseDir}/schema"
|
||||
}
|
||||
|
||||
moduleProjects.each { module ->
|
||||
into ("${baseDir}/libs") {
|
||||
from module.jar
|
||||
if (module.tasks.findByPath("sourcesJar")) {
|
||||
from module.sourcesJar
|
||||
}
|
||||
if (module.tasks.findByPath("javadocJar")) {
|
||||
from module.javadocJar
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
distZip.mustRunAfter moduleProjects.check
|
||||
@@ -1,90 +0,0 @@
|
||||
import org.gradle.plugins.ide.eclipse.model.ProjectDependency
|
||||
import org.gradle.plugins.ide.eclipse.model.SourceFolder
|
||||
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
eclipse.jdt {
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
}
|
||||
|
||||
// Replace classpath entries with project dependencies (GRADLE-1116)
|
||||
// https://issues.gradle.org/browse/GRADLE-1116
|
||||
eclipse.classpath.file.whenMerged { classpath ->
|
||||
def regexp = /.*?\/([^\/]+)\/build\/([^\/]+\/)+(?:main|test)/ // only match those that end in main or test (avoids removing necessary entries like build/classes/jaxb)
|
||||
def projectOutputDependencies = classpath.entries.findAll { entry -> entry.path =~ regexp }
|
||||
projectOutputDependencies.each { entry ->
|
||||
def matcher = (entry.path =~ regexp)
|
||||
if (matcher) {
|
||||
def projectName = matcher[0][1]
|
||||
def path = "/${projectName}"
|
||||
if (!classpath.entries.find { e -> e instanceof ProjectDependency && e.path == path }) {
|
||||
def recursiveDependency = entry.path.matches('.+/' + projectName + '/build/([^/]+/)+(?:main|test)')
|
||||
// Avoid recursive dependency on current project.
|
||||
if (!recursiveDependency) {
|
||||
classpath.entries.add(new ProjectDependency(path))
|
||||
}
|
||||
}
|
||||
classpath.entries.remove(entry)
|
||||
}
|
||||
}
|
||||
|
||||
// Remove any remaining direct depencencies on JARs in the build/libs folder
|
||||
// except Spring's spring-cglib-repack and spring-objenesis-repack JARs.
|
||||
classpath.entries.removeAll { entry -> (entry.path =~ /(?!.*?repack.*\.jar).*?\/([^\/]+)\/build\/libs\/[^\/]+\.jar/) }
|
||||
}
|
||||
|
||||
// Use separate main/test outputs (prevents WTP from packaging test classes)
|
||||
eclipse.classpath.defaultOutputDir = file(project.name + '/bin/eclipse')
|
||||
eclipse.classpath.file.beforeMerged { classpath ->
|
||||
classpath.entries.findAll{ it instanceof SourceFolder }.each {
|
||||
if (it.output.startsWith('bin/')) {
|
||||
it.output = null
|
||||
}
|
||||
}
|
||||
}
|
||||
eclipse.classpath.file.whenMerged {
|
||||
entries.findAll{ it instanceof SourceFolder }.each {
|
||||
it.output = 'bin/' + it.path.split('/')[1]
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure project dependencies come after 3rd-party libs (SPR-11836)
|
||||
// https://jira.spring.io/browse/SPR-11836
|
||||
eclipse.classpath.file.whenMerged {
|
||||
entries.findAll { it instanceof ProjectDependency }.each {
|
||||
// delete from original position
|
||||
entries.remove(it)
|
||||
// append to end of classpath
|
||||
entries.add(it)
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure that JMH sources and resources are treated as test classpath entries
|
||||
// so that they can see test fixtures.
|
||||
// https://github.com/melix/jmh-gradle-plugin/issues/157
|
||||
eclipse.classpath.file.whenMerged {
|
||||
entries.findAll { it.path =~ /src\/jmh\/(java|resources)/ }.each {
|
||||
it.entryAttributes['test'] = 'true'
|
||||
}
|
||||
}
|
||||
|
||||
// Include project specific settings
|
||||
task eclipseSettings(type: Copy) {
|
||||
from rootProject.files(
|
||||
'src/eclipse/org.eclipse.core.resources.prefs',
|
||||
'src/eclipse/org.eclipse.jdt.core.prefs',
|
||||
'src/eclipse/org.eclipse.jdt.ui.prefs')
|
||||
into project.file('.settings/')
|
||||
outputs.upToDateWhen { false }
|
||||
}
|
||||
|
||||
task cleanEclipseSettings(type: Delete) {
|
||||
delete project.file('.settings/org.eclipse.core.resources.prefs')
|
||||
delete project.file('.settings/org.eclipse.jdt.core.prefs')
|
||||
delete project.file('.settings/org.eclipse.jdt.ui.prefs')
|
||||
}
|
||||
|
||||
tasks['eclipse'].dependsOn(eclipseSettings)
|
||||
tasks['eclipseJdt'].dependsOn(eclipseSettings)
|
||||
tasks['cleanEclipse'].dependsOn(cleanEclipseSettings)
|
||||
@@ -1,64 +0,0 @@
|
||||
apply plugin: "maven-publish"
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
pom {
|
||||
afterEvaluate {
|
||||
name = project.description
|
||||
description = project.description
|
||||
}
|
||||
url = "https://github.com/spring-projects/spring-framework"
|
||||
organization {
|
||||
name = "Spring IO"
|
||||
url = "https://spring.io/projects/spring-framework"
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name = "Apache License, Version 2.0"
|
||||
url = "https://www.apache.org/licenses/LICENSE-2.0"
|
||||
distribution = "repo"
|
||||
}
|
||||
}
|
||||
scm {
|
||||
url = "https://github.com/spring-projects/spring-framework"
|
||||
connection = "scm:git:git://github.com/spring-projects/spring-framework"
|
||||
developerConnection = "scm:git:git://github.com/spring-projects/spring-framework"
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id = "jhoeller"
|
||||
name = "Juergen Hoeller"
|
||||
email = "jhoeller@pivotal.io"
|
||||
}
|
||||
}
|
||||
issueManagement {
|
||||
system = "GitHub"
|
||||
url = "https://github.com/spring-projects/spring-framework/issues"
|
||||
}
|
||||
}
|
||||
versionMapping {
|
||||
usage('java-api') {
|
||||
fromResolutionResult()
|
||||
}
|
||||
usage('java-runtime') {
|
||||
fromResolutionResult()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configureDeploymentRepository(project)
|
||||
|
||||
void configureDeploymentRepository(Project project) {
|
||||
project.plugins.withType(MavenPublishPlugin.class).all {
|
||||
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
|
||||
if (project.hasProperty("deploymentRepository")) {
|
||||
publishing.repositories.maven {
|
||||
it.url = project.property("deploymentRepository")
|
||||
it.name = "deployment"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'org.springframework.build.compile'
|
||||
apply plugin: 'org.springframework.build.optional-dependencies'
|
||||
// Uncomment the following for Shadow support in the jmhJar block.
|
||||
// Currently commented out due to ZipException: archive is not a ZIP archive
|
||||
// apply plugin: 'com.github.johnrengelman.shadow'
|
||||
apply plugin: 'me.champeau.jmh'
|
||||
apply from: "$rootDir/gradle/publications.gradle"
|
||||
|
||||
dependencies {
|
||||
jmh 'org.openjdk.jmh:jmh-core:1.32'
|
||||
jmh 'org.openjdk.jmh:jmh-generator-annprocess:1.32'
|
||||
jmh 'net.sf.jopt-simple:jopt-simple'
|
||||
}
|
||||
|
||||
jmh {
|
||||
duplicateClassesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
|
||||
tasks.findByName("processJmhResources").configure {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
|
||||
jmhJar {
|
||||
// Uncomment the following for Shadow's Transformer support.
|
||||
// mergeServiceFiles()
|
||||
// append('META-INF/spring.handlers')
|
||||
// append('META-INF/spring.schemas')
|
||||
// append('META-INF/spring.tooling')
|
||||
exclude 'LICENSE'
|
||||
exclude 'THIRD-PARTY'
|
||||
exclude 'META-INF/license.txt'
|
||||
exclude 'META-INF/notice.txt'
|
||||
exclude 'META-INF/DEPENDENCIES'
|
||||
exclude 'META-INF/LICENSE*'
|
||||
exclude 'META-INF/NOTICE'
|
||||
exclude 'META-INF/THIRD-PARTY'
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest.attributes["Implementation-Title"] = project.name
|
||||
manifest.attributes["Implementation-Version"] = project.version
|
||||
manifest.attributes["Automatic-Module-Name"] = project.name.replace('-', '.') // for Jigsaw
|
||||
manifest.attributes["Created-By"] =
|
||||
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
|
||||
|
||||
from("${rootDir}/src/docs/dist") {
|
||||
include "license.txt"
|
||||
include "notice.txt"
|
||||
into "META-INF"
|
||||
expand(copyright: new Date().format("yyyy"), version: project.version)
|
||||
}
|
||||
}
|
||||
|
||||
normalization {
|
||||
runtimeClasspath {
|
||||
ignore "META-INF/MANIFEST.MF"
|
||||
}
|
||||
}
|
||||
|
||||
javadoc {
|
||||
description = "Generates project-level javadoc for use in -javadoc jar"
|
||||
|
||||
options.encoding = "UTF-8"
|
||||
options.memberLevel = JavadocMemberLevel.PROTECTED
|
||||
options.author = true
|
||||
options.header = project.name
|
||||
options.use = true
|
||||
options.links(project.ext.javadocLinks)
|
||||
options.addStringOption("Xdoclint:none", "-quiet")
|
||||
|
||||
// Suppress warnings due to cross-module @see and @link references.
|
||||
// Note that global 'api' task does display all warnings.
|
||||
logging.captureStandardError LogLevel.INFO
|
||||
logging.captureStandardOutput LogLevel.INFO // suppress "## warnings" message
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
archiveClassifier.set("sources")
|
||||
from sourceSets.main.allSource
|
||||
// Don't include or exclude anything explicitly by default. See SPR-12085.
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar) {
|
||||
archiveClassifier.set("javadoc")
|
||||
from javadoc
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
from components.java
|
||||
artifact sourcesJar
|
||||
artifact javadocJar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Disable publication of test fixture artifacts.
|
||||
components.java.withVariantsFromConfiguration(configurations.testFixturesApiElements) { skip() }
|
||||
components.java.withVariantsFromConfiguration(configurations.testFixturesRuntimeElements) { skip() }
|
||||
@@ -1,171 +0,0 @@
|
||||
/**
|
||||
* Apply the JVM Toolchain conventions
|
||||
* See https://docs.gradle.org/current/userguide/toolchains.html
|
||||
*
|
||||
* One can choose the toolchain to use for compiling the MAIN sources and/or compiling
|
||||
* and running the TEST sources. These options apply to Java, Kotlin and Groovy sources
|
||||
* when available.
|
||||
* {@code "./gradlew check -PmainToolchain=8 -PtestToolchain=11"} will use:
|
||||
* <ul>
|
||||
* <li>a JDK8 toolchain for compiling the main SourceSet
|
||||
* <li>a JDK11 toolchain for compiling and running the test SourceSet
|
||||
* </ul>
|
||||
*
|
||||
* By default, the build will fall back to using the current JDK and 1.8 language level for all sourceSets.
|
||||
*
|
||||
* Gradle will automatically detect JDK distributions in well-known locations.
|
||||
* The following command will list the detected JDKs on the host.
|
||||
* {@code
|
||||
* $ ./gradlew -q javaToolchains
|
||||
* }
|
||||
*
|
||||
* We can also configure ENV variables and let Gradle know about them:
|
||||
* {@code
|
||||
* $ echo JDK11
|
||||
* /opt/openjdk/java11
|
||||
* $ echo JDK15
|
||||
* /opt/openjdk/java15
|
||||
* $ ./gradlew -Porg.gradle.java.installations.fromEnv=JDK11,JDK15 check
|
||||
* }
|
||||
*
|
||||
* @author Brian Clozel
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
|
||||
def mainToolchainConfigured() {
|
||||
return project.hasProperty('mainToolchain') && project.mainToolchain
|
||||
}
|
||||
|
||||
def testToolchainConfigured() {
|
||||
return project.hasProperty('testToolchain') && project.testToolchain
|
||||
}
|
||||
|
||||
def mainToolchainLanguageVersion() {
|
||||
if (mainToolchainConfigured()) {
|
||||
return JavaLanguageVersion.of(project.mainToolchain.toString())
|
||||
}
|
||||
return JavaLanguageVersion.of(8)
|
||||
}
|
||||
|
||||
def testToolchainLanguageVersion() {
|
||||
if (testToolchainConfigured()) {
|
||||
return JavaLanguageVersion.of(project.testToolchain.toString())
|
||||
}
|
||||
return mainToolchainLanguageVersion()
|
||||
}
|
||||
|
||||
plugins.withType(JavaPlugin) {
|
||||
// Configure the Java Toolchain if the 'mainToolchain' is configured
|
||||
if (mainToolchainConfigured()) {
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = mainToolchainLanguageVersion()
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Fallback to JDK8
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
// Configure a specific Java Toolchain for compiling and running tests if the 'testToolchain' property is defined
|
||||
if (testToolchainConfigured()) {
|
||||
def testLanguageVersion = testToolchainLanguageVersion()
|
||||
tasks.withType(JavaCompile).matching { it.name.contains("Test") }.configureEach {
|
||||
javaCompiler = javaToolchains.compilerFor {
|
||||
languageVersion = testLanguageVersion
|
||||
}
|
||||
}
|
||||
tasks.withType(Test).configureEach{
|
||||
javaLauncher = javaToolchains.launcherFor {
|
||||
languageVersion = testLanguageVersion
|
||||
}
|
||||
if(testLanguageVersion == JavaLanguageVersion.of(17)) {
|
||||
jvmArgs(["--add-opens=java.base/java.lang=ALL-UNNAMED",
|
||||
"--add-opens=java.base/java.util=ALL-UNNAMED"])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
plugins.withType(GroovyPlugin) {
|
||||
// Fallback to JDK8
|
||||
if (!mainToolchainConfigured()) {
|
||||
compileGroovy {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pluginManager.withPlugin("kotlin") {
|
||||
// Configure the Kotlin compiler if the 'mainToolchain' property is defined
|
||||
if (mainToolchainConfigured()) {
|
||||
def mainLanguageVersion = mainToolchainLanguageVersion()
|
||||
def compiler = javaToolchains.compilerFor {
|
||||
languageVersion = mainLanguageVersion
|
||||
}
|
||||
// See https://kotlinlang.org/docs/gradle.html#attributes-specific-for-jvm
|
||||
def javaVersion = mainLanguageVersion.toString() == '8' ? '1.8' : mainLanguageVersion.toString()
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = javaVersion
|
||||
jdkHome = compiler.get().metadata.installationPath.asFile.absolutePath
|
||||
}
|
||||
}
|
||||
// Compile the test classes with the same version, 'testToolchain' will override if defined
|
||||
compileTestKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = javaVersion
|
||||
jdkHome = compiler.get().metadata.installationPath.asFile.absolutePath
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Fallback to JDK8
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
}
|
||||
compileTestKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Configure the JMH plugin to use the toolchain for generating and running JMH bytecode
|
||||
pluginManager.withPlugin("me.champeau.jmh") {
|
||||
if (mainToolchainConfigured() || testToolchainConfigured()) {
|
||||
tasks.matching { it.name.contains('jmh') && it.hasProperty('javaLauncher') }.configureEach {
|
||||
javaLauncher.set(javaToolchains.launcherFor {
|
||||
languageVersion.set(testToolchainLanguageVersion())
|
||||
})
|
||||
}
|
||||
tasks.withType(JavaCompile).matching { it.name.contains("Jmh") }.configureEach {
|
||||
javaCompiler = javaToolchains.compilerFor {
|
||||
languageVersion = testToolchainLanguageVersion()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Store resolved Toolchain JVM information as custom values in the build scan.
|
||||
rootProject.ext {
|
||||
resolvedMainToolchain = false
|
||||
resolvedTestToolchain = false
|
||||
}
|
||||
gradle.taskGraph.afterTask { Task task, TaskState state ->
|
||||
if (mainToolchainConfigured() && !resolvedMainToolchain && task instanceof JavaCompile && task.javaCompiler.isPresent()) {
|
||||
def metadata = task.javaCompiler.get().metadata
|
||||
task.project.buildScan.value('Main toolchain', "$metadata.vendor $metadata.languageVersion ($metadata.installationPath)")
|
||||
resolvedMainToolchain = true
|
||||
}
|
||||
if (testToolchainConfigured() && !resolvedTestToolchain && task instanceof Test && task.javaLauncher.isPresent()) {
|
||||
def metadata = task.javaLauncher.get().metadata
|
||||
task.project.buildScan.value('Test toolchain', "$metadata.vendor $metadata.languageVersion ($metadata.installationPath)")
|
||||
resolvedTestToolchain = true
|
||||
}
|
||||
}
|
||||
Vendored
BIN
Binary file not shown.
-5
@@ -1,5 +0,0 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -1,234 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
Vendored
-89
@@ -1,89 +0,0 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -1,56 +0,0 @@
|
||||
# Spring Framework - Eclipse/STS Project Import Guide
|
||||
|
||||
This document will guide you through the process of importing the Spring Framework
|
||||
projects into Eclipse or the Spring Tool Suite (_STS_). It is recommended that you
|
||||
have a recent version of Eclipse. As a bare minimum you will need Eclipse with full Java
|
||||
8 support, Eclipse Buildship, and the Groovy plugin.
|
||||
|
||||
The following instructions have been tested against [STS](https://spring.io/tools) 4.12.0
|
||||
([download](https://github.com/spring-projects/sts4/wiki/Previous-Versions#spring-tools-4120-changelog))
|
||||
(based on Eclipse 4.21) with [Eclipse Buildship](https://projects.eclipse.org/projects/tools.buildship).
|
||||
The instructions should work with the latest Eclipse distribution as long as you install
|
||||
[Buildship](https://marketplace.eclipse.org/content/buildship-gradle-integration). Note
|
||||
that STS 4 comes with Buildship preinstalled.
|
||||
|
||||
## Steps
|
||||
|
||||
_When instructed to execute `./gradlew` from the command line, be sure to execute it within your locally cloned `spring-framework` working directory._
|
||||
|
||||
1. Install the [Groovy Development Tools](https://marketplace.eclipse.org/content/groovy-development-tools).
|
||||
1. Switch to Groovy 3.0 in Eclipse (Preferences → Groovy → Compiler → Switch to 3.0...).
|
||||
- If you encounter build errors stating something similar to _"Groovy: compiler mismatch: project level is 2.5, workspace level is 3.0"_, change the Groovy compiler version to 3.0 for each affected project.
|
||||
1. Ensure that the _Forbidden reference (access rule)_ in Eclipse is set to `Info`
|
||||
(Preferences → Java → Compiler → Errors/Warnings → Deprecated and restricted API → Forbidden reference (access rule)).
|
||||
1. Optionally install the [Kotlin Plugin for Eclipse](https://marketplace.eclipse.org/content/kotlin-plugin-eclipse) if you need to execute Kotlin-based tests or develop Kotlin extensions.
|
||||
- **NOTE**: As of September 21, 2021, it appears that the Kotlin Plugin for Eclipse does not yet work with Eclipse 4.21.
|
||||
1. Optionally install the [AspectJ Development Tools](https://marketplace.eclipse.org/content/aspectj-development-tools) (_AJDT_) if you need to work with the `spring-aspects` project.
|
||||
- **NOTE**: As of September 21, 2021, it appears that the AspectJ Development Tools do not yet work with Eclipse 4.21.
|
||||
1. Optionally install the [TestNG plugin](https://testng.org/doc/eclipse.html) in Eclipse if you need to execute individual TestNG test classes or tests in the `spring-test` module.
|
||||
- As an alternative to installing the TestNG plugin, you can execute the `org.springframework.test.context.testng.TestNGTestSuite` class as a "JUnit 5" test class in Eclipse.
|
||||
1. Build `spring-oxm` from the command line with `./gradlew :spring-oxm:check`.
|
||||
1. To apply Spring Framework specific settings, run `./gradlew cleanEclipse eclipse` from the command line.
|
||||
1. Import all projects into Eclipse (File → Import → Gradle → Existing Gradle Project → Navigate to the locally cloned `spring-framework` directory → Select Finish).
|
||||
- If you have not installed AJDT, exclude the `spring-aspects` project from the import, if prompted, or close it after the import.
|
||||
- If you run into errors during the import, you may need to set the _Java home_ for Gradle Buildship to the location of your JDK 8 installation in Eclipse (Preferences → Gradle → Java home).
|
||||
1. If you need to execute JAXB-related tests in the `spring-oxm` project and wish to have the generated sources available, add the `build/generated-sources/jaxb` folder to the build path (right click on the `jaxb` folder and select "Build Path → Use as Source Folder").
|
||||
- If you do not see the `build` folder in the `spring-oxm` project, ensure that the "Gradle build folder" is not filtered out from the view. This setting is available under "Filters" in the configuration of the Package Explorer (available by clicking on the _three vertical dots_ in the upper right corner of the Package Explorer).
|
||||
1. Code away!
|
||||
|
||||
## Known Issues
|
||||
|
||||
1. `spring-core` should be pre-compiled due to repackaged dependencies.
|
||||
- See `*RepackJar` tasks in the `spring-core.gradle` build file.
|
||||
1. `spring-oxm` should be pre-compiled due to JAXB types generated for tests.
|
||||
- Note that executing `./gradlew :spring-oxm:check` as explained in the _Steps_ above will compile `spring-core` and generate JAXB types for `spring-oxm`.
|
||||
1. `spring-aspects` does not compile due to references to aspect types unknown to Eclipse.
|
||||
- If you installed _AJDT_ into Eclipse it should work.
|
||||
1. While JUnit tests pass from the command line with Gradle, some may fail when run from
|
||||
the IDE.
|
||||
- Resolving this is a work in progress.
|
||||
- If attempting to run all JUnit tests from within the IDE, you may need to set the following VM options to avoid out of memory errors: `-XX:MaxPermSize=2048m -Xmx2048m -XX:MaxHeapSize=2048m`
|
||||
|
||||
## Tips
|
||||
|
||||
In any case, please do not check in your own generated `.classpath` file, `.project`
|
||||
file, or `.settings` folder. You'll notice these files are already intentionally in
|
||||
`.gitignore`. The same policy holds for IDEA metadata.
|
||||
@@ -1,36 +0,0 @@
|
||||
The following has been tested against IntelliJ IDEA 2016.2.2
|
||||
|
||||
## Steps
|
||||
|
||||
_Within your locally cloned spring-framework working directory:_
|
||||
|
||||
1. Precompile `spring-oxm` with `./gradlew :spring-oxm:compileTestJava`
|
||||
2. Import into IntelliJ (File -> New -> Project from Existing Sources -> Navigate to directory -> Select build.gradle)
|
||||
3. When prompted exclude the `spring-aspects` module (or after the import via File-> Project Structure -> Modules)
|
||||
4. Code away
|
||||
|
||||
## Known issues
|
||||
|
||||
1. `spring-core` and `spring-oxm` should be pre-compiled due to repackaged dependencies.
|
||||
See `*RepackJar` tasks in the build and https://youtrack.jetbrains.com/issue/IDEA-160605).
|
||||
2. `spring-aspects` does not compile due to references to aspect types unknown to
|
||||
IntelliJ IDEA. See https://youtrack.jetbrains.com/issue/IDEA-64446 for details. In the meantime, the
|
||||
'spring-aspects' can be excluded from the project to avoid compilation errors.
|
||||
3. While JUnit tests pass from the command line with Gradle, some may fail when run from
|
||||
IntelliJ IDEA. Resolving this is a work in progress. If attempting to run all JUnit tests from within
|
||||
IntelliJ IDEA, you will likely need to set the following VM options to avoid out of memory errors:
|
||||
-XX:MaxPermSize=2048m -Xmx2048m -XX:MaxHeapSize=2048m
|
||||
4. If you invoke "Rebuild Project" in the IDE, you'll have to generate some test
|
||||
resources of the `spring-oxm` module again (`./gradlew :spring-oxm:compileTestJava`)
|
||||
|
||||
|
||||
## Tips
|
||||
|
||||
In any case, please do not check in your own generated .iml, .ipr, or .iws files.
|
||||
You'll notice these files are already intentionally in .gitignore. The same policy goes for eclipse metadata.
|
||||
|
||||
## FAQ
|
||||
|
||||
Q. What about IntelliJ IDEA's own [Gradle support](https://www.jetbrains.com/help/idea/gradle.html)?
|
||||
|
||||
A. Keep an eye on https://youtrack.jetbrains.com/issue/IDEA-53476
|
||||
@@ -1,30 +0,0 @@
|
||||
description = "Spring Integration Tests"
|
||||
|
||||
dependencies {
|
||||
testImplementation(project(":spring-aop"))
|
||||
testImplementation(project(":spring-beans"))
|
||||
testImplementation(project(":spring-context"))
|
||||
testImplementation(project(":spring-core"))
|
||||
testImplementation(testFixtures(project(":spring-aop")))
|
||||
testImplementation(testFixtures(project(":spring-beans")))
|
||||
testImplementation(testFixtures(project(":spring-core")))
|
||||
testImplementation(testFixtures(project(":spring-tx")))
|
||||
testImplementation(project(":spring-expression"))
|
||||
testImplementation(project(":spring-jdbc"))
|
||||
testImplementation(project(":spring-orm"))
|
||||
testImplementation(project(":spring-test"))
|
||||
testImplementation(project(":spring-tx"))
|
||||
testImplementation(project(":spring-web"))
|
||||
testImplementation("javax.inject:javax.inject")
|
||||
testImplementation("javax.resource:javax.resource-api")
|
||||
testImplementation("javax.servlet:javax.servlet-api")
|
||||
testImplementation("org.aspectj:aspectjweaver")
|
||||
testImplementation("org.hsqldb:hsqldb")
|
||||
testImplementation("org.hibernate:hibernate-core")
|
||||
}
|
||||
|
||||
normalization {
|
||||
runtimeClasspath {
|
||||
ignore "META-INF/MANIFEST.MF"
|
||||
}
|
||||
}
|
||||
-119
@@ -1,119 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.aop.config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatException;
|
||||
|
||||
/**
|
||||
* Integration tests for advice invocation order for advice configured via the
|
||||
* AOP namespace.
|
||||
*
|
||||
* @author Sam Brannen
|
||||
* @since 5.2.7
|
||||
* @see org.springframework.aop.framework.autoproxy.AspectJAutoProxyAdviceOrderIntegrationTests
|
||||
*/
|
||||
class AopNamespaceHandlerAdviceOrderIntegrationTests {
|
||||
|
||||
@Nested
|
||||
@SpringJUnitConfig(locations = "AopNamespaceHandlerAdviceOrderIntegrationTests-afterFirst.xml")
|
||||
@DirtiesContext
|
||||
class AfterAdviceFirstTests {
|
||||
|
||||
@Test
|
||||
void afterAdviceIsInvokedFirst(@Autowired Echo echo, @Autowired InvocationTrackingAspect aspect) throws Exception {
|
||||
assertThat(aspect.invocations).isEmpty();
|
||||
assertThat(echo.echo(42)).isEqualTo(42);
|
||||
assertThat(aspect.invocations).containsExactly("around - start", "before", "around - end", "after", "after returning");
|
||||
|
||||
aspect.invocations.clear();
|
||||
assertThatException().isThrownBy(() -> echo.echo(new Exception()));
|
||||
assertThat(aspect.invocations).containsExactly("around - start", "before", "around - end", "after", "after throwing");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@SpringJUnitConfig(locations = "AopNamespaceHandlerAdviceOrderIntegrationTests-afterLast.xml")
|
||||
@DirtiesContext
|
||||
class AfterAdviceLastTests {
|
||||
|
||||
@Test
|
||||
void afterAdviceIsInvokedLast(@Autowired Echo echo, @Autowired InvocationTrackingAspect aspect) throws Exception {
|
||||
assertThat(aspect.invocations).isEmpty();
|
||||
assertThat(echo.echo(42)).isEqualTo(42);
|
||||
assertThat(aspect.invocations).containsExactly("around - start", "before", "around - end", "after returning", "after");
|
||||
|
||||
aspect.invocations.clear();
|
||||
assertThatException().isThrownBy(() -> echo.echo(new Exception()));
|
||||
assertThat(aspect.invocations).containsExactly("around - start", "before", "around - end", "after throwing", "after");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static class Echo {
|
||||
|
||||
Object echo(Object obj) throws Exception {
|
||||
if (obj instanceof Exception) {
|
||||
throw (Exception) obj;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
static class InvocationTrackingAspect {
|
||||
|
||||
List<String> invocations = new ArrayList<>();
|
||||
|
||||
Object around(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
invocations.add("around - start");
|
||||
try {
|
||||
return joinPoint.proceed();
|
||||
}
|
||||
finally {
|
||||
invocations.add("around - end");
|
||||
}
|
||||
}
|
||||
|
||||
void before() {
|
||||
invocations.add("before");
|
||||
}
|
||||
|
||||
void afterReturning() {
|
||||
invocations.add("after returning");
|
||||
}
|
||||
|
||||
void afterThrowing() {
|
||||
invocations.add("after throwing");
|
||||
}
|
||||
|
||||
void after() {
|
||||
invocations.add("after");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
-137
@@ -1,137 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.aop.config;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.core.testfixture.io.SerializationTestUtils;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.MockHttpSession;
|
||||
import org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Integration tests for scoped proxy use in conjunction with aop: namespace.
|
||||
* Deemed an integration test because .web mocks and application contexts are required.
|
||||
*
|
||||
* @author Rob Harrop
|
||||
* @author Juergen Hoeller
|
||||
* @author Chris Beams
|
||||
* @see org.springframework.aop.config.AopNamespaceHandlerTests
|
||||
*/
|
||||
@SpringJUnitWebConfig
|
||||
class AopNamespaceHandlerScopeIntegrationTests {
|
||||
|
||||
@Autowired
|
||||
ITestBean singletonScoped;
|
||||
|
||||
@Autowired
|
||||
ITestBean requestScoped;
|
||||
|
||||
@Autowired
|
||||
ITestBean sessionScoped;
|
||||
|
||||
@Autowired
|
||||
ITestBean sessionScopedAlias;
|
||||
|
||||
@Autowired
|
||||
ITestBean testBean;
|
||||
|
||||
|
||||
@Test
|
||||
void testSingletonScoping() throws Exception {
|
||||
assertThat(AopUtils.isAopProxy(singletonScoped)).as("Should be AOP proxy").isTrue();
|
||||
boolean condition = singletonScoped instanceof TestBean;
|
||||
assertThat(condition).as("Should be target class proxy").isTrue();
|
||||
String rob = "Rob Harrop";
|
||||
String bram = "Bram Smeets";
|
||||
assertThat(singletonScoped.getName()).isEqualTo(rob);
|
||||
singletonScoped.setName(bram);
|
||||
assertThat(singletonScoped.getName()).isEqualTo(bram);
|
||||
ITestBean deserialized = SerializationTestUtils.serializeAndDeserialize(singletonScoped);
|
||||
assertThat(deserialized.getName()).isEqualTo(bram);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testRequestScoping() throws Exception {
|
||||
MockHttpServletRequest oldRequest = new MockHttpServletRequest();
|
||||
MockHttpServletRequest newRequest = new MockHttpServletRequest();
|
||||
|
||||
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(oldRequest));
|
||||
|
||||
assertThat(AopUtils.isAopProxy(requestScoped)).as("Should be AOP proxy").isTrue();
|
||||
boolean condition = requestScoped instanceof TestBean;
|
||||
assertThat(condition).as("Should be target class proxy").isTrue();
|
||||
|
||||
assertThat(AopUtils.isAopProxy(testBean)).as("Should be AOP proxy").isTrue();
|
||||
boolean condition1 = testBean instanceof TestBean;
|
||||
assertThat(condition1).as("Regular bean should be JDK proxy").isFalse();
|
||||
|
||||
String rob = "Rob Harrop";
|
||||
String bram = "Bram Smeets";
|
||||
|
||||
assertThat(requestScoped.getName()).isEqualTo(rob);
|
||||
requestScoped.setName(bram);
|
||||
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(newRequest));
|
||||
assertThat(requestScoped.getName()).isEqualTo(rob);
|
||||
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(oldRequest));
|
||||
assertThat(requestScoped.getName()).isEqualTo(bram);
|
||||
|
||||
assertThat(((Advised) requestScoped).getAdvisors().length > 0).as("Should have advisors").isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSessionScoping() throws Exception {
|
||||
MockHttpSession oldSession = new MockHttpSession();
|
||||
MockHttpSession newSession = new MockHttpSession();
|
||||
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
request.setSession(oldSession);
|
||||
RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(request));
|
||||
|
||||
assertThat(AopUtils.isAopProxy(sessionScoped)).as("Should be AOP proxy").isTrue();
|
||||
boolean condition1 = sessionScoped instanceof TestBean;
|
||||
assertThat(condition1).as("Should not be target class proxy").isFalse();
|
||||
|
||||
assertThat(sessionScopedAlias).isSameAs(sessionScoped);
|
||||
|
||||
assertThat(AopUtils.isAopProxy(testBean)).as("Should be AOP proxy").isTrue();
|
||||
boolean condition = testBean instanceof TestBean;
|
||||
assertThat(condition).as("Regular bean should be JDK proxy").isFalse();
|
||||
|
||||
String rob = "Rob Harrop";
|
||||
String bram = "Bram Smeets";
|
||||
|
||||
assertThat(sessionScoped.getName()).isEqualTo(rob);
|
||||
sessionScoped.setName(bram);
|
||||
request.setSession(newSession);
|
||||
assertThat(sessionScoped.getName()).isEqualTo(rob);
|
||||
request.setSession(oldSession);
|
||||
assertThat(sessionScoped.getName()).isEqualTo(bram);
|
||||
|
||||
assertThat(((Advised) sessionScoped).getAdvisors().length > 0).as("Should have advisors").isTrue();
|
||||
}
|
||||
|
||||
}
|
||||
-318
@@ -1,318 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.aop.framework.autoproxy;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.aop.support.StaticMethodMatcherPointcutAdvisor;
|
||||
import org.springframework.aop.testfixture.advice.CountingBeforeAdvice;
|
||||
import org.springframework.aop.testfixture.advice.MethodCounter;
|
||||
import org.springframework.aop.testfixture.interceptor.NopInterceptor;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.transaction.NoTransactionException;
|
||||
import org.springframework.transaction.interceptor.TransactionInterceptor;
|
||||
import org.springframework.transaction.testfixture.CallCountingTransactionManager;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Integration tests for auto proxy creation by advisor recognition working in
|
||||
* conjunction with transaction management resources.
|
||||
*
|
||||
* @see org.springframework.aop.framework.autoproxy.AdvisorAutoProxyCreatorTests
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Chris Beams
|
||||
*/
|
||||
class AdvisorAutoProxyCreatorIntegrationTests {
|
||||
|
||||
private static final Class<?> CLASS = AdvisorAutoProxyCreatorIntegrationTests.class;
|
||||
private static final String CLASSNAME = CLASS.getSimpleName();
|
||||
|
||||
private static final String DEFAULT_CONTEXT = CLASSNAME + "-context.xml";
|
||||
|
||||
private static final String ADVISOR_APC_BEAN_NAME = "aapc";
|
||||
private static final String TXMANAGER_BEAN_NAME = "txManager";
|
||||
|
||||
/**
|
||||
* Return a bean factory with attributes and EnterpriseServices configured.
|
||||
*/
|
||||
protected BeanFactory getBeanFactory() throws IOException {
|
||||
return new ClassPathXmlApplicationContext(DEFAULT_CONTEXT, CLASS);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDefaultExclusionPrefix() throws Exception {
|
||||
DefaultAdvisorAutoProxyCreator aapc = (DefaultAdvisorAutoProxyCreator) getBeanFactory().getBean(ADVISOR_APC_BEAN_NAME);
|
||||
assertThat(aapc.getAdvisorBeanNamePrefix()).isEqualTo((ADVISOR_APC_BEAN_NAME + DefaultAdvisorAutoProxyCreator.SEPARATOR));
|
||||
assertThat(aapc.isUsePrefix()).isFalse();
|
||||
}
|
||||
|
||||
/**
|
||||
* If no pointcuts match (no attrs) there should be proxying.
|
||||
*/
|
||||
@Test
|
||||
void testNoProxy() throws Exception {
|
||||
BeanFactory bf = getBeanFactory();
|
||||
Object o = bf.getBean("noSetters");
|
||||
assertThat(AopUtils.isAopProxy(o)).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testTxIsProxied() throws Exception {
|
||||
BeanFactory bf = getBeanFactory();
|
||||
ITestBean test = (ITestBean) bf.getBean("test");
|
||||
assertThat(AopUtils.isAopProxy(test)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testRegexpApplied() throws Exception {
|
||||
BeanFactory bf = getBeanFactory();
|
||||
ITestBean test = (ITestBean) bf.getBean("test");
|
||||
MethodCounter counter = (MethodCounter) bf.getBean("countingAdvice");
|
||||
assertThat(counter.getCalls()).isEqualTo(0);
|
||||
test.getName();
|
||||
assertThat(counter.getCalls()).isEqualTo(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testTransactionAttributeOnMethod() throws Exception {
|
||||
BeanFactory bf = getBeanFactory();
|
||||
ITestBean test = (ITestBean) bf.getBean("test");
|
||||
|
||||
CallCountingTransactionManager txMan = (CallCountingTransactionManager) bf.getBean(TXMANAGER_BEAN_NAME);
|
||||
OrderedTxCheckAdvisor txc = (OrderedTxCheckAdvisor) bf.getBean("orderedBeforeTransaction");
|
||||
assertThat(txc.getCountingBeforeAdvice().getCalls()).isEqualTo(0);
|
||||
|
||||
assertThat(txMan.commits).isEqualTo(0);
|
||||
assertThat(test.getAge()).as("Initial value was correct").isEqualTo(4);
|
||||
int newAge = 5;
|
||||
test.setAge(newAge);
|
||||
assertThat(txc.getCountingBeforeAdvice().getCalls()).isEqualTo(1);
|
||||
|
||||
assertThat(test.getAge()).as("New value set correctly").isEqualTo(newAge);
|
||||
assertThat(txMan.commits).as("Transaction counts match").isEqualTo(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Should not roll back on servlet exception.
|
||||
*/
|
||||
@Test
|
||||
void testRollbackRulesOnMethodCauseRollback() throws Exception {
|
||||
BeanFactory bf = getBeanFactory();
|
||||
Rollback rb = (Rollback) bf.getBean("rollback");
|
||||
|
||||
CallCountingTransactionManager txMan = (CallCountingTransactionManager) bf.getBean(TXMANAGER_BEAN_NAME);
|
||||
OrderedTxCheckAdvisor txc = (OrderedTxCheckAdvisor) bf.getBean("orderedBeforeTransaction");
|
||||
assertThat(txc.getCountingBeforeAdvice().getCalls()).isEqualTo(0);
|
||||
|
||||
assertThat(txMan.commits).isEqualTo(0);
|
||||
rb.echoException(null);
|
||||
// Fires only on setters
|
||||
assertThat(txc.getCountingBeforeAdvice().getCalls()).isEqualTo(0);
|
||||
assertThat(txMan.commits).as("Transaction counts match").isEqualTo(1);
|
||||
|
||||
assertThat(txMan.rollbacks).isEqualTo(0);
|
||||
Exception ex = new Exception();
|
||||
try {
|
||||
rb.echoException(ex);
|
||||
}
|
||||
catch (Exception actual) {
|
||||
assertThat(actual).isEqualTo(ex);
|
||||
}
|
||||
assertThat(txMan.rollbacks).as("Transaction counts match").isEqualTo(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testRollbackRulesOnMethodPreventRollback() throws Exception {
|
||||
BeanFactory bf = getBeanFactory();
|
||||
Rollback rb = (Rollback) bf.getBean("rollback");
|
||||
|
||||
CallCountingTransactionManager txMan = (CallCountingTransactionManager) bf.getBean(TXMANAGER_BEAN_NAME);
|
||||
|
||||
assertThat(txMan.commits).isEqualTo(0);
|
||||
// Should NOT roll back on ServletException
|
||||
try {
|
||||
rb.echoException(new ServletException());
|
||||
}
|
||||
catch (ServletException ex) {
|
||||
|
||||
}
|
||||
assertThat(txMan.commits).as("Transaction counts match").isEqualTo(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testProgrammaticRollback() throws Exception {
|
||||
BeanFactory bf = getBeanFactory();
|
||||
|
||||
Object bean = bf.getBean(TXMANAGER_BEAN_NAME);
|
||||
boolean condition = bean instanceof CallCountingTransactionManager;
|
||||
assertThat(condition).isTrue();
|
||||
CallCountingTransactionManager txMan = (CallCountingTransactionManager) bf.getBean(TXMANAGER_BEAN_NAME);
|
||||
|
||||
Rollback rb = (Rollback) bf.getBean("rollback");
|
||||
assertThat(txMan.commits).isEqualTo(0);
|
||||
rb.rollbackOnly(false);
|
||||
assertThat(txMan.commits).as("Transaction counts match").isEqualTo(1);
|
||||
assertThat(txMan.rollbacks).isEqualTo(0);
|
||||
// Will cause rollback only
|
||||
rb.rollbackOnly(true);
|
||||
assertThat(txMan.rollbacks).isEqualTo(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
class NeverMatchAdvisor extends StaticMethodMatcherPointcutAdvisor {
|
||||
|
||||
public NeverMatchAdvisor() {
|
||||
super(new NopInterceptor());
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is solely to allow us to create a mixture of dependencies in
|
||||
* the bean definitions. The dependencies don't have any meaning, and don't
|
||||
* <b>do</b> anything.
|
||||
*/
|
||||
public void setDependencies(List<?> l) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.springframework.aop.MethodMatcher#matches(java.lang.reflect.Method, java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public boolean matches(Method m, @Nullable Class<?> targetClass) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class NoSetters {
|
||||
|
||||
public void A() {
|
||||
|
||||
}
|
||||
|
||||
public int getB() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
class OrderedTxCheckAdvisor extends StaticMethodMatcherPointcutAdvisor implements InitializingBean {
|
||||
|
||||
/**
|
||||
* Should we insist on the presence of a transaction attribute or refuse to accept one?
|
||||
*/
|
||||
private boolean requireTransactionContext = false;
|
||||
|
||||
|
||||
public void setRequireTransactionContext(boolean requireTransactionContext) {
|
||||
this.requireTransactionContext = requireTransactionContext;
|
||||
}
|
||||
|
||||
public boolean isRequireTransactionContext() {
|
||||
return requireTransactionContext;
|
||||
}
|
||||
|
||||
|
||||
public CountingBeforeAdvice getCountingBeforeAdvice() {
|
||||
return (CountingBeforeAdvice) getAdvice();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
setAdvice(new TxCountingBeforeAdvice());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, @Nullable Class<?> targetClass) {
|
||||
return method.getName().startsWith("setAge");
|
||||
}
|
||||
|
||||
|
||||
private class TxCountingBeforeAdvice extends CountingBeforeAdvice {
|
||||
|
||||
@Override
|
||||
public void before(Method method, Object[] args, Object target) throws Throwable {
|
||||
// do transaction checks
|
||||
if (requireTransactionContext) {
|
||||
TransactionInterceptor.currentTransactionStatus();
|
||||
}
|
||||
else {
|
||||
try {
|
||||
TransactionInterceptor.currentTransactionStatus();
|
||||
throw new RuntimeException("Shouldn't have a transaction");
|
||||
}
|
||||
catch (NoTransactionException ex) {
|
||||
// this is Ok
|
||||
}
|
||||
}
|
||||
super.before(method, args, target);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class Rollback {
|
||||
|
||||
/**
|
||||
* Inherits transaction attribute.
|
||||
* Illustrates programmatic rollback.
|
||||
*/
|
||||
public void rollbackOnly(boolean rollbackOnly) {
|
||||
if (rollbackOnly) {
|
||||
setRollbackOnly();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracted in a protected method to facilitate testing
|
||||
*/
|
||||
protected void setRollbackOnly() {
|
||||
TransactionInterceptor.currentTransactionStatus().setRollbackOnly();
|
||||
}
|
||||
|
||||
/**
|
||||
* @org.springframework.transaction.interceptor.RuleBasedTransaction ( timeout=-1 )
|
||||
* @org.springframework.transaction.interceptor.RollbackRule ( "java.lang.Exception" )
|
||||
* @org.springframework.transaction.interceptor.NoRollbackRule ( "ServletException" )
|
||||
*/
|
||||
public void echoException(Exception ex) throws Exception {
|
||||
if (ex != null) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
-231
@@ -1,231 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.aop.framework.autoproxy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.After;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.AfterThrowing;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Before;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatException;
|
||||
|
||||
/**
|
||||
* Integration tests for advice invocation order for advice configured via
|
||||
* AspectJ auto-proxy support.
|
||||
*
|
||||
* @author Sam Brannen
|
||||
* @since 5.2.7
|
||||
* @see org.springframework.aop.config.AopNamespaceHandlerAdviceOrderIntegrationTests
|
||||
*/
|
||||
class AspectJAutoProxyAdviceOrderIntegrationTests {
|
||||
|
||||
/**
|
||||
* {@link After @After} advice declared as first <em>after</em> method in source code.
|
||||
*/
|
||||
@Nested
|
||||
@SpringJUnitConfig(AfterAdviceFirstConfig.class)
|
||||
@DirtiesContext
|
||||
class AfterAdviceFirstTests {
|
||||
|
||||
@Test
|
||||
void afterAdviceIsInvokedLast(@Autowired Echo echo, @Autowired AfterAdviceFirstAspect aspect) throws Exception {
|
||||
assertThat(aspect.invocations).isEmpty();
|
||||
assertThat(echo.echo(42)).isEqualTo(42);
|
||||
assertThat(aspect.invocations).containsExactly("around - start", "before", "after returning", "after", "around - end");
|
||||
|
||||
aspect.invocations.clear();
|
||||
assertThatException().isThrownBy(() -> echo.echo(new Exception()));
|
||||
assertThat(aspect.invocations).containsExactly("around - start", "before", "after throwing", "after", "around - end");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This test class uses {@link AfterAdviceLastAspect} which declares its
|
||||
* {@link After @After} advice as the last <em>after advice type</em> method
|
||||
* in its source code.
|
||||
*
|
||||
* <p>On Java versions prior to JDK 7, we would have expected the {@code @After}
|
||||
* advice method to be invoked before {@code @AfterThrowing} and
|
||||
* {@code @AfterReturning} advice methods due to the AspectJ precedence
|
||||
* rules implemented in
|
||||
* {@link org.springframework.aop.aspectj.autoproxy.AspectJPrecedenceComparator}.
|
||||
*/
|
||||
@Nested
|
||||
@SpringJUnitConfig(AfterAdviceLastConfig.class)
|
||||
@DirtiesContext
|
||||
class AfterAdviceLastTests {
|
||||
|
||||
@Test
|
||||
void afterAdviceIsInvokedLast(@Autowired Echo echo, @Autowired AfterAdviceLastAspect aspect) throws Exception {
|
||||
assertThat(aspect.invocations).isEmpty();
|
||||
assertThat(echo.echo(42)).isEqualTo(42);
|
||||
assertThat(aspect.invocations).containsExactly("around - start", "before", "after returning", "after", "around - end");
|
||||
|
||||
aspect.invocations.clear();
|
||||
assertThatException().isThrownBy(() -> echo.echo(new Exception()));
|
||||
assertThat(aspect.invocations).containsExactly("around - start", "before", "after throwing", "after", "around - end");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableAspectJAutoProxy(proxyTargetClass = true)
|
||||
static class AfterAdviceFirstConfig {
|
||||
|
||||
@Bean
|
||||
AfterAdviceFirstAspect echoAspect() {
|
||||
return new AfterAdviceFirstAspect();
|
||||
}
|
||||
|
||||
@Bean
|
||||
Echo echo() {
|
||||
return new Echo();
|
||||
}
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableAspectJAutoProxy(proxyTargetClass = true)
|
||||
static class AfterAdviceLastConfig {
|
||||
|
||||
@Bean
|
||||
AfterAdviceLastAspect echoAspect() {
|
||||
return new AfterAdviceLastAspect();
|
||||
}
|
||||
|
||||
@Bean
|
||||
Echo echo() {
|
||||
return new Echo();
|
||||
}
|
||||
}
|
||||
|
||||
static class Echo {
|
||||
|
||||
Object echo(Object obj) throws Exception {
|
||||
if (obj instanceof Exception) {
|
||||
throw (Exception) obj;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link After @After} advice declared as first <em>after</em> method in source code.
|
||||
*/
|
||||
@Aspect
|
||||
static class AfterAdviceFirstAspect {
|
||||
|
||||
List<String> invocations = new ArrayList<>();
|
||||
|
||||
@Pointcut("execution(* echo(*))")
|
||||
void echo() {
|
||||
}
|
||||
|
||||
@After("echo()")
|
||||
void after() {
|
||||
invocations.add("after");
|
||||
}
|
||||
|
||||
@AfterReturning("echo()")
|
||||
void afterReturning() {
|
||||
invocations.add("after returning");
|
||||
}
|
||||
|
||||
@AfterThrowing("echo()")
|
||||
void afterThrowing() {
|
||||
invocations.add("after throwing");
|
||||
}
|
||||
|
||||
@Before("echo()")
|
||||
void before() {
|
||||
invocations.add("before");
|
||||
}
|
||||
|
||||
@Around("echo()")
|
||||
Object around(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
invocations.add("around - start");
|
||||
try {
|
||||
return joinPoint.proceed();
|
||||
}
|
||||
finally {
|
||||
invocations.add("around - end");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link After @After} advice declared as last <em>after</em> method in source code.
|
||||
*/
|
||||
@Aspect
|
||||
static class AfterAdviceLastAspect {
|
||||
|
||||
List<String> invocations = new ArrayList<>();
|
||||
|
||||
@Pointcut("execution(* echo(*))")
|
||||
void echo() {
|
||||
}
|
||||
|
||||
@Around("echo()")
|
||||
Object around(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
invocations.add("around - start");
|
||||
try {
|
||||
return joinPoint.proceed();
|
||||
}
|
||||
finally {
|
||||
invocations.add("around - end");
|
||||
}
|
||||
}
|
||||
|
||||
@Before("echo()")
|
||||
void before() {
|
||||
invocations.add("before");
|
||||
}
|
||||
|
||||
@AfterReturning("echo()")
|
||||
void afterReturning() {
|
||||
invocations.add("after returning");
|
||||
}
|
||||
|
||||
@AfterThrowing("echo()")
|
||||
void afterThrowing() {
|
||||
invocations.add("after throwing");
|
||||
}
|
||||
|
||||
@After("echo()")
|
||||
void after() {
|
||||
invocations.add("after");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.beans.factory.xml;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Component {
|
||||
|
||||
private String name;
|
||||
private List<Component> components = new ArrayList<>();
|
||||
|
||||
// mmm, there is no setter method for the 'components'
|
||||
public void addComponent(Component component) {
|
||||
this.components.add(component);
|
||||
}
|
||||
|
||||
public List<Component> getComponents() {
|
||||
return components;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
||||
-63
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.beans.factory.xml;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.support.AbstractBeanDefinition;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.support.ManagedList;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.xml.DomUtils;
|
||||
|
||||
public class ComponentBeanDefinitionParser extends AbstractBeanDefinitionParser {
|
||||
|
||||
@Override
|
||||
protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
|
||||
return parseComponentElement(element);
|
||||
}
|
||||
|
||||
private static AbstractBeanDefinition parseComponentElement(Element element) {
|
||||
BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(ComponentFactoryBean.class);
|
||||
factory.addPropertyValue("parent", parseComponent(element));
|
||||
|
||||
List<Element> childElements = DomUtils.getChildElementsByTagName(element, "component");
|
||||
if (!CollectionUtils.isEmpty(childElements)) {
|
||||
parseChildComponents(childElements, factory);
|
||||
}
|
||||
|
||||
return factory.getBeanDefinition();
|
||||
}
|
||||
|
||||
private static BeanDefinition parseComponent(Element element) {
|
||||
BeanDefinitionBuilder component = BeanDefinitionBuilder.rootBeanDefinition(Component.class);
|
||||
component.addPropertyValue("name", element.getAttribute("name"));
|
||||
return component.getBeanDefinition();
|
||||
}
|
||||
|
||||
private static void parseChildComponents(List<Element> childElements, BeanDefinitionBuilder factory) {
|
||||
ManagedList<BeanDefinition> children = new ManagedList<>(childElements.size());
|
||||
for (Element element : childElements) {
|
||||
children.add(parseComponentElement(element));
|
||||
}
|
||||
factory.addPropertyValue("children", children);
|
||||
}
|
||||
|
||||
}
|
||||
-81
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.beans.factory.xml;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
import org.junit.jupiter.api.TestInstance.Lifecycle;
|
||||
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* @author Costin Leau
|
||||
*/
|
||||
@TestInstance(Lifecycle.PER_CLASS)
|
||||
class ComponentBeanDefinitionParserTests {
|
||||
|
||||
private final DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
|
||||
|
||||
|
||||
@BeforeAll
|
||||
void setUp() throws Exception {
|
||||
new XmlBeanDefinitionReader(bf).loadBeanDefinitions(
|
||||
new ClassPathResource("component-config.xml", ComponentBeanDefinitionParserTests.class));
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
void tearDown() {
|
||||
bf.destroySingletons();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBionicBasic() {
|
||||
Component cp = getBionicFamily();
|
||||
assertThat("Bionic-1").isEqualTo(cp.getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBionicFirstLevelChildren() {
|
||||
Component cp = getBionicFamily();
|
||||
List<Component> components = cp.getComponents();
|
||||
assertThat(2).isEqualTo(components.size());
|
||||
assertThat("Mother-1").isEqualTo(components.get(0).getName());
|
||||
assertThat("Rock-1").isEqualTo(components.get(1).getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBionicSecondLevelChildren() {
|
||||
Component cp = getBionicFamily();
|
||||
List<Component> components = cp.getComponents().get(0).getComponents();
|
||||
assertThat(2).isEqualTo(components.size());
|
||||
assertThat("Karate-1").isEqualTo(components.get(0).getName());
|
||||
assertThat("Sport-1").isEqualTo(components.get(1).getName());
|
||||
}
|
||||
|
||||
private Component getBionicFamily() {
|
||||
return bf.getBean("bionic-family", Component.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-56
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.beans.factory.xml;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
|
||||
public class ComponentFactoryBean implements FactoryBean<Component> {
|
||||
|
||||
private Component parent;
|
||||
private List<Component> children;
|
||||
|
||||
public void setParent(Component parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public void setChildren(List<Component> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Component getObject() throws Exception {
|
||||
if (this.children != null && this.children.size() > 0) {
|
||||
for (Component child : children) {
|
||||
this.parent.addComponent(child);
|
||||
}
|
||||
}
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<Component> getObjectType() {
|
||||
return Component.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSingleton() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.beans.factory.xml;
|
||||
|
||||
public class ComponentNamespaceHandler extends NamespaceHandlerSupport {
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
registerBeanDefinitionParser("component", new ComponentBeanDefinitionParser());
|
||||
}
|
||||
}
|
||||
-135
@@ -1,135 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cache.annotation;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.Advisor;
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.interceptor.BeanFactoryCacheOperationSourceAdvisor;
|
||||
import org.springframework.cache.support.NoOpCacheManager;
|
||||
import org.springframework.context.annotation.AdviceMode;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatException;
|
||||
|
||||
/**
|
||||
* Integration tests for the @EnableCaching annotation.
|
||||
*
|
||||
* @author Chris Beams
|
||||
* @since 3.1
|
||||
*/
|
||||
@SuppressWarnings("resource")
|
||||
class EnableCachingIntegrationTests {
|
||||
|
||||
@Test
|
||||
void repositoryIsClassBasedCacheProxy() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(Config.class, ProxyTargetClassCachingConfig.class);
|
||||
ctx.refresh();
|
||||
|
||||
assertCacheProxying(ctx);
|
||||
assertThat(AopUtils.isCglibProxy(ctx.getBean(FooRepository.class))).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void repositoryUsesAspectJAdviceMode() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(Config.class, AspectJCacheConfig.class);
|
||||
// this test is a bit fragile, but gets the job done, proving that an
|
||||
// attempt was made to look up the AJ aspect. It's due to classpath issues
|
||||
// in .integration-tests that it's not found.
|
||||
assertThatException().isThrownBy(ctx::refresh)
|
||||
.withMessageContaining("AspectJCachingConfiguration");
|
||||
}
|
||||
|
||||
|
||||
private void assertCacheProxying(AnnotationConfigApplicationContext ctx) {
|
||||
FooRepository repo = ctx.getBean(FooRepository.class);
|
||||
assertThat(isCacheProxy(repo)).isTrue();
|
||||
}
|
||||
|
||||
private boolean isCacheProxy(FooRepository repo) {
|
||||
if (AopUtils.isAopProxy(repo)) {
|
||||
for (Advisor advisor : ((Advised)repo).getAdvisors()) {
|
||||
if (advisor instanceof BeanFactoryCacheOperationSourceAdvisor) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableCaching(proxyTargetClass=true)
|
||||
static class ProxyTargetClassCachingConfig {
|
||||
|
||||
@Bean
|
||||
CacheManager mgr() {
|
||||
return new NoOpCacheManager();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
FooRepository fooRepository() {
|
||||
return new DummyFooRepository();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableCaching(mode=AdviceMode.ASPECTJ)
|
||||
static class AspectJCacheConfig {
|
||||
|
||||
@Bean
|
||||
CacheManager cacheManager() {
|
||||
return new NoOpCacheManager();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface FooRepository {
|
||||
|
||||
List<Object> findAll();
|
||||
}
|
||||
|
||||
|
||||
@Repository
|
||||
static class DummyFooRepository implements FooRepository {
|
||||
|
||||
@Override
|
||||
@Cacheable("primary")
|
||||
public List<Object> findAll() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
-401
@@ -1,401 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.context.annotation.jsr330;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;
|
||||
import org.springframework.context.annotation.ScopeMetadata;
|
||||
import org.springframework.context.annotation.ScopedProxyMode;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.MockHttpSession;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import org.springframework.web.context.support.GenericWebApplicationContext;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
* @author Juergen Hoeller
|
||||
* @author Chris Beams
|
||||
*/
|
||||
class ClassPathBeanDefinitionScannerJsr330ScopeIntegrationTests {
|
||||
|
||||
private static final String DEFAULT_NAME = "default";
|
||||
|
||||
private static final String MODIFIED_NAME = "modified";
|
||||
|
||||
private ServletRequestAttributes oldRequestAttributes;
|
||||
|
||||
private ServletRequestAttributes newRequestAttributes;
|
||||
|
||||
private ServletRequestAttributes oldRequestAttributesWithSession;
|
||||
|
||||
private ServletRequestAttributes newRequestAttributesWithSession;
|
||||
|
||||
|
||||
@BeforeEach
|
||||
void setup() {
|
||||
this.oldRequestAttributes = new ServletRequestAttributes(new MockHttpServletRequest());
|
||||
this.newRequestAttributes = new ServletRequestAttributes(new MockHttpServletRequest());
|
||||
|
||||
MockHttpServletRequest oldRequestWithSession = new MockHttpServletRequest();
|
||||
oldRequestWithSession.setSession(new MockHttpSession());
|
||||
this.oldRequestAttributesWithSession = new ServletRequestAttributes(oldRequestWithSession);
|
||||
|
||||
MockHttpServletRequest newRequestWithSession = new MockHttpServletRequest();
|
||||
newRequestWithSession.setSession(new MockHttpSession());
|
||||
this.newRequestAttributesWithSession = new ServletRequestAttributes(newRequestWithSession);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void reset() {
|
||||
RequestContextHolder.setRequestAttributes(null);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void testPrototype() {
|
||||
ApplicationContext context = createContext(ScopedProxyMode.NO);
|
||||
ScopedTestBean bean = (ScopedTestBean) context.getBean("prototype");
|
||||
assertThat(bean).isNotNull();
|
||||
assertThat(context.isPrototype("prototype")).isTrue();
|
||||
assertThat(context.isSingleton("prototype")).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSingletonScopeWithNoProxy() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
ApplicationContext context = createContext(ScopedProxyMode.NO);
|
||||
ScopedTestBean bean = (ScopedTestBean) context.getBean("singleton");
|
||||
assertThat(context.isSingleton("singleton")).isTrue();
|
||||
assertThat(context.isPrototype("singleton")).isFalse();
|
||||
|
||||
// should not be a proxy
|
||||
assertThat(AopUtils.isAopProxy(bean)).isFalse();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributes);
|
||||
// not a proxy so this should not have changed
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
|
||||
// singleton bean, so name should be modified even after lookup
|
||||
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("singleton");
|
||||
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSingletonScopeIgnoresProxyInterfaces() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
ApplicationContext context = createContext(ScopedProxyMode.INTERFACES);
|
||||
ScopedTestBean bean = (ScopedTestBean) context.getBean("singleton");
|
||||
|
||||
// should not be a proxy
|
||||
assertThat(AopUtils.isAopProxy(bean)).isFalse();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributes);
|
||||
// not a proxy so this should not have changed
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
|
||||
// singleton bean, so name should be modified even after lookup
|
||||
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("singleton");
|
||||
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSingletonScopeIgnoresProxyTargetClass() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
ApplicationContext context = createContext(ScopedProxyMode.TARGET_CLASS);
|
||||
ScopedTestBean bean = (ScopedTestBean) context.getBean("singleton");
|
||||
|
||||
// should not be a proxy
|
||||
assertThat(AopUtils.isAopProxy(bean)).isFalse();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributes);
|
||||
// not a proxy so this should not have changed
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
|
||||
// singleton bean, so name should be modified even after lookup
|
||||
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("singleton");
|
||||
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testRequestScopeWithNoProxy() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
ApplicationContext context = createContext(ScopedProxyMode.NO);
|
||||
ScopedTestBean bean = (ScopedTestBean) context.getBean("request");
|
||||
|
||||
// should not be a proxy
|
||||
assertThat(AopUtils.isAopProxy(bean)).isFalse();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributes);
|
||||
// not a proxy so this should not have changed
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
|
||||
// but a newly retrieved bean should have the default name
|
||||
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("request");
|
||||
assertThat(bean2.getName()).isEqualTo(DEFAULT_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testRequestScopeWithProxiedInterfaces() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
ApplicationContext context = createContext(ScopedProxyMode.INTERFACES);
|
||||
IScopedTestBean bean = (IScopedTestBean) context.getBean("request");
|
||||
|
||||
// should be dynamic proxy, implementing both interfaces
|
||||
assertThat(AopUtils.isJdkDynamicProxy(bean)).isTrue();
|
||||
boolean condition = bean instanceof AnotherScopeTestInterface;
|
||||
assertThat(condition).isTrue();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributes);
|
||||
// this is a proxy so it should be reset to default
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testRequestScopeWithProxiedTargetClass() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
ApplicationContext context = createContext(ScopedProxyMode.TARGET_CLASS);
|
||||
IScopedTestBean bean = (IScopedTestBean) context.getBean("request");
|
||||
|
||||
// should be a class-based proxy
|
||||
assertThat(AopUtils.isCglibProxy(bean)).isTrue();
|
||||
boolean condition = bean instanceof RequestScopedTestBean;
|
||||
assertThat(condition).isTrue();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributes);
|
||||
// this is a proxy so it should be reset to default
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSessionScopeWithNoProxy() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
|
||||
ApplicationContext context = createContext(ScopedProxyMode.NO);
|
||||
ScopedTestBean bean = (ScopedTestBean) context.getBean("session");
|
||||
|
||||
// should not be a proxy
|
||||
assertThat(AopUtils.isAopProxy(bean)).isFalse();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributesWithSession);
|
||||
// not a proxy so this should not have changed
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
|
||||
// but a newly retrieved bean should have the default name
|
||||
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("session");
|
||||
assertThat(bean2.getName()).isEqualTo(DEFAULT_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSessionScopeWithProxiedInterfaces() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
|
||||
ApplicationContext context = createContext(ScopedProxyMode.INTERFACES);
|
||||
IScopedTestBean bean = (IScopedTestBean) context.getBean("session");
|
||||
|
||||
// should be dynamic proxy, implementing both interfaces
|
||||
assertThat(AopUtils.isJdkDynamicProxy(bean)).isTrue();
|
||||
boolean condition = bean instanceof AnotherScopeTestInterface;
|
||||
assertThat(condition).isTrue();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributesWithSession);
|
||||
// this is a proxy so it should be reset to default
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
IScopedTestBean bean2 = (IScopedTestBean) context.getBean("session");
|
||||
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
|
||||
bean2.setName(DEFAULT_NAME);
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSessionScopeWithProxiedTargetClass() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
|
||||
ApplicationContext context = createContext(ScopedProxyMode.TARGET_CLASS);
|
||||
IScopedTestBean bean = (IScopedTestBean) context.getBean("session");
|
||||
|
||||
// should be a class-based proxy
|
||||
assertThat(AopUtils.isCglibProxy(bean)).isTrue();
|
||||
boolean condition1 = bean instanceof ScopedTestBean;
|
||||
assertThat(condition1).isTrue();
|
||||
boolean condition = bean instanceof SessionScopedTestBean;
|
||||
assertThat(condition).isTrue();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributesWithSession);
|
||||
// this is a proxy so it should be reset to default
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
IScopedTestBean bean2 = (IScopedTestBean) context.getBean("session");
|
||||
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
|
||||
bean2.setName(DEFAULT_NAME);
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
}
|
||||
|
||||
|
||||
private ApplicationContext createContext(final ScopedProxyMode scopedProxyMode) {
|
||||
GenericWebApplicationContext context = new GenericWebApplicationContext();
|
||||
ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context);
|
||||
scanner.setIncludeAnnotationConfig(false);
|
||||
scanner.setScopeMetadataResolver(definition -> {
|
||||
ScopeMetadata metadata = new ScopeMetadata();
|
||||
if (definition instanceof AnnotatedBeanDefinition) {
|
||||
AnnotatedBeanDefinition annDef = (AnnotatedBeanDefinition) definition;
|
||||
for (String type : annDef.getMetadata().getAnnotationTypes()) {
|
||||
if (type.equals(javax.inject.Singleton.class.getName())) {
|
||||
metadata.setScopeName(BeanDefinition.SCOPE_SINGLETON);
|
||||
break;
|
||||
}
|
||||
else if (annDef.getMetadata().getMetaAnnotationTypes(type).contains(javax.inject.Scope.class.getName())) {
|
||||
metadata.setScopeName(type.substring(type.length() - 13, type.length() - 6).toLowerCase());
|
||||
metadata.setScopedProxyMode(scopedProxyMode);
|
||||
break;
|
||||
}
|
||||
else if (type.startsWith("javax.inject")) {
|
||||
metadata.setScopeName(BeanDefinition.SCOPE_PROTOTYPE);
|
||||
}
|
||||
}
|
||||
}
|
||||
return metadata;
|
||||
});
|
||||
|
||||
// Scan twice in order to find errors in the bean definition compatibility check.
|
||||
scanner.scan(getClass().getPackage().getName());
|
||||
scanner.scan(getClass().getPackage().getName());
|
||||
|
||||
context.registerAlias("classPathBeanDefinitionScannerJsr330ScopeIntegrationTests.SessionScopedTestBean", "session");
|
||||
context.refresh();
|
||||
return context;
|
||||
}
|
||||
|
||||
|
||||
public interface IScopedTestBean {
|
||||
|
||||
String getName();
|
||||
|
||||
void setName(String name);
|
||||
}
|
||||
|
||||
|
||||
public static abstract class ScopedTestBean implements IScopedTestBean {
|
||||
|
||||
private String name = DEFAULT_NAME;
|
||||
|
||||
@Override
|
||||
public String getName() { return this.name; }
|
||||
|
||||
@Override
|
||||
public void setName(String name) { this.name = name; }
|
||||
}
|
||||
|
||||
|
||||
@Named("prototype")
|
||||
public static class PrototypeScopedTestBean extends ScopedTestBean {
|
||||
}
|
||||
|
||||
|
||||
@Named("singleton")
|
||||
@Singleton
|
||||
public static class SingletonScopedTestBean extends ScopedTestBean {
|
||||
}
|
||||
|
||||
|
||||
public interface AnotherScopeTestInterface {
|
||||
}
|
||||
|
||||
|
||||
@Named("request")
|
||||
@RequestScoped
|
||||
public static class RequestScopedTestBean extends ScopedTestBean implements AnotherScopeTestInterface {
|
||||
}
|
||||
|
||||
|
||||
@Named
|
||||
@SessionScoped
|
||||
public static class SessionScopedTestBean extends ScopedTestBean implements AnotherScopeTestInterface {
|
||||
}
|
||||
|
||||
|
||||
@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@javax.inject.Scope
|
||||
public @interface RequestScoped {
|
||||
}
|
||||
|
||||
|
||||
@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@javax.inject.Scope
|
||||
public @interface SessionScoped {
|
||||
}
|
||||
|
||||
}
|
||||
-341
@@ -1,341 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.context.annotation.scope;
|
||||
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;
|
||||
import org.springframework.context.annotation.ScopedProxyMode;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.MockHttpSession;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.annotation.RequestScope;
|
||||
import org.springframework.web.context.annotation.SessionScope;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import org.springframework.web.context.support.GenericWebApplicationContext;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.context.annotation.ScopedProxyMode.DEFAULT;
|
||||
import static org.springframework.context.annotation.ScopedProxyMode.INTERFACES;
|
||||
import static org.springframework.context.annotation.ScopedProxyMode.NO;
|
||||
import static org.springframework.context.annotation.ScopedProxyMode.TARGET_CLASS;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
* @author Juergen Hoeller
|
||||
* @author Chris Beams
|
||||
* @author Sam Brannen
|
||||
*/
|
||||
class ClassPathBeanDefinitionScannerScopeIntegrationTests {
|
||||
|
||||
private static final String DEFAULT_NAME = "default";
|
||||
private static final String MODIFIED_NAME = "modified";
|
||||
|
||||
private ServletRequestAttributes oldRequestAttributes = new ServletRequestAttributes(new MockHttpServletRequest());
|
||||
private ServletRequestAttributes newRequestAttributes = new ServletRequestAttributes(new MockHttpServletRequest());
|
||||
|
||||
private ServletRequestAttributes oldRequestAttributesWithSession;
|
||||
private ServletRequestAttributes newRequestAttributesWithSession;
|
||||
|
||||
|
||||
@BeforeEach
|
||||
void setup() {
|
||||
MockHttpServletRequest oldRequestWithSession = new MockHttpServletRequest();
|
||||
oldRequestWithSession.setSession(new MockHttpSession());
|
||||
this.oldRequestAttributesWithSession = new ServletRequestAttributes(oldRequestWithSession);
|
||||
|
||||
MockHttpServletRequest newRequestWithSession = new MockHttpServletRequest();
|
||||
newRequestWithSession.setSession(new MockHttpSession());
|
||||
this.newRequestAttributesWithSession = new ServletRequestAttributes(newRequestWithSession);
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
void reset() {
|
||||
RequestContextHolder.resetRequestAttributes();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void singletonScopeWithNoProxy() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
ApplicationContext context = createContext(NO);
|
||||
ScopedTestBean bean = (ScopedTestBean) context.getBean("singleton");
|
||||
|
||||
// should not be a proxy
|
||||
assertThat(AopUtils.isAopProxy(bean)).isFalse();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributes);
|
||||
// not a proxy so this should not have changed
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
|
||||
// singleton bean, so name should be modified even after lookup
|
||||
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("singleton");
|
||||
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void singletonScopeIgnoresProxyInterfaces() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
ApplicationContext context = createContext(INTERFACES);
|
||||
ScopedTestBean bean = (ScopedTestBean) context.getBean("singleton");
|
||||
|
||||
// should not be a proxy
|
||||
assertThat(AopUtils.isAopProxy(bean)).isFalse();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributes);
|
||||
// not a proxy so this should not have changed
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
|
||||
// singleton bean, so name should be modified even after lookup
|
||||
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("singleton");
|
||||
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void singletonScopeIgnoresProxyTargetClass() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
ApplicationContext context = createContext(TARGET_CLASS);
|
||||
ScopedTestBean bean = (ScopedTestBean) context.getBean("singleton");
|
||||
|
||||
// should not be a proxy
|
||||
assertThat(AopUtils.isAopProxy(bean)).isFalse();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributes);
|
||||
// not a proxy so this should not have changed
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
|
||||
// singleton bean, so name should be modified even after lookup
|
||||
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("singleton");
|
||||
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void requestScopeWithNoProxy() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
ApplicationContext context = createContext(NO);
|
||||
ScopedTestBean bean = (ScopedTestBean) context.getBean("request");
|
||||
|
||||
// should not be a proxy
|
||||
assertThat(AopUtils.isAopProxy(bean)).isFalse();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributes);
|
||||
// not a proxy so this should not have changed
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
|
||||
// but a newly retrieved bean should have the default name
|
||||
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("request");
|
||||
assertThat(bean2.getName()).isEqualTo(DEFAULT_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void requestScopeWithProxiedInterfaces() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
ApplicationContext context = createContext(INTERFACES);
|
||||
IScopedTestBean bean = (IScopedTestBean) context.getBean("request");
|
||||
|
||||
// should be dynamic proxy, implementing both interfaces
|
||||
assertThat(AopUtils.isJdkDynamicProxy(bean)).isTrue();
|
||||
boolean condition = bean instanceof AnotherScopeTestInterface;
|
||||
assertThat(condition).isTrue();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributes);
|
||||
// this is a proxy so it should be reset to default
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void requestScopeWithProxiedTargetClass() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
ApplicationContext context = createContext(TARGET_CLASS);
|
||||
IScopedTestBean bean = (IScopedTestBean) context.getBean("request");
|
||||
|
||||
// should be a class-based proxy
|
||||
assertThat(AopUtils.isCglibProxy(bean)).isTrue();
|
||||
boolean condition = bean instanceof RequestScopedTestBean;
|
||||
assertThat(condition).isTrue();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributes);
|
||||
// this is a proxy so it should be reset to default
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributes);
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void sessionScopeWithNoProxy() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
|
||||
ApplicationContext context = createContext(NO);
|
||||
ScopedTestBean bean = (ScopedTestBean) context.getBean("session");
|
||||
|
||||
// should not be a proxy
|
||||
assertThat(AopUtils.isAopProxy(bean)).isFalse();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributesWithSession);
|
||||
// not a proxy so this should not have changed
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
|
||||
// but a newly retrieved bean should have the default name
|
||||
ScopedTestBean bean2 = (ScopedTestBean) context.getBean("session");
|
||||
assertThat(bean2.getName()).isEqualTo(DEFAULT_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void sessionScopeWithProxiedInterfaces() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
|
||||
ApplicationContext context = createContext(INTERFACES);
|
||||
IScopedTestBean bean = (IScopedTestBean) context.getBean("session");
|
||||
|
||||
// should be dynamic proxy, implementing both interfaces
|
||||
assertThat(AopUtils.isJdkDynamicProxy(bean)).isTrue();
|
||||
boolean condition = bean instanceof AnotherScopeTestInterface;
|
||||
assertThat(condition).isTrue();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributesWithSession);
|
||||
// this is a proxy so it should be reset to default
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
IScopedTestBean bean2 = (IScopedTestBean) context.getBean("session");
|
||||
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
|
||||
bean2.setName(DEFAULT_NAME);
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void sessionScopeWithProxiedTargetClass() {
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
|
||||
ApplicationContext context = createContext(TARGET_CLASS);
|
||||
IScopedTestBean bean = (IScopedTestBean) context.getBean("session");
|
||||
|
||||
// should be a class-based proxy
|
||||
assertThat(AopUtils.isCglibProxy(bean)).isTrue();
|
||||
boolean condition1 = bean instanceof ScopedTestBean;
|
||||
assertThat(condition1).isTrue();
|
||||
boolean condition = bean instanceof SessionScopedTestBean;
|
||||
assertThat(condition).isTrue();
|
||||
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(newRequestAttributesWithSession);
|
||||
// this is a proxy so it should be reset to default
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
bean.setName(MODIFIED_NAME);
|
||||
|
||||
IScopedTestBean bean2 = (IScopedTestBean) context.getBean("session");
|
||||
assertThat(bean2.getName()).isEqualTo(MODIFIED_NAME);
|
||||
bean2.setName(DEFAULT_NAME);
|
||||
assertThat(bean.getName()).isEqualTo(DEFAULT_NAME);
|
||||
|
||||
RequestContextHolder.setRequestAttributes(oldRequestAttributesWithSession);
|
||||
assertThat(bean.getName()).isEqualTo(MODIFIED_NAME);
|
||||
}
|
||||
|
||||
|
||||
private ApplicationContext createContext(ScopedProxyMode scopedProxyMode) {
|
||||
GenericWebApplicationContext context = new GenericWebApplicationContext();
|
||||
ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(context);
|
||||
scanner.setIncludeAnnotationConfig(false);
|
||||
scanner.setBeanNameGenerator((definition, registry) -> definition.getScope());
|
||||
scanner.setScopedProxyMode(scopedProxyMode);
|
||||
|
||||
// Scan twice in order to find errors in the bean definition compatibility check.
|
||||
scanner.scan(getClass().getPackage().getName());
|
||||
scanner.scan(getClass().getPackage().getName());
|
||||
|
||||
context.refresh();
|
||||
return context;
|
||||
}
|
||||
|
||||
|
||||
interface IScopedTestBean {
|
||||
|
||||
String getName();
|
||||
|
||||
void setName(String name);
|
||||
}
|
||||
|
||||
|
||||
static abstract class ScopedTestBean implements IScopedTestBean {
|
||||
|
||||
private String name = DEFAULT_NAME;
|
||||
|
||||
@Override
|
||||
public String getName() { return this.name; }
|
||||
|
||||
@Override
|
||||
public void setName(String name) { this.name = name; }
|
||||
}
|
||||
|
||||
|
||||
@Component
|
||||
static class SingletonScopedTestBean extends ScopedTestBean {
|
||||
}
|
||||
|
||||
|
||||
interface AnotherScopeTestInterface {
|
||||
}
|
||||
|
||||
|
||||
@Component
|
||||
@RequestScope(proxyMode = DEFAULT)
|
||||
static class RequestScopedTestBean extends ScopedTestBean implements AnotherScopeTestInterface {
|
||||
}
|
||||
|
||||
|
||||
@Component
|
||||
@SessionScope(proxyMode = DEFAULT)
|
||||
static class SessionScopedTestBean extends ScopedTestBean implements AnotherScopeTestInterface {
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
-709
@@ -1,709 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core.env;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.EnvironmentAware;
|
||||
import org.springframework.context.annotation.AnnotatedBeanDefinitionReader;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.context.support.FileSystemXmlApplicationContext;
|
||||
import org.springframework.context.support.GenericApplicationContext;
|
||||
import org.springframework.context.support.GenericXmlApplicationContext;
|
||||
import org.springframework.context.support.StaticApplicationContext;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.jca.context.ResourceAdapterApplicationContext;
|
||||
import org.springframework.jca.support.SimpleBootstrapContext;
|
||||
import org.springframework.jca.work.SimpleTaskWorkManager;
|
||||
import org.springframework.mock.env.MockEnvironment;
|
||||
import org.springframework.mock.env.MockPropertySource;
|
||||
import org.springframework.mock.web.MockServletConfig;
|
||||
import org.springframework.mock.web.MockServletContext;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.context.support.AbstractRefreshableWebApplicationContext;
|
||||
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
|
||||
import org.springframework.web.context.support.GenericWebApplicationContext;
|
||||
import org.springframework.web.context.support.StandardServletEnvironment;
|
||||
import org.springframework.web.context.support.StaticWebApplicationContext;
|
||||
import org.springframework.web.context.support.XmlWebApplicationContext;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.rootBeanDefinition;
|
||||
import static org.springframework.context.ConfigurableApplicationContext.ENVIRONMENT_BEAN_NAME;
|
||||
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DERIVED_DEV_BEAN_NAME;
|
||||
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DERIVED_DEV_ENV_NAME;
|
||||
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_BEAN_NAME;
|
||||
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_ENV_NAME;
|
||||
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.ENVIRONMENT_AWARE_BEAN_NAME;
|
||||
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_BEAN_NAME;
|
||||
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_ENV_NAME;
|
||||
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.TRANSITIVE_BEAN_NAME;
|
||||
import static org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.XML_PATH;
|
||||
|
||||
/**
|
||||
* System integration tests for container support of the {@link Environment} API.
|
||||
*
|
||||
* <p>
|
||||
* Tests all existing BeanFactory and ApplicationContext implementations to ensure that:
|
||||
* <ul>
|
||||
* <li>a standard environment object is always present
|
||||
* <li>a custom environment object can be set and retrieved against the factory/context
|
||||
* <li>the {@link EnvironmentAware} interface is respected
|
||||
* <li>the environment object is registered with the container as a singleton bean (if an
|
||||
* ApplicationContext)
|
||||
* <li>bean definition files (if any, and whether XML or @Configuration) are registered
|
||||
* conditionally based on environment metadata
|
||||
* </ul>
|
||||
*
|
||||
* @author Chris Beams
|
||||
* @author Sam Brannen
|
||||
* @see org.springframework.context.support.EnvironmentIntegrationTests
|
||||
*/
|
||||
@SuppressWarnings("resource")
|
||||
public class EnvironmentSystemIntegrationTests {
|
||||
|
||||
private final ConfigurableEnvironment prodEnv = new StandardEnvironment();
|
||||
|
||||
private final ConfigurableEnvironment devEnv = new StandardEnvironment();
|
||||
|
||||
private final ConfigurableEnvironment prodWebEnv = new StandardServletEnvironment();
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
prodEnv.setActiveProfiles(PROD_ENV_NAME);
|
||||
devEnv.setActiveProfiles(DEV_ENV_NAME);
|
||||
prodWebEnv.setActiveProfiles(PROD_ENV_NAME);
|
||||
}
|
||||
|
||||
@Test
|
||||
void genericApplicationContext_standardEnv() {
|
||||
ConfigurableApplicationContext ctx = new GenericApplicationContext(newBeanFactoryWithEnvironmentAwareBean());
|
||||
ctx.refresh();
|
||||
|
||||
assertHasStandardEnvironment(ctx);
|
||||
assertEnvironmentBeanRegistered(ctx);
|
||||
assertEnvironmentAwareInvoked(ctx, ctx.getEnvironment());
|
||||
}
|
||||
|
||||
@Test
|
||||
void genericApplicationContext_customEnv() {
|
||||
GenericApplicationContext ctx = new GenericApplicationContext(newBeanFactoryWithEnvironmentAwareBean());
|
||||
ctx.setEnvironment(prodEnv);
|
||||
ctx.refresh();
|
||||
|
||||
assertHasEnvironment(ctx, prodEnv);
|
||||
assertEnvironmentBeanRegistered(ctx);
|
||||
assertEnvironmentAwareInvoked(ctx, prodEnv);
|
||||
}
|
||||
|
||||
@Test
|
||||
void xmlBeanDefinitionReader_inheritsEnvironmentFromEnvironmentCapableBDR() {
|
||||
GenericApplicationContext ctx = new GenericApplicationContext();
|
||||
ctx.setEnvironment(prodEnv);
|
||||
new XmlBeanDefinitionReader(ctx).loadBeanDefinitions(XML_PATH);
|
||||
ctx.refresh();
|
||||
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
|
||||
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void annotatedBeanDefinitionReader_inheritsEnvironmentFromEnvironmentCapableBDR() {
|
||||
GenericApplicationContext ctx = new GenericApplicationContext();
|
||||
ctx.setEnvironment(prodEnv);
|
||||
new AnnotatedBeanDefinitionReader(ctx).register(Config.class);
|
||||
ctx.refresh();
|
||||
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
|
||||
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void classPathBeanDefinitionScanner_inheritsEnvironmentFromEnvironmentCapableBDR_scanProfileAnnotatedConfigClasses() {
|
||||
// it's actually ConfigurationClassPostProcessor's Environment that gets the job done here.
|
||||
GenericApplicationContext ctx = new GenericApplicationContext();
|
||||
ctx.setEnvironment(prodEnv);
|
||||
ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(ctx);
|
||||
scanner.scan("org.springframework.core.env.scan1");
|
||||
ctx.refresh();
|
||||
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
|
||||
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void classPathBeanDefinitionScanner_inheritsEnvironmentFromEnvironmentCapableBDR_scanProfileAnnotatedComponents() {
|
||||
GenericApplicationContext ctx = new GenericApplicationContext();
|
||||
ctx.setEnvironment(prodEnv);
|
||||
ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(ctx);
|
||||
scanner.scan("org.springframework.core.env.scan2");
|
||||
ctx.refresh();
|
||||
assertThat(scanner.getEnvironment()).isEqualTo(ctx.getEnvironment());
|
||||
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
|
||||
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void genericXmlApplicationContext() {
|
||||
GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
|
||||
assertHasStandardEnvironment(ctx);
|
||||
ctx.setEnvironment(prodEnv);
|
||||
ctx.load(XML_PATH);
|
||||
ctx.refresh();
|
||||
|
||||
assertHasEnvironment(ctx, prodEnv);
|
||||
assertEnvironmentBeanRegistered(ctx);
|
||||
assertEnvironmentAwareInvoked(ctx, prodEnv);
|
||||
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
|
||||
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void classPathXmlApplicationContext() {
|
||||
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(XML_PATH);
|
||||
ctx.setEnvironment(prodEnv);
|
||||
ctx.refresh();
|
||||
|
||||
assertEnvironmentBeanRegistered(ctx);
|
||||
assertHasEnvironment(ctx, prodEnv);
|
||||
assertEnvironmentAwareInvoked(ctx, ctx.getEnvironment());
|
||||
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
|
||||
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void fileSystemXmlApplicationContext() throws IOException {
|
||||
ClassPathResource xml = new ClassPathResource(XML_PATH);
|
||||
File tmpFile = File.createTempFile("test", "xml");
|
||||
FileCopyUtils.copy(xml.getFile(), tmpFile);
|
||||
|
||||
// strange - FSXAC strips leading '/' unless prefixed with 'file:'
|
||||
ConfigurableApplicationContext ctx =
|
||||
new FileSystemXmlApplicationContext(new String[] {"file:" + tmpFile.getPath()}, false);
|
||||
ctx.setEnvironment(prodEnv);
|
||||
ctx.refresh();
|
||||
assertEnvironmentBeanRegistered(ctx);
|
||||
assertHasEnvironment(ctx, prodEnv);
|
||||
assertEnvironmentAwareInvoked(ctx, ctx.getEnvironment());
|
||||
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
|
||||
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void annotationConfigApplicationContext_withPojos() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
|
||||
assertHasStandardEnvironment(ctx);
|
||||
ctx.setEnvironment(prodEnv);
|
||||
|
||||
ctx.register(EnvironmentAwareBean.class);
|
||||
ctx.refresh();
|
||||
|
||||
assertEnvironmentAwareInvoked(ctx, prodEnv);
|
||||
}
|
||||
|
||||
@Test
|
||||
void annotationConfigApplicationContext_withProdEnvAndProdConfigClass() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
|
||||
assertHasStandardEnvironment(ctx);
|
||||
ctx.setEnvironment(prodEnv);
|
||||
|
||||
ctx.register(ProdConfig.class);
|
||||
ctx.refresh();
|
||||
|
||||
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void annotationConfigApplicationContext_withProdEnvAndDevConfigClass() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
|
||||
assertHasStandardEnvironment(ctx);
|
||||
ctx.setEnvironment(prodEnv);
|
||||
|
||||
ctx.register(DevConfig.class);
|
||||
ctx.refresh();
|
||||
|
||||
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
|
||||
assertThat(ctx.containsBean(TRANSITIVE_BEAN_NAME)).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void annotationConfigApplicationContext_withDevEnvAndDevConfigClass() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
|
||||
assertHasStandardEnvironment(ctx);
|
||||
ctx.setEnvironment(devEnv);
|
||||
|
||||
ctx.register(DevConfig.class);
|
||||
ctx.refresh();
|
||||
|
||||
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isTrue();
|
||||
assertThat(ctx.containsBean(TRANSITIVE_BEAN_NAME)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void annotationConfigApplicationContext_withImportedConfigClasses() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
|
||||
assertHasStandardEnvironment(ctx);
|
||||
ctx.setEnvironment(prodEnv);
|
||||
|
||||
ctx.register(Config.class);
|
||||
ctx.refresh();
|
||||
|
||||
assertEnvironmentAwareInvoked(ctx, prodEnv);
|
||||
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
|
||||
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
|
||||
assertThat(ctx.containsBean(TRANSITIVE_BEAN_NAME)).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void mostSpecificDerivedClassDrivesEnvironment_withDerivedDevEnvAndDerivedDevConfigClass() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
StandardEnvironment derivedDevEnv = new StandardEnvironment();
|
||||
derivedDevEnv.setActiveProfiles(DERIVED_DEV_ENV_NAME);
|
||||
ctx.setEnvironment(derivedDevEnv);
|
||||
ctx.register(DerivedDevConfig.class);
|
||||
ctx.refresh();
|
||||
|
||||
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isTrue();
|
||||
assertThat(ctx.containsBean(DERIVED_DEV_BEAN_NAME)).isTrue();
|
||||
assertThat(ctx.containsBean(TRANSITIVE_BEAN_NAME)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void mostSpecificDerivedClassDrivesEnvironment_withDevEnvAndDerivedDevConfigClass() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.setEnvironment(devEnv);
|
||||
ctx.register(DerivedDevConfig.class);
|
||||
ctx.refresh();
|
||||
|
||||
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
|
||||
assertThat(ctx.containsBean(DERIVED_DEV_BEAN_NAME)).isFalse();
|
||||
assertThat(ctx.containsBean(TRANSITIVE_BEAN_NAME)).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void annotationConfigApplicationContext_withProfileExpressionMatchOr() {
|
||||
testProfileExpression(true, "p3");
|
||||
}
|
||||
|
||||
@Test
|
||||
void annotationConfigApplicationContext_withProfileExpressionMatchAnd() {
|
||||
testProfileExpression(true, "p1", "p2");
|
||||
}
|
||||
|
||||
@Test
|
||||
void annotationConfigApplicationContext_withProfileExpressionNoMatchAnd() {
|
||||
testProfileExpression(false, "p1");
|
||||
}
|
||||
|
||||
@Test
|
||||
void annotationConfigApplicationContext_withProfileExpressionNoMatchNone() {
|
||||
testProfileExpression(false, "p4");
|
||||
}
|
||||
|
||||
private void testProfileExpression(boolean expected, String... activeProfiles) {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
StandardEnvironment environment = new StandardEnvironment();
|
||||
environment.setActiveProfiles(activeProfiles);
|
||||
ctx.setEnvironment(environment);
|
||||
ctx.register(ProfileExpressionConfig.class);
|
||||
ctx.refresh();
|
||||
assertThat(ctx.containsBean("expressionBean")).isEqualTo(expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
void webApplicationContext() {
|
||||
GenericWebApplicationContext ctx = new GenericWebApplicationContext(newBeanFactoryWithEnvironmentAwareBean());
|
||||
assertHasStandardServletEnvironment(ctx);
|
||||
ctx.setEnvironment(prodWebEnv);
|
||||
ctx.refresh();
|
||||
|
||||
assertHasEnvironment(ctx, prodWebEnv);
|
||||
assertEnvironmentBeanRegistered(ctx);
|
||||
assertEnvironmentAwareInvoked(ctx, prodWebEnv);
|
||||
}
|
||||
|
||||
@Test
|
||||
void xmlWebApplicationContext() {
|
||||
AbstractRefreshableWebApplicationContext ctx = new XmlWebApplicationContext();
|
||||
ctx.setConfigLocation("classpath:" + XML_PATH);
|
||||
ctx.setEnvironment(prodWebEnv);
|
||||
ctx.refresh();
|
||||
|
||||
assertHasEnvironment(ctx, prodWebEnv);
|
||||
assertEnvironmentBeanRegistered(ctx);
|
||||
assertEnvironmentAwareInvoked(ctx, prodWebEnv);
|
||||
assertThat(ctx.containsBean(DEV_BEAN_NAME)).isFalse();
|
||||
assertThat(ctx.containsBean(PROD_BEAN_NAME)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void staticApplicationContext() {
|
||||
StaticApplicationContext ctx = new StaticApplicationContext();
|
||||
|
||||
assertHasStandardEnvironment(ctx);
|
||||
|
||||
registerEnvironmentBeanDefinition(ctx);
|
||||
|
||||
ctx.setEnvironment(prodEnv);
|
||||
ctx.refresh();
|
||||
|
||||
assertHasEnvironment(ctx, prodEnv);
|
||||
assertEnvironmentBeanRegistered(ctx);
|
||||
assertEnvironmentAwareInvoked(ctx, prodEnv);
|
||||
}
|
||||
|
||||
@Test
|
||||
void staticWebApplicationContext() {
|
||||
StaticWebApplicationContext ctx = new StaticWebApplicationContext();
|
||||
|
||||
assertHasStandardServletEnvironment(ctx);
|
||||
|
||||
registerEnvironmentBeanDefinition(ctx);
|
||||
|
||||
ctx.setEnvironment(prodWebEnv);
|
||||
ctx.refresh();
|
||||
|
||||
assertHasEnvironment(ctx, prodWebEnv);
|
||||
assertEnvironmentBeanRegistered(ctx);
|
||||
assertEnvironmentAwareInvoked(ctx, prodWebEnv);
|
||||
}
|
||||
|
||||
@Test
|
||||
void annotationConfigWebApplicationContext() {
|
||||
AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
|
||||
ctx.setEnvironment(prodWebEnv);
|
||||
ctx.setConfigLocation(EnvironmentAwareBean.class.getName());
|
||||
ctx.refresh();
|
||||
|
||||
assertHasEnvironment(ctx, prodWebEnv);
|
||||
assertEnvironmentBeanRegistered(ctx);
|
||||
assertEnvironmentAwareInvoked(ctx, prodWebEnv);
|
||||
}
|
||||
|
||||
@Test
|
||||
void registerServletParamPropertySources_AbstractRefreshableWebApplicationContext() {
|
||||
MockServletContext servletContext = new MockServletContext();
|
||||
servletContext.addInitParameter("pCommon", "pCommonContextValue");
|
||||
servletContext.addInitParameter("pContext1", "pContext1Value");
|
||||
|
||||
MockServletConfig servletConfig = new MockServletConfig(servletContext);
|
||||
servletConfig.addInitParameter("pCommon", "pCommonConfigValue");
|
||||
servletConfig.addInitParameter("pConfig1", "pConfig1Value");
|
||||
|
||||
AbstractRefreshableWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
|
||||
ctx.setConfigLocation(EnvironmentAwareBean.class.getName());
|
||||
ctx.setServletConfig(servletConfig);
|
||||
ctx.refresh();
|
||||
|
||||
ConfigurableEnvironment environment = ctx.getEnvironment();
|
||||
assertThat(environment).isInstanceOf(StandardServletEnvironment.class);
|
||||
MutablePropertySources propertySources = environment.getPropertySources();
|
||||
assertThat(propertySources.contains(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME)).isTrue();
|
||||
assertThat(propertySources.contains(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)).isTrue();
|
||||
|
||||
// ServletConfig gets precedence
|
||||
assertThat(environment.getProperty("pCommon")).isEqualTo("pCommonConfigValue");
|
||||
assertThat(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)))
|
||||
.isLessThan(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME)));
|
||||
|
||||
// but all params are available
|
||||
assertThat(environment.getProperty("pContext1")).isEqualTo("pContext1Value");
|
||||
assertThat(environment.getProperty("pConfig1")).isEqualTo("pConfig1Value");
|
||||
|
||||
// Servlet* PropertySources have precedence over System* PropertySources
|
||||
assertThat(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)))
|
||||
.isLessThan(propertySources.precedenceOf(PropertySource.named(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)));
|
||||
|
||||
// Replace system properties with a mock property source for convenience
|
||||
MockPropertySource mockSystemProperties = new MockPropertySource(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME);
|
||||
mockSystemProperties.setProperty("pCommon", "pCommonSysPropsValue");
|
||||
mockSystemProperties.setProperty("pSysProps1", "pSysProps1Value");
|
||||
propertySources.replace(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, mockSystemProperties);
|
||||
|
||||
// assert that servletconfig params resolve with higher precedence than sysprops
|
||||
assertThat(environment.getProperty("pCommon")).isEqualTo("pCommonConfigValue");
|
||||
assertThat(environment.getProperty("pSysProps1")).isEqualTo("pSysProps1Value");
|
||||
}
|
||||
|
||||
@Test
|
||||
void registerServletParamPropertySources_GenericWebApplicationContext() {
|
||||
MockServletContext servletContext = new MockServletContext();
|
||||
servletContext.addInitParameter("pCommon", "pCommonContextValue");
|
||||
servletContext.addInitParameter("pContext1", "pContext1Value");
|
||||
|
||||
GenericWebApplicationContext ctx = new GenericWebApplicationContext();
|
||||
ctx.setServletContext(servletContext);
|
||||
ctx.refresh();
|
||||
|
||||
ConfigurableEnvironment environment = ctx.getEnvironment();
|
||||
assertThat(environment).isInstanceOf(StandardServletEnvironment.class);
|
||||
MutablePropertySources propertySources = environment.getPropertySources();
|
||||
assertThat(propertySources.contains(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME)).isTrue();
|
||||
|
||||
// ServletContext params are available
|
||||
assertThat(environment.getProperty("pCommon")).isEqualTo("pCommonContextValue");
|
||||
assertThat(environment.getProperty("pContext1")).isEqualTo("pContext1Value");
|
||||
|
||||
// Servlet* PropertySources have precedence over System* PropertySources
|
||||
assertThat(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME)))
|
||||
.isLessThan(propertySources.precedenceOf(PropertySource.named(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)));
|
||||
|
||||
// Replace system properties with a mock property source for convenience
|
||||
MockPropertySource mockSystemProperties = new MockPropertySource(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME);
|
||||
mockSystemProperties.setProperty("pCommon", "pCommonSysPropsValue");
|
||||
mockSystemProperties.setProperty("pSysProps1", "pSysProps1Value");
|
||||
propertySources.replace(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, mockSystemProperties);
|
||||
|
||||
// assert that servletcontext init params resolve with higher precedence than sysprops
|
||||
assertThat(environment.getProperty("pCommon")).isEqualTo("pCommonContextValue");
|
||||
assertThat(environment.getProperty("pSysProps1")).isEqualTo("pSysProps1Value");
|
||||
}
|
||||
|
||||
@Test
|
||||
void registerServletParamPropertySources_StaticWebApplicationContext() {
|
||||
MockServletContext servletContext = new MockServletContext();
|
||||
servletContext.addInitParameter("pCommon", "pCommonContextValue");
|
||||
servletContext.addInitParameter("pContext1", "pContext1Value");
|
||||
|
||||
MockServletConfig servletConfig = new MockServletConfig(servletContext);
|
||||
servletConfig.addInitParameter("pCommon", "pCommonConfigValue");
|
||||
servletConfig.addInitParameter("pConfig1", "pConfig1Value");
|
||||
|
||||
StaticWebApplicationContext ctx = new StaticWebApplicationContext();
|
||||
ctx.setServletConfig(servletConfig);
|
||||
ctx.refresh();
|
||||
|
||||
ConfigurableEnvironment environment = ctx.getEnvironment();
|
||||
MutablePropertySources propertySources = environment.getPropertySources();
|
||||
assertThat(propertySources.contains(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME)).isTrue();
|
||||
assertThat(propertySources.contains(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)).isTrue();
|
||||
|
||||
// ServletConfig gets precedence
|
||||
assertThat(environment.getProperty("pCommon")).isEqualTo("pCommonConfigValue");
|
||||
assertThat(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)))
|
||||
.isLessThan(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONTEXT_PROPERTY_SOURCE_NAME)));
|
||||
|
||||
// but all params are available
|
||||
assertThat(environment.getProperty("pContext1")).isEqualTo("pContext1Value");
|
||||
assertThat(environment.getProperty("pConfig1")).isEqualTo("pConfig1Value");
|
||||
|
||||
// Servlet* PropertySources have precedence over System* PropertySources
|
||||
assertThat(propertySources.precedenceOf(PropertySource.named(StandardServletEnvironment.SERVLET_CONFIG_PROPERTY_SOURCE_NAME)))
|
||||
.isLessThan(propertySources.precedenceOf(PropertySource.named(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)));
|
||||
|
||||
// Replace system properties with a mock property source for convenience
|
||||
MockPropertySource mockSystemProperties = new MockPropertySource(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME);
|
||||
mockSystemProperties.setProperty("pCommon", "pCommonSysPropsValue");
|
||||
mockSystemProperties.setProperty("pSysProps1", "pSysProps1Value");
|
||||
propertySources.replace(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME, mockSystemProperties);
|
||||
|
||||
// assert that servletconfig params resolve with higher precedence than sysprops
|
||||
assertThat(environment.getProperty("pCommon")).isEqualTo("pCommonConfigValue");
|
||||
assertThat(environment.getProperty("pSysProps1")).isEqualTo("pSysProps1Value");
|
||||
}
|
||||
|
||||
@Test
|
||||
void resourceAdapterApplicationContext() {
|
||||
ResourceAdapterApplicationContext ctx = new ResourceAdapterApplicationContext(new SimpleBootstrapContext(new SimpleTaskWorkManager()));
|
||||
|
||||
assertHasStandardEnvironment(ctx);
|
||||
|
||||
registerEnvironmentBeanDefinition(ctx);
|
||||
|
||||
ctx.setEnvironment(prodEnv);
|
||||
ctx.refresh();
|
||||
|
||||
assertHasEnvironment(ctx, prodEnv);
|
||||
assertEnvironmentBeanRegistered(ctx);
|
||||
assertEnvironmentAwareInvoked(ctx, prodEnv);
|
||||
}
|
||||
|
||||
@Test
|
||||
void abstractApplicationContextValidatesRequiredPropertiesOnRefresh() {
|
||||
{
|
||||
ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.refresh();
|
||||
}
|
||||
|
||||
{
|
||||
ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.getEnvironment().setRequiredProperties("foo", "bar");
|
||||
assertThatExceptionOfType(MissingRequiredPropertiesException.class).isThrownBy(ctx::refresh);
|
||||
}
|
||||
|
||||
{
|
||||
ConfigurableApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.getEnvironment().setRequiredProperties("foo");
|
||||
ctx.setEnvironment(new MockEnvironment().withProperty("foo", "fooValue"));
|
||||
ctx.refresh(); // should succeed
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private DefaultListableBeanFactory newBeanFactoryWithEnvironmentAwareBean() {
|
||||
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
|
||||
registerEnvironmentBeanDefinition(bf);
|
||||
return bf;
|
||||
}
|
||||
|
||||
private void registerEnvironmentBeanDefinition(BeanDefinitionRegistry registry) {
|
||||
registry.registerBeanDefinition(ENVIRONMENT_AWARE_BEAN_NAME,
|
||||
rootBeanDefinition(EnvironmentAwareBean.class).getBeanDefinition());
|
||||
}
|
||||
|
||||
private void assertEnvironmentBeanRegistered(
|
||||
ConfigurableApplicationContext ctx) {
|
||||
// ensure environment is registered as a bean
|
||||
assertThat(ctx.containsBean(ENVIRONMENT_BEAN_NAME)).isTrue();
|
||||
}
|
||||
|
||||
private void assertHasStandardEnvironment(ApplicationContext ctx) {
|
||||
Environment defaultEnv = ctx.getEnvironment();
|
||||
assertThat(defaultEnv).isNotNull();
|
||||
assertThat(defaultEnv).isInstanceOf(StandardEnvironment.class);
|
||||
}
|
||||
|
||||
private void assertHasStandardServletEnvironment(WebApplicationContext ctx) {
|
||||
// ensure a default servlet environment exists
|
||||
Environment defaultEnv = ctx.getEnvironment();
|
||||
assertThat(defaultEnv).isNotNull();
|
||||
assertThat(defaultEnv).isInstanceOf(StandardServletEnvironment.class);
|
||||
}
|
||||
|
||||
private void assertHasEnvironment(ApplicationContext ctx, Environment expectedEnv) {
|
||||
// ensure the custom environment took
|
||||
Environment actualEnv = ctx.getEnvironment();
|
||||
assertThat(actualEnv).isNotNull();
|
||||
assertThat(actualEnv).isEqualTo(expectedEnv);
|
||||
// ensure environment is registered as a bean
|
||||
assertThat(ctx.containsBean(ENVIRONMENT_BEAN_NAME)).isTrue();
|
||||
}
|
||||
|
||||
private void assertEnvironmentAwareInvoked(ConfigurableApplicationContext ctx, Environment expectedEnv) {
|
||||
assertThat(ctx.getBean(EnvironmentAwareBean.class).environment).isEqualTo(expectedEnv);
|
||||
}
|
||||
|
||||
|
||||
private static class EnvironmentAwareBean implements EnvironmentAware {
|
||||
|
||||
public Environment environment;
|
||||
|
||||
@Override
|
||||
public void setEnvironment(Environment environment) {
|
||||
this.environment = environment;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Mirrors the structure of beans and environment-specific config files in
|
||||
* EnvironmentSystemIntegrationTests-context.xml
|
||||
*/
|
||||
@Configuration
|
||||
@Import({DevConfig.class, ProdConfig.class})
|
||||
static class Config {
|
||||
@Bean
|
||||
public EnvironmentAwareBean envAwareBean() {
|
||||
return new EnvironmentAwareBean();
|
||||
}
|
||||
}
|
||||
|
||||
@Profile(DEV_ENV_NAME)
|
||||
@Configuration
|
||||
@Import(TransitiveConfig.class)
|
||||
static class DevConfig {
|
||||
@Bean
|
||||
public Object devBean() {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
|
||||
@Profile(PROD_ENV_NAME)
|
||||
@Configuration
|
||||
static class ProdConfig {
|
||||
@Bean
|
||||
public Object prodBean() {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
|
||||
@Configuration
|
||||
static class TransitiveConfig {
|
||||
@Bean
|
||||
public Object transitiveBean() {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
|
||||
@Profile(DERIVED_DEV_ENV_NAME)
|
||||
@Configuration
|
||||
static class DerivedDevConfig extends DevConfig {
|
||||
@Bean
|
||||
public Object derivedDevBean() {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
|
||||
@Profile("(p1 & p2) | p3")
|
||||
@Configuration
|
||||
static class ProfileExpressionConfig {
|
||||
@Bean
|
||||
public Object expressionBean() {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constants used both locally and in scan* sub-packages
|
||||
*/
|
||||
public static class Constants {
|
||||
|
||||
public static final String XML_PATH = "org/springframework/core/env/EnvironmentSystemIntegrationTests-context.xml";
|
||||
|
||||
public static final String ENVIRONMENT_AWARE_BEAN_NAME = "envAwareBean";
|
||||
|
||||
public static final String PROD_BEAN_NAME = "prodBean";
|
||||
public static final String DEV_BEAN_NAME = "devBean";
|
||||
public static final String DERIVED_DEV_BEAN_NAME = "derivedDevBean";
|
||||
public static final String TRANSITIVE_BEAN_NAME = "transitiveBean";
|
||||
|
||||
public static final String PROD_ENV_NAME = "prod";
|
||||
public static final String DEV_ENV_NAME = "dev";
|
||||
public static final String DERIVED_DEV_ENV_NAME = "derivedDev";
|
||||
}
|
||||
|
||||
}
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core.env;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.context.support.GenericApplicationContext;
|
||||
|
||||
import static org.springframework.beans.factory.support.BeanDefinitionBuilder.rootBeanDefinition;
|
||||
|
||||
class PropertyPlaceholderConfigurerEnvironmentIntegrationTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("deprecation")
|
||||
void test() {
|
||||
GenericApplicationContext ctx = new GenericApplicationContext();
|
||||
ctx.registerBeanDefinition("ppc",
|
||||
rootBeanDefinition(org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.class)
|
||||
.addPropertyValue("searchSystemEnvironment", false)
|
||||
.getBeanDefinition());
|
||||
ctx.refresh();
|
||||
ctx.getBean("ppc");
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core.env.scan1;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
@Configuration
|
||||
@Import({ DevConfig.class, ProdConfig.class })
|
||||
class Config {
|
||||
|
||||
}
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core.env.scan1;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
|
||||
@Profile(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_ENV_NAME)
|
||||
@Configuration
|
||||
class DevConfig {
|
||||
|
||||
@Bean
|
||||
public Object devBean() {
|
||||
return new Object();
|
||||
}
|
||||
|
||||
}
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core.env.scan1;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
|
||||
@Profile(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_ENV_NAME)
|
||||
@Configuration
|
||||
class ProdConfig {
|
||||
|
||||
@Bean
|
||||
public Object prodBean() {
|
||||
return new Object();
|
||||
}
|
||||
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core.env.scan2;
|
||||
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Profile(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_ENV_NAME)
|
||||
@Component(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.DEV_BEAN_NAME)
|
||||
class DevBean {
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.core.env.scan2;
|
||||
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Profile(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_ENV_NAME)
|
||||
@Component(org.springframework.core.env.EnvironmentSystemIntegrationTests.Constants.PROD_BEAN_NAME)
|
||||
class ProdBean {
|
||||
|
||||
}
|
||||
-63
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.expression.spel.support;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.core.convert.TypeDescriptor;
|
||||
import org.springframework.expression.MethodExecutor;
|
||||
|
||||
class Spr7538Tests {
|
||||
|
||||
@Test
|
||||
void repro() throws Exception {
|
||||
AlwaysTrueReleaseStrategy target = new AlwaysTrueReleaseStrategy();
|
||||
BeanFactoryTypeConverter converter = new BeanFactoryTypeConverter();
|
||||
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
context.setTypeConverter(converter);
|
||||
|
||||
List<Foo> arguments = Collections.emptyList();
|
||||
|
||||
List<TypeDescriptor> paramDescriptors = new ArrayList<>();
|
||||
Method method = AlwaysTrueReleaseStrategy.class.getMethod("checkCompleteness", List.class);
|
||||
paramDescriptors.add(new TypeDescriptor(new MethodParameter(method, 0)));
|
||||
|
||||
|
||||
List<TypeDescriptor> argumentTypes = new ArrayList<>();
|
||||
argumentTypes.add(TypeDescriptor.forObject(arguments));
|
||||
ReflectiveMethodResolver resolver = new ReflectiveMethodResolver();
|
||||
MethodExecutor executor = resolver.resolve(context, target, "checkCompleteness", argumentTypes);
|
||||
|
||||
Object result = executor.execute(context, target, arguments);
|
||||
System.out.println("Result: " + result);
|
||||
}
|
||||
|
||||
static class AlwaysTrueReleaseStrategy {
|
||||
public boolean checkCompleteness(List<Foo> messages) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
static class Foo{}
|
||||
}
|
||||
-250
@@ -1,250 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.scheduling.annotation;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.testfixture.EnabledForTestGroups;
|
||||
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
|
||||
import org.springframework.dao.support.PersistenceExceptionTranslator;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.testfixture.CallCountingTransactionManager;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.springframework.core.testfixture.TestGroup.LONG_RUNNING;
|
||||
|
||||
/**
|
||||
* Integration tests cornering bug SPR-8651, which revealed that @Scheduled methods may
|
||||
* not work well with beans that have already been proxied for other reasons such
|
||||
* as @Transactional or @Async processing.
|
||||
*
|
||||
* @author Chris Beams
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.1
|
||||
*/
|
||||
@SuppressWarnings("resource")
|
||||
@EnabledForTestGroups(LONG_RUNNING)
|
||||
class ScheduledAndTransactionalAnnotationIntegrationTests {
|
||||
|
||||
@Test
|
||||
void failsWhenJdkProxyAndScheduledMethodNotPresentOnInterface() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(Config.class, JdkProxyTxConfig.class, RepoConfigA.class);
|
||||
assertThatExceptionOfType(BeanCreationException.class)
|
||||
.isThrownBy(ctx::refresh)
|
||||
.withCauseInstanceOf(IllegalStateException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void succeedsWhenSubclassProxyAndScheduledMethodNotPresentOnInterface() throws InterruptedException {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(Config.class, SubclassProxyTxConfig.class, RepoConfigA.class);
|
||||
ctx.refresh();
|
||||
|
||||
Thread.sleep(200); // allow @Scheduled method to be called several times
|
||||
|
||||
MyRepository repository = ctx.getBean(MyRepository.class);
|
||||
CallCountingTransactionManager txManager = ctx.getBean(CallCountingTransactionManager.class);
|
||||
assertThat(AopUtils.isCglibProxy(repository)).isTrue();
|
||||
assertThat(repository.getInvocationCount()).isGreaterThan(0);
|
||||
assertThat(txManager.commits).isGreaterThan(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
void succeedsWhenJdkProxyAndScheduledMethodIsPresentOnInterface() throws InterruptedException {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(Config.class, JdkProxyTxConfig.class, RepoConfigB.class);
|
||||
ctx.refresh();
|
||||
|
||||
Thread.sleep(200); // allow @Scheduled method to be called several times
|
||||
|
||||
MyRepositoryWithScheduledMethod repository = ctx.getBean(MyRepositoryWithScheduledMethod.class);
|
||||
CallCountingTransactionManager txManager = ctx.getBean(CallCountingTransactionManager.class);
|
||||
assertThat(AopUtils.isJdkDynamicProxy(repository)).isTrue();
|
||||
assertThat(repository.getInvocationCount()).isGreaterThan(0);
|
||||
assertThat(txManager.commits).isGreaterThan(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
void withAspectConfig() throws InterruptedException {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(AspectConfig.class, MyRepositoryWithScheduledMethodImpl.class);
|
||||
ctx.refresh();
|
||||
|
||||
Thread.sleep(200); // allow @Scheduled method to be called several times
|
||||
|
||||
MyRepositoryWithScheduledMethod repository = ctx.getBean(MyRepositoryWithScheduledMethod.class);
|
||||
assertThat(AopUtils.isCglibProxy(repository)).isTrue();
|
||||
assertThat(repository.getInvocationCount()).isGreaterThan(0);
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
static class JdkProxyTxConfig {
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement(proxyTargetClass = true)
|
||||
static class SubclassProxyTxConfig {
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
static class RepoConfigA {
|
||||
|
||||
@Bean
|
||||
MyRepository repository() {
|
||||
return new MyRepositoryImpl();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
static class RepoConfigB {
|
||||
|
||||
@Bean
|
||||
MyRepositoryWithScheduledMethod repository() {
|
||||
return new MyRepositoryWithScheduledMethodImpl();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableScheduling
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
PlatformTransactionManager txManager() {
|
||||
return new CallCountingTransactionManager();
|
||||
}
|
||||
|
||||
@Bean
|
||||
PersistenceExceptionTranslator peTranslator() {
|
||||
return mock(PersistenceExceptionTranslator.class);
|
||||
}
|
||||
|
||||
@Bean
|
||||
static PersistenceExceptionTranslationPostProcessor peTranslationPostProcessor() {
|
||||
return new PersistenceExceptionTranslationPostProcessor();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableScheduling
|
||||
static class AspectConfig {
|
||||
|
||||
@Bean
|
||||
static AnnotationAwareAspectJAutoProxyCreator autoProxyCreator() {
|
||||
AnnotationAwareAspectJAutoProxyCreator apc = new AnnotationAwareAspectJAutoProxyCreator();
|
||||
apc.setProxyTargetClass(true);
|
||||
return apc;
|
||||
}
|
||||
|
||||
@Bean
|
||||
static MyAspect myAspect() {
|
||||
return new MyAspect();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Aspect
|
||||
public static class MyAspect {
|
||||
|
||||
private final AtomicInteger count = new AtomicInteger();
|
||||
|
||||
@org.aspectj.lang.annotation.Before("execution(* scheduled())")
|
||||
public void checkTransaction() {
|
||||
this.count.incrementAndGet();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public interface MyRepository {
|
||||
|
||||
int getInvocationCount();
|
||||
}
|
||||
|
||||
|
||||
@Repository
|
||||
static class MyRepositoryImpl implements MyRepository {
|
||||
|
||||
private final AtomicInteger count = new AtomicInteger();
|
||||
|
||||
@Transactional
|
||||
@Scheduled(fixedDelay = 5)
|
||||
public void scheduled() {
|
||||
this.count.incrementAndGet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInvocationCount() {
|
||||
return this.count.get();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public interface MyRepositoryWithScheduledMethod {
|
||||
|
||||
int getInvocationCount();
|
||||
|
||||
void scheduled();
|
||||
}
|
||||
|
||||
|
||||
@Repository
|
||||
static class MyRepositoryWithScheduledMethodImpl implements MyRepositoryWithScheduledMethod {
|
||||
|
||||
private final AtomicInteger count = new AtomicInteger();
|
||||
|
||||
@Autowired(required = false)
|
||||
private MyAspect myAspect;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
@Scheduled(fixedDelay = 5)
|
||||
public void scheduled() {
|
||||
this.count.incrementAndGet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInvocationCount() {
|
||||
if (this.myAspect != null) {
|
||||
assertThat(this.myAspect.count.get()).isEqualTo(this.count.get());
|
||||
}
|
||||
return this.count.get();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
-331
@@ -1,331 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.transaction.annotation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.concurrent.ConcurrentMapCache;
|
||||
import org.springframework.cache.support.SimpleCacheManager;
|
||||
import org.springframework.context.annotation.AdviceMode;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
|
||||
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor;
|
||||
import org.springframework.transaction.testfixture.CallCountingTransactionManager;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatException;
|
||||
|
||||
/**
|
||||
* Integration tests for the @EnableTransactionManagement annotation.
|
||||
*
|
||||
* @author Chris Beams
|
||||
* @author Sam Brannen
|
||||
* @since 3.1
|
||||
*/
|
||||
@SuppressWarnings("resource")
|
||||
class EnableTransactionManagementIntegrationTests {
|
||||
|
||||
@Test
|
||||
void repositoryIsNotTxProxy() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Config.class);
|
||||
|
||||
assertThat(isTxProxy(ctx.getBean(FooRepository.class))).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void repositoryIsTxProxy_withDefaultTxManagerName() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Config.class, DefaultTxManagerNameConfig.class);
|
||||
|
||||
assertTxProxying(ctx);
|
||||
}
|
||||
|
||||
@Test
|
||||
void repositoryIsTxProxy_withCustomTxManagerName() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Config.class, CustomTxManagerNameConfig.class);
|
||||
|
||||
assertTxProxying(ctx);
|
||||
}
|
||||
|
||||
@Test
|
||||
void repositoryIsTxProxy_withNonConventionalTxManagerName_fallsBackToByTypeLookup() {
|
||||
assertTxProxying(new AnnotationConfigApplicationContext(Config.class, NonConventionalTxManagerNameConfig.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void repositoryIsClassBasedTxProxy() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Config.class, ProxyTargetClassTxConfig.class);
|
||||
|
||||
assertTxProxying(ctx);
|
||||
assertThat(AopUtils.isCglibProxy(ctx.getBean(FooRepository.class))).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void repositoryUsesAspectJAdviceMode() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(Config.class, AspectJTxConfig.class);
|
||||
// this test is a bit fragile, but gets the job done, proving that an
|
||||
// attempt was made to look up the AJ aspect. It's due to classpath issues
|
||||
// in integration-tests that it's not found.
|
||||
assertThatException()
|
||||
.isThrownBy(ctx::refresh)
|
||||
.withMessageContaining("AspectJJtaTransactionManagementConfiguration");
|
||||
}
|
||||
|
||||
@Test
|
||||
void implicitTxManager() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ImplicitTxManagerConfig.class);
|
||||
|
||||
FooRepository fooRepository = ctx.getBean(FooRepository.class);
|
||||
fooRepository.findAll();
|
||||
|
||||
CallCountingTransactionManager txManager = ctx.getBean(CallCountingTransactionManager.class);
|
||||
assertThat(txManager.begun).isEqualTo(1);
|
||||
assertThat(txManager.commits).isEqualTo(1);
|
||||
assertThat(txManager.rollbacks).isEqualTo(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
void explicitTxManager() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ExplicitTxManagerConfig.class);
|
||||
|
||||
FooRepository fooRepository = ctx.getBean(FooRepository.class);
|
||||
fooRepository.findAll();
|
||||
|
||||
CallCountingTransactionManager txManager1 = ctx.getBean("txManager1", CallCountingTransactionManager.class);
|
||||
assertThat(txManager1.begun).isEqualTo(1);
|
||||
assertThat(txManager1.commits).isEqualTo(1);
|
||||
assertThat(txManager1.rollbacks).isEqualTo(0);
|
||||
|
||||
CallCountingTransactionManager txManager2 = ctx.getBean("txManager2", CallCountingTransactionManager.class);
|
||||
assertThat(txManager2.begun).isEqualTo(0);
|
||||
assertThat(txManager2.commits).isEqualTo(0);
|
||||
assertThat(txManager2.rollbacks).isEqualTo(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
void apcEscalation() {
|
||||
new AnnotationConfigApplicationContext(EnableTxAndCachingConfig.class);
|
||||
}
|
||||
|
||||
|
||||
private void assertTxProxying(AnnotationConfigApplicationContext ctx) {
|
||||
FooRepository repo = ctx.getBean(FooRepository.class);
|
||||
assertThat(isTxProxy(repo)).isTrue();
|
||||
// trigger a transaction
|
||||
repo.findAll();
|
||||
}
|
||||
|
||||
private boolean isTxProxy(FooRepository repo) {
|
||||
if (!AopUtils.isAopProxy(repo)) {
|
||||
return false;
|
||||
}
|
||||
return Arrays.stream(((Advised) repo).getAdvisors())
|
||||
.anyMatch(BeanFactoryTransactionAttributeSourceAdvisor.class::isInstance);
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
@ImportResource("org/springframework/transaction/annotation/enable-caching.xml")
|
||||
static class EnableTxAndCachingConfig {
|
||||
|
||||
@Bean
|
||||
public PlatformTransactionManager txManager() {
|
||||
return new CallCountingTransactionManager();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FooRepository fooRepository() {
|
||||
return new DummyFooRepository();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CacheManager cacheManager() {
|
||||
SimpleCacheManager mgr = new SimpleCacheManager();
|
||||
ArrayList<Cache> caches = new ArrayList<>();
|
||||
caches.add(new ConcurrentMapCache(""));
|
||||
mgr.setCaches(caches);
|
||||
return mgr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
static class ImplicitTxManagerConfig {
|
||||
|
||||
@Bean
|
||||
public PlatformTransactionManager txManager() {
|
||||
return new CallCountingTransactionManager();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FooRepository fooRepository() {
|
||||
return new DummyFooRepository();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
static class ExplicitTxManagerConfig implements TransactionManagementConfigurer {
|
||||
|
||||
@Bean
|
||||
public PlatformTransactionManager txManager1() {
|
||||
return new CallCountingTransactionManager();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PlatformTransactionManager txManager2() {
|
||||
return new CallCountingTransactionManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlatformTransactionManager annotationDrivenTransactionManager() {
|
||||
return txManager1();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FooRepository fooRepository() {
|
||||
return new DummyFooRepository();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
static class DefaultTxManagerNameConfig {
|
||||
|
||||
@Bean
|
||||
PlatformTransactionManager transactionManager(DataSource dataSource) {
|
||||
return new DataSourceTransactionManager(dataSource);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
static class CustomTxManagerNameConfig {
|
||||
|
||||
@Bean
|
||||
PlatformTransactionManager txManager(DataSource dataSource) {
|
||||
return new DataSourceTransactionManager(dataSource);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
static class NonConventionalTxManagerNameConfig {
|
||||
|
||||
@Bean
|
||||
PlatformTransactionManager txManager(DataSource dataSource) {
|
||||
return new DataSourceTransactionManager(dataSource);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement(proxyTargetClass=true)
|
||||
static class ProxyTargetClassTxConfig {
|
||||
|
||||
@Bean
|
||||
PlatformTransactionManager transactionManager(DataSource dataSource) {
|
||||
return new DataSourceTransactionManager(dataSource);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement(mode=AdviceMode.ASPECTJ)
|
||||
static class AspectJTxConfig {
|
||||
|
||||
@Bean
|
||||
PlatformTransactionManager transactionManager(DataSource dataSource) {
|
||||
return new DataSourceTransactionManager(dataSource);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Configuration
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
FooRepository fooRepository() {
|
||||
JdbcFooRepository repos = new JdbcFooRepository();
|
||||
repos.setDataSource(dataSource());
|
||||
return repos;
|
||||
}
|
||||
|
||||
@Bean
|
||||
DataSource dataSource() {
|
||||
return new EmbeddedDatabaseBuilder()
|
||||
.setType(EmbeddedDatabaseType.HSQL)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface FooRepository {
|
||||
|
||||
List<Object> findAll();
|
||||
}
|
||||
|
||||
|
||||
@Repository
|
||||
static class JdbcFooRepository implements FooRepository {
|
||||
|
||||
public void setDataSource(DataSource dataSource) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public List<Object> findAll() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Repository
|
||||
static class DummyFooRepository implements FooRepository {
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public List<Object> findAll() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
-129
@@ -1,129 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.transaction.annotation;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Tests proving that regardless the proxy strategy used (JDK interface-based vs. CGLIB
|
||||
* subclass-based), discovery of advice-oriented annotations is consistent.
|
||||
*
|
||||
* For example, Spring's @Transactional may be declared at the interface or class level,
|
||||
* and whether interface or subclass proxies are used, the @Transactional annotation must
|
||||
* be discovered in a consistent fashion.
|
||||
*
|
||||
* @author Chris Beams
|
||||
*/
|
||||
@SuppressWarnings("resource")
|
||||
class ProxyAnnotationDiscoveryTests {
|
||||
|
||||
@Test
|
||||
void annotatedServiceWithoutInterface_PTC_true() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(PTCTrue.class, AnnotatedServiceWithoutInterface.class);
|
||||
ctx.refresh();
|
||||
AnnotatedServiceWithoutInterface s = ctx.getBean(AnnotatedServiceWithoutInterface.class);
|
||||
assertThat(AopUtils.isCglibProxy(s)).isTrue();
|
||||
assertThat(s).isInstanceOf(AnnotatedServiceWithoutInterface.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void annotatedServiceWithoutInterface_PTC_false() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(PTCFalse.class, AnnotatedServiceWithoutInterface.class);
|
||||
ctx.refresh();
|
||||
AnnotatedServiceWithoutInterface s = ctx.getBean(AnnotatedServiceWithoutInterface.class);
|
||||
assertThat(AopUtils.isCglibProxy(s)).isTrue();
|
||||
assertThat(s).isInstanceOf(AnnotatedServiceWithoutInterface.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void nonAnnotatedService_PTC_true() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(PTCTrue.class, AnnotatedServiceImpl.class);
|
||||
ctx.refresh();
|
||||
NonAnnotatedService s = ctx.getBean(NonAnnotatedService.class);
|
||||
assertThat(AopUtils.isCglibProxy(s)).isTrue();
|
||||
assertThat(s).isInstanceOf(AnnotatedServiceImpl.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void nonAnnotatedService_PTC_false() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(PTCFalse.class, AnnotatedServiceImpl.class);
|
||||
ctx.refresh();
|
||||
NonAnnotatedService s = ctx.getBean(NonAnnotatedService.class);
|
||||
assertThat(AopUtils.isJdkDynamicProxy(s)).isTrue();
|
||||
assertThat(s).isNotInstanceOf(AnnotatedServiceImpl.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void annotatedService_PTC_true() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(PTCTrue.class, NonAnnotatedServiceImpl.class);
|
||||
ctx.refresh();
|
||||
AnnotatedService s = ctx.getBean(AnnotatedService.class);
|
||||
assertThat(AopUtils.isCglibProxy(s)).isTrue();
|
||||
assertThat(s).isInstanceOf(NonAnnotatedServiceImpl.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void annotatedService_PTC_false() {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
ctx.register(PTCFalse.class, NonAnnotatedServiceImpl.class);
|
||||
ctx.refresh();
|
||||
AnnotatedService s = ctx.getBean(AnnotatedService.class);
|
||||
assertThat(AopUtils.isJdkDynamicProxy(s)).isTrue();
|
||||
assertThat(s).isNotInstanceOf(NonAnnotatedServiceImpl.class);
|
||||
}
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement(proxyTargetClass=false)
|
||||
class PTCFalse { }
|
||||
|
||||
@Configuration
|
||||
@EnableTransactionManagement(proxyTargetClass=true)
|
||||
class PTCTrue { }
|
||||
|
||||
interface NonAnnotatedService {
|
||||
void m();
|
||||
}
|
||||
|
||||
interface AnnotatedService {
|
||||
@Transactional void m();
|
||||
}
|
||||
|
||||
class NonAnnotatedServiceImpl implements AnnotatedService {
|
||||
@Override
|
||||
public void m() { }
|
||||
}
|
||||
|
||||
class AnnotatedServiceImpl implements NonAnnotatedService {
|
||||
@Override
|
||||
@Transactional public void m() { }
|
||||
}
|
||||
|
||||
class AnnotatedServiceWithoutInterface {
|
||||
@Transactional public void m() { }
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
http\://www.foo.example/schema/component=org.springframework.beans.factory.xml.ComponentNamespaceHandler
|
||||
@@ -1 +0,0 @@
|
||||
http\://www.foo.example/schema/component/component.xsd=org/springframework/beans/factory/xml/component.xsd
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="WARN">
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{1.} - %msg%n" />
|
||||
</Console>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="debug">
|
||||
<AppenderRef ref="Console" />
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop.xsd">
|
||||
|
||||
<bean id="echo" class="org.springframework.aop.config.AopNamespaceHandlerAdviceOrderIntegrationTests$Echo"/>
|
||||
|
||||
<bean id="invocationTrackingAspect" class="org.springframework.aop.config.AopNamespaceHandlerAdviceOrderIntegrationTests$InvocationTrackingAspect" />
|
||||
|
||||
<aop:config>
|
||||
<aop:aspect id="echoAdvice" ref="invocationTrackingAspect">
|
||||
<aop:pointcut id="echoMethod" expression="execution(* echo(*))" />
|
||||
<aop:around method="around" pointcut-ref="echoMethod" />
|
||||
<aop:before method="before" pointcut-ref="echoMethod" />
|
||||
<aop:after method="after" pointcut-ref="echoMethod" />
|
||||
<aop:after-throwing method="afterThrowing" pointcut-ref="echoMethod" />
|
||||
<aop:after-returning method="afterReturning" pointcut-ref="echoMethod" />
|
||||
</aop:aspect>
|
||||
</aop:config>
|
||||
|
||||
</beans>
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop.xsd">
|
||||
|
||||
<bean id="echo" class="org.springframework.aop.config.AopNamespaceHandlerAdviceOrderIntegrationTests$Echo"/>
|
||||
|
||||
<bean id="invocationTrackingAspect" class="org.springframework.aop.config.AopNamespaceHandlerAdviceOrderIntegrationTests$InvocationTrackingAspect" />
|
||||
|
||||
<aop:config>
|
||||
<aop:aspect id="echoAdvice" ref="invocationTrackingAspect">
|
||||
<aop:pointcut id="echoMethod" expression="execution(* echo(*))" />
|
||||
<aop:around method="around" pointcut-ref="echoMethod" />
|
||||
<aop:before method="before" pointcut-ref="echoMethod" />
|
||||
<aop:after-throwing method="afterThrowing" pointcut-ref="echoMethod" />
|
||||
<aop:after-returning method="afterReturning" pointcut-ref="echoMethod" />
|
||||
<aop:after method="after" pointcut-ref="echoMethod" />
|
||||
</aop:aspect>
|
||||
</aop:config>
|
||||
|
||||
</beans>
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
|
||||
|
||||
<aop:config>
|
||||
<aop:advisor advice-ref="advice" pointcut="execution(* *..ITestBean.*(..))"/>
|
||||
</aop:config>
|
||||
|
||||
<bean id="advice" class="org.springframework.aop.interceptor.DebugInterceptor"/>
|
||||
|
||||
<bean id="testBean" class="org.springframework.beans.testfixture.beans.TestBean"/>
|
||||
|
||||
<bean id="singletonScoped" class="org.springframework.beans.testfixture.beans.TestBean">
|
||||
<aop:scoped-proxy/>
|
||||
<property name="name" value="Rob Harrop"/>
|
||||
</bean>
|
||||
|
||||
<bean id="requestScoped" class="org.springframework.beans.testfixture.beans.TestBean" scope="request">
|
||||
<aop:scoped-proxy/>
|
||||
<property name="name" value="Rob Harrop"/>
|
||||
</bean>
|
||||
|
||||
<bean id="sessionScoped" name="sessionScopedAlias" class="org.springframework.beans.testfixture.beans.TestBean" scope="session">
|
||||
<aop:scoped-proxy proxy-target-class="false"/>
|
||||
<property name="name" value="Rob Harrop"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user