diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..e96ed9af78 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,27 @@ +--- +name: Bug report +about: Create a bug report to help us improve the project +title: '' +labels: 'type: bug, status: waiting-for-triage' +assignees: '' + +--- + +Please do a quick search on Github issues first, there might be already a duplicate issue for the one you are about to create. +If the bug is trivial, just go ahead and create the issue. Otherwise, please take a few moments and fill in the following sections: + +**Bug description** +A clear and concise description of what the bug is about. + +**Environment** +Please provide as many details as possible: Spring Batch version, Java version, which database you use if any, etc + +**Steps to reproduce** +Steps to reproduce the issue. + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Minimal Complete Reproducible example** +Please provide a failing test or a [minimal complete verifiable example](https://github.com/spring-projects/spring-batch/blob/main/ISSUE_REPORTING.md) that reproduces the issue. +Bug reports that are reproducible will take priority in resolution over reports that are not reproducible. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..804bb17fb4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Questions and Community Support + url: https://stackoverflow.com/questions/tagged/spring-batch + about: Please ask and answer questions on StackOverflow with the spring-batch tag diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..0f32f34d21 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,27 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: 'status: waiting-for-triage, type: feature' +assignees: '' + +--- + +Please do a quick search on Github issues first, the feature you are about to request might have already been requested. + +**Expected Behavior** + + + +**Current Behavior** + + + +**Context** + + diff --git a/.github/ISSUE_TEMPLATE/miscellaneous.md b/.github/ISSUE_TEMPLATE/miscellaneous.md new file mode 100644 index 0000000000..f523d84375 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/miscellaneous.md @@ -0,0 +1,17 @@ +--- +name: Miscellaneous +about: Suggest an improvement for this project +title: '' +labels: 'status: waiting-for-triage' +assignees: '' + +--- + +For anything other than bug reports and feature requests (performance, refactoring, etc), +just go ahead and file the issue. Please provide as many details as possible. + +If you have a question or a support request, please open a new discussion on [GitHub Discussions](https://github.com/spring-projects/spring-batch/discussions) +or ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/spring-batch). + +Please do **not** create issues on the [Issue Tracker](https://github.com/spring-projects/spring-batch/issues) for questions or support requests. +We would like to keep the issue tracker **exclusively** for bug reports and feature requests. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..30f58a8110 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,12 @@ +Thank you for taking time to contribute this pull request! +You might have already read the [contributor guide][1], but as a reminder, please make sure to: + +* Rebase your changes on the latest `main` branch and squash your commits +* Add/Update unit tests as needed +* Run a build and make sure all tests pass prior to submission +* Sign-off commits according to the [Developer Certificate of Origin](https://spring.io/blog/2025/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring) + +For more details, please check the [contributor guide][1]. +Thank you upfront! + +[1]: https://github.com/spring-projects/spring-batch/blob/main/CONTRIBUTING.md \ No newline at end of file diff --git a/.github/dco.yml b/.github/dco.yml new file mode 100644 index 0000000000..0c4b142e9a --- /dev/null +++ b/.github/dco.yml @@ -0,0 +1,2 @@ +require: + members: false diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..2ec064e090 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + labels: + - "type: task" + - package-ecosystem: "github-actions" + target-branch: "5.2.x" + directory: "/" + schedule: + interval: "weekly" + labels: + - "type: task" diff --git a/.github/extension-release-files-spec.json b/.github/extension-release-files-spec.json new file mode 100644 index 0000000000..09c8681d69 --- /dev/null +++ b/.github/extension-release-files-spec.json @@ -0,0 +1,18 @@ +{ + "files": [ + { + "aql": { + "items.find": { + "$and": [ + { + "@build.name": "${buildname}", + "@build.number": "${buildnumber}", + "path": { "$match": "org/springframework/batch/extensions/spring-batch-*" } + } + ] + } + }, + "target": "nexus/" + } + ] +} diff --git a/.github/release-files-spec.json b/.github/release-files-spec.json new file mode 100644 index 0000000000..1d071702fc --- /dev/null +++ b/.github/release-files-spec.json @@ -0,0 +1,18 @@ +{ + "files": [ + { + "aql": { + "items.find": { + "$and": [ + { + "@build.name": "${buildname}", + "@build.number": "${buildnumber}", + "path": { "$match": "org/springframework/batch/spring-batch-*" } + } + ] + } + }, + "target": "nexus/" + } + ] +} diff --git a/.github/workflows/artifactory-staging.yml b/.github/workflows/artifactory-staging.yml new file mode 100644 index 0000000000..0c91e4c53d --- /dev/null +++ b/.github/workflows/artifactory-staging.yml @@ -0,0 +1,44 @@ +name: Artifactory Staging + +on: + workflow_dispatch: + inputs: + releaseVersion: + description: "Release version" + required: true + +jobs: + build: + name: Stage release to Artifactory + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v4.2.2 + + - name: Set up JDK 25 + uses: actions/setup-java@v5 + with: + java-version: '25' + distribution: 'temurin' + cache: 'maven' + + - name: Update release version + run: mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.releaseVersion }} + + - name: Enforce release rules + run: mvn org.apache.maven.plugins:maven-enforcer-plugin:enforce -Drules=requireReleaseDeps + + - name: Build with Maven + run: mvn -DaltDeploymentRepository=local::file:deployment-repository --no-transfer-progress --batch-mode -Dmaven.test.skip=true deploy + + - name: Deploy to Artifactory + uses: spring-io/artifactory-deploy-action@v0.0.2 + with: + uri: 'https://repo.spring.io' + username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} + build-name: 'spring-batch-${{ github.event.inputs.releaseVersion }}' + repository: 'libs-staging-local' + folder: 'deployment-repository' + signing-key: ${{ secrets.GPG_PRIVATE_KEY }} + signing-passphrase: ${{ secrets.GPG_PASSPHRASE }} diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 0000000000..f010d79042 --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,34 @@ +name: CI/CD build + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + name: Build main branch + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v4.2.2 + + - name: Set up JDK 25 + uses: actions/setup-java@v5 + with: + java-version: '25' + distribution: 'temurin' + cache: 'maven' + + - name: Build with Maven + run: mvn -DaltDeploymentRepository=local::file:deployment-repository --no-transfer-progress --batch-mode --update-snapshots deploy + + - name: Deploy to Artifactory + if: ${{ github.repository == 'spring-projects/spring-batch' && github.ref_name == 'main' }} + uses: spring-io/artifactory-deploy-action@v0.0.2 + with: + uri: 'https://repo.spring.io' + username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} + build-name: 'spring-batch-main' + repository: 'libs-snapshot-local' + folder: 'deployment-repository' + signing-key: ${{ secrets.GPG_PRIVATE_KEY }} + signing-passphrase: ${{ secrets.GPG_PASSPHRASE }} diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000000..4af2314b75 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,30 @@ +name: Deploy Docs +on: + push: + branches-ignore: [ gh-pages ] + tags: '**' + repository_dispatch: + types: request-build-reference # legacy + workflow_dispatch: +permissions: + actions: write +jobs: + build: + runs-on: ubuntu-latest + if: github.repository_owner == 'spring-projects' + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: docs-build + fetch-depth: 1 + - name: Dispatch (partial build) + if: github.ref_type == 'branch' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }} + - name: Dispatch (full build) + if: github.ref_type == 'tag' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) diff --git a/.github/workflows/documentation-upload.yml b/.github/workflows/documentation-upload.yml new file mode 100644 index 0000000000..5b41e95d86 --- /dev/null +++ b/.github/workflows/documentation-upload.yml @@ -0,0 +1,65 @@ +name: Documentation Upload (5.2.x) + +on: + workflow_dispatch: + inputs: + releaseVersion: + description: "Release version (5.2.x)" + required: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: Capture release version + run: echo RELEASE_VERSION=${{ github.event.inputs.releaseVersion }} >> $GITHUB_ENV + + - name: Checkout source code + uses: actions/checkout@v3 + with: + ref: '5.2.x' + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + + - name: Update release version + run: mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION + + - name: Generate Java docs + run: mvn javadoc:aggregate + + - name: Generate Assembly + working-directory: spring-batch-docs + run: mvn assembly:single + + - name: Setup SSH key + env: + DOCS_SSH_KEY: ${{ secrets.DOCS_SSH_KEY }} + DOCS_SSH_HOST_KEY: ${{ secrets.DOCS_SSH_HOST_KEY }} + run: | + mkdir "$HOME/.ssh" + echo "$DOCS_SSH_KEY" > "$HOME/.ssh/key" + chmod 600 "$HOME/.ssh/key" + echo "$DOCS_SSH_HOST_KEY" > "$HOME/.ssh/known_hosts" + + - name: Deploy Java docs and xsd schemas + env: + DOCS_HOST: ${{ secrets.DOCS_HOST }} + DOCS_PATH: ${{ secrets.DOCS_PATH }} + DOCS_USERNAME: ${{ secrets.DOCS_USERNAME }} + BATCH_SCHEMA_PATH: ${{ secrets.BATCH_SCHEMA_PATH }} + INTEGRATION_SCHEMA_PATH: ${{ secrets.INTEGRATION_SCHEMA_PATH }} + working-directory: spring-batch-docs/target + run: | + unzip spring-batch-$RELEASE_VERSION-javadocs.zip + ssh -i $HOME/.ssh/key $DOCS_USERNAME@$DOCS_HOST "cd $DOCS_PATH && mkdir -p $RELEASE_VERSION" + scp -i $HOME/.ssh/key -r api $DOCS_USERNAME@$DOCS_HOST:$DOCS_PATH/$RELEASE_VERSION + + unzip spring-batch-$RELEASE_VERSION-schemas.zip + scp -i $HOME/.ssh/key batch/*.xsd $DOCS_USERNAME@$DOCS_HOST:$BATCH_SCHEMA_PATH + scp -i $HOME/.ssh/key batch-integration/*.xsd $DOCS_USERNAME@$DOCS_HOST:$INTEGRATION_SCHEMA_PATH diff --git a/.github/workflows/extension-build.yml b/.github/workflows/extension-build.yml new file mode 100644 index 0000000000..a3034dfb00 --- /dev/null +++ b/.github/workflows/extension-build.yml @@ -0,0 +1,43 @@ +name: Spring Batch Extension Build + +on: + workflow_dispatch: + inputs: + extension: + description: "Extension name" + required: true + type: choice + options: + - spring-batch-bigquery + - spring-batch-excel + - spring-batch-elasticsearch + - spring-batch-neo4j + - spring-batch-notion + javaVersion: + description: "Java version" + required: true + type: choice + options: + - '17' + - '25' + +jobs: + build: + name: Build an extension + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + repository: 'spring-projects/spring-batch-extensions' + ref: 'main' + + - name: Set up JDK ${{ github.event.inputs.javaVersion }} + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 + with: + java-version: '${{ github.event.inputs.javaVersion }}' + distribution: 'temurin' + + - name: Build extension with Maven + run: mvn -B package --file pom.xml + working-directory: ${{ github.event.inputs.extension }} diff --git a/.github/workflows/extension-release.yml b/.github/workflows/extension-release.yml new file mode 100644 index 0000000000..8c75d5f85a --- /dev/null +++ b/.github/workflows/extension-release.yml @@ -0,0 +1,32 @@ +name: Maven Central Extension Release + +on: + workflow_dispatch: + inputs: + buildName: + description: "Artifactory build name" + required: true + buildNumber: + description: "Artifactory build number" + required: true + +jobs: + + release: + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v4.2.2 + - name: Set Up JFrog CLI + uses: jfrog/setup-jfrog-cli@9fe0f98bd45b19e6e931d457f4e98f8f84461fb5 # v4.4.1 + env: + JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} + - name: Download Release Artifacts + shell: bash + run: jf rt download --spec .github/extension-release-files-spec.json --spec-vars 'buildname=${{ github.event.inputs.buildName }};buildnumber=${{ github.event.inputs.buildNumber }}' + - name: Sync to Maven Central + uses: spring-io/central-publish-action@0cdd90d12e6876341e82860d951e1bcddc1e51b6 # v0.2.0 + with: + token-name: ${{ secrets.CENTRAL_TOKEN_USERNAME }} + token: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} + timeout: 120m diff --git a/.github/workflows/extension-staging.yml b/.github/workflows/extension-staging.yml new file mode 100644 index 0000000000..3eb51cb092 --- /dev/null +++ b/.github/workflows/extension-staging.yml @@ -0,0 +1,66 @@ +name: Spring Batch Extension Stage + +on: + workflow_dispatch: + inputs: + extension: + description: "Extension name" + required: true + type: choice + options: + - spring-batch-bigquery + - spring-batch-excel + - spring-batch-elasticsearch + - spring-batch-neo4j + - spring-batch-notion + releaseVersion: + description: "Release version" + required: true + javaVersion: + description: "Java version" + required: true + type: choice + options: + - '17' + - '25' + +jobs: + build: + name: Build an extension + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + repository: 'spring-projects/spring-batch-extensions' + ref: 'main' + + - name: Set up JDK ${{ github.event.inputs.javaVersion }} + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 + with: + java-version: '${{ github.event.inputs.javaVersion }}' + distribution: 'temurin' + + - name: Update release version + run: ./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.releaseVersion }} + working-directory: ${{ github.event.inputs.extension }} + + - name: Enforce release rules + run: ./mvnw org.apache.maven.plugins:maven-enforcer-plugin:enforce -Drules=requireReleaseDeps + working-directory: ${{ github.event.inputs.extension }} + + - name: Build with Maven + run: ./mvnw -DaltDeploymentRepository=local::file:deployment-repository --no-transfer-progress --batch-mode -Dmaven.test.skip=true deploy + working-directory: ${{ github.event.inputs.extension }} + + - name: Deploy to Artifactory + uses: spring-io/artifactory-deploy-action@v0.0.2 + with: + uri: 'https://repo.spring.io' + username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} + build-name: '${{ github.event.inputs.extension }}-${{ github.event.inputs.releaseVersion }}' + repository: 'libs-staging-local' + folder: '${{ github.event.inputs.extension }}/deployment-repository' + signing-key: ${{ secrets.GPG_PRIVATE_KEY }} + signing-passphrase: ${{ secrets.GPG_PASSPHRASE }} diff --git a/.github/workflows/maven-central-release.yml b/.github/workflows/maven-central-release.yml new file mode 100644 index 0000000000..7edd73794f --- /dev/null +++ b/.github/workflows/maven-central-release.yml @@ -0,0 +1,32 @@ +name: Maven Central Release + +on: + workflow_dispatch: + inputs: + buildName: + description: "Artifactory build name" + required: true + buildNumber: + description: "Artifactory build number" + required: true + +jobs: + + release: + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@v4.2.2 + - name: Set Up JFrog CLI + uses: jfrog/setup-jfrog-cli@9fe0f98bd45b19e6e931d457f4e98f8f84461fb5 # v4.4.1 + env: + JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }} + - name: Download Release Artifacts + shell: bash + run: jf rt download --spec .github/release-files-spec.json --spec-vars 'buildname=${{ github.event.inputs.buildName }};buildnumber=${{ github.event.inputs.buildNumber }}' + - name: Sync to Maven Central + uses: spring-io/central-publish-action@0cdd90d12e6876341e82860d951e1bcddc1e51b6 # v0.2.0 + with: + token-name: ${{ secrets.CENTRAL_TOKEN_USERNAME }} + token: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} + timeout: 120m diff --git a/.github/workflows/release-notes-generation.yml b/.github/workflows/release-notes-generation.yml new file mode 100644 index 0000000000..f063874e23 --- /dev/null +++ b/.github/workflows/release-notes-generation.yml @@ -0,0 +1,54 @@ +name: Generate Release notes + +on: + workflow_dispatch: + inputs: + milestoneNumber: + description: "Milestone title" + required: true + generatorVersion: + description: "Changelog Generator version" + required: true + +jobs: + build: + name: Generate release notes + runs-on: ubuntu-latest + steps: + - name: Capture milestone number and generator version + run: | + echo MILESTONE_NUMBER=${{ github.event.inputs.milestoneNumber }} >> $GITHUB_ENV + echo GENERATOR_VERSION=${{ github.event.inputs.generatorVersion }} >> $GITHUB_ENV + + - name: Download changelog generator + run: wget https://github.com/spring-io/github-changelog-generator/releases/download/v$GENERATOR_VERSION/github-changelog-generator.jar + + - name: Set up JDK 25 + uses: actions/setup-java@v5 + with: + java-version: '25' + distribution: 'temurin' + + - name: Prepare configuration file + run: | + cat << EOF > application.yml + changelog: + repository: spring-projects/spring-batch + sections: + - title: ":star: New features" + labels: [ "type: feature" ] + - title: ":rocket: Enhancements" + labels: [ "type: enhancement" ] + - title: ":lady_beetle: Bug fixes" + labels: [ "type: bug" ] + - title: ":notebook_with_decorative_cover: Documentation" + labels: [ "in: documentation" ] + - title: ":hammer: Tasks" + labels: [ "type: task" ] + EOF + + - name: Generate release notes + run: java -jar github-changelog-generator.jar $MILESTONE_NUMBER release-notes.md + + - name: Print release notes + run: cat release-notes.md diff --git a/.github/workflows/tag-release-next-dev-version.yml b/.github/workflows/tag-release-next-dev-version.yml new file mode 100644 index 0000000000..b5a64b2f09 --- /dev/null +++ b/.github/workflows/tag-release-next-dev-version.yml @@ -0,0 +1,51 @@ +name: Tag release and move to next development version + +on: + workflow_dispatch: + inputs: + releaseVersion: + description: "Release version" + required: true + snapshotVersion: + description: "Next snapshot version" + required: true + +jobs: + + release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout source code + uses: actions/checkout@v4.2.2 + + - name: Set up JDK 25 + uses: actions/setup-java@v5 + with: + java-version: '25' + distribution: 'temurin' + cache: 'maven' + + - name: Set up git + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + + - name: Capture versions + run: | + echo RELEASE_VERSION=${{ github.event.inputs.releaseVersion }} >> $GITHUB_ENV + echo SNAPSHOT_VERSION=${{ github.event.inputs.snapshotVersion }} >> $GITHUB_ENV + + - name: Tag release + run: | + ./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION + git commit -a -m "Release version $RELEASE_VERSION" + git tag -a v$RELEASE_VERSION -m "Release version $RELEASE_VERSION" + git push origin v$RELEASE_VERSION + + - name: Move to next development version + run: | + ./mvnw versions:set -DgenerateBackupPoms=false -DnewVersion=$SNAPSHOT_VERSION + git commit -a -m "Next development version" + git push origin main \ No newline at end of file diff --git a/.gitignore b/.gitignore index 97b1d8a064..9bbf879575 100644 --- a/.gitignore +++ b/.gitignore @@ -10,10 +10,10 @@ spring-build derby-home derbydb derby.log -derbydb com.springsource.sts.config.flow.prefs s3.properties -.idea +.idea/* +!/.idea/icon.svg *.iml *.ipr *.iws @@ -22,7 +22,11 @@ s3.properties .springBeans build .gradle -pom.xml out /.gradletasknamecache +**/*.flattened-pom.xml + +node +node_modules +package-lock.json diff --git a/.idea/icon.svg b/.idea/icon.svg new file mode 100644 index 0000000000..3ad7681541 --- /dev/null +++ b/.idea/icon.svg @@ -0,0 +1 @@ +logo-batch \ No newline at end of file diff --git a/.mvn/jvm.config b/.mvn/jvm.config new file mode 100644 index 0000000000..32599cefea --- /dev/null +++ b/.mvn/jvm.config @@ -0,0 +1,10 @@ +--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED +--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED +--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED +--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000000..bf82ff01c6 Binary files /dev/null and b/.mvn/wrapper/maven-wrapper.jar differ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000000..783c844447 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar diff --git a/CODE_OF_CONDUCT.adoc b/CODE_OF_CONDUCT.adoc deleted file mode 100644 index 795a9624eb..0000000000 --- a/CODE_OF_CONDUCT.adoc +++ /dev/null @@ -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 -http://contributor-covenant.org[Contributor Covenant], version 1.3.0, available at -http://contributor-covenant.org/version/1/3/0/[contributor-covenant.org/version/1/3/0/] \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 01b5e9d727..c6ad7d3a70 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,30 +1,44 @@ Contributor Guidelines ====================== -Have something you'd like to contribute to **Spring Batch**? We welcome pull requests, but ask that you carefully read this document first to understand how best to submit them; what kind of changes are likely to be accepted; and what to expect from the Spring team when evaluating your submission. +Have something you'd like to contribute to Spring Batch? We welcome pull requests, but ask that you carefully read this document +first to understand how best to submit them; what kind of changes are likely to be accepted; and what to expect from the Spring Batch +team when evaluating your submission. Please refer back to this document as a checklist before issuing any pull request; this will save time for everyone! -## Understand the basics +## Code of Conduct -Not sure what a *pull request* is, or how to submit one? Take a look at GitHub's excellent [help documentation][] first. +Please see our [code of conduct](https://github.com/spring-projects/.github/blob/main/CODE_OF_CONDUCT.md). -## Search JIRA first; create an issue if necessary +## Reporting Security Vulnerabilities -Is there already an issue that addresses your concern? Do a bit of searching in our [JIRA issue tracker][] to see if you can find something similar. If not, please create a new issue before submitting a pull request unless the change is truly trivial, e.g. typo fixes, removing compiler warnings, etc. +Please see our [Security policy](https://github.com/spring-projects/spring-batch/security/policy). -## Sign the contributor license agreement +## Reporting issues -If you have not previously done so, please fill out and -submit the [Contributor License Agreement](https://cla.pivotal.io/sign/spring). +Before opening an issue, please do a quick search in [Github issues][] to see if you can find something similar. +If not, please read the [Issue Reporting](https://github.com/spring-projects/spring-batch/blob/main/ISSUE_REPORTING.md) section for more details +about how to report issues. -## Fork the Repository +## Contributing through Pull Requests on GitHub + +Not sure what a *pull request* is, or how to submit one? Take a look at the excellent [GitHub help documentation][] first. +Please create a new issue *before* submitting a pull request unless the change is truly trivial, e.g. typo fixes, removing compiler warnings, etc. + +### Sign-off commits according to the Developer Certificate of Origin + +All commits must include a Signed-off-by trailer at the end of each commit message to indicate that the contributor agrees to the [Developer Certificate of Origin](https://developercertificate.org). + +For additional details, please refer to the blog post [Hello DCO, Goodbye CLA: Simplifying Contributions to Spring](https://spring.io/blog/2025/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring). + +### Fork the Repository 1. Go to [https://github.com/spring-projects/spring-batch](https://github.com/spring-projects/spring-batch) 2. Hit the "fork" button and choose your own github account as the target -3. For more details see [http://help.github.com/fork-a-repo/](http://help.github.com/fork-a-repo/) +3. For more details see [https://docs.github.com/en/get-started/quickstart/fork-a-repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo) -## Setup your Local Development Environment +### Setup your Local Development Environment 1. `git clone git@github.com:/spring-batch.git` 2. `cd spring-batch` @@ -32,44 +46,44 @@ submit the [Contributor License Agreement](https://cla.pivotal.io/sign/spring). _you should see only 'origin' - which is the fork you created for your own github account_ 4. `git remote add upstream git@github.com:spring-projects/spring-batch.git` 5. `git remote show` -_you should now see 'upstream' in addition to 'origin' where 'upstream' is the *spring-projects*repository from which releases are built_ +_you should now see 'upstream' in addition to 'origin' where 'upstream' is the *spring-projects* repository from which releases are built_ 6. `git fetch --all` 7. `git branch -a` -_you should see branches on origin as well as upstream, including 'master'_ +_you should see branches on origin as well as upstream, including 'main'_ -## A Day in the Life of a Contributor +### A Day in the Life of a Contributor -* _Always_ work on topic branches (Typically use the Jira ticket ID as the branch name). - - For example, to create and switch to a new branch for issue BATCH-123: `git checkout -b BATCH-123` +* _Always_ work on topic branches (Typically use the Github issue ID as the branch name). + - For example, to create and switch to a new branch for issue GH-123: `git checkout -b GH-123` * You might be working on several different topic branches at any given time, but when at a stopping point for one of those branches, commit (a local operation). * Please follow the "Commit Guidelines" described in this chapter of Pro Git: [https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project](https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines) -* Then to begin working on another issue (say BATCH-101): `git checkout BATCH-101`. The _-b_ flag is not needed if that branch already exists in your local repository. -* When ready to resolve an issue or to collaborate with others, you can push your branch to origin (your fork), e.g.: `git push origin BATCH-123` +* Then to begin working on another issue (say GH-101): `git checkout GH-101`. The _-b_ flag is not needed if that branch already exists in your local repository. +* When ready to resolve an issue or to collaborate with others, you can push your branch to origin (your fork), e.g.: `git push origin GH-123` * If you want to collaborate with another contributor, have them fork your repository (add it as a remote) and `git fetch ` to grab your branch. Alternatively, they can use `git fetch --all` to sync their local state with all of their remotes. * If you grant that collaborator push access to your repository, they can even apply their changes to your branch. -* When ready for your contribution to be reviewed for potential inclusion in the master branch of the canonical *spring-batch* repository (what you know as 'upstream'), issue a pull request to the *spring-projects* repository (for more detail, see [http://help.github.com/send-pull-requests/](http://help.github.com/send-pull-requests/)). -* The project lead may merge your changes into the upstream master branch as-is, he may keep the pull request open yet add a comment about something that should be modified, or he might reject the pull request by closing it. -* A prerequisite for any pull request is that it will be cleanly merge-able with the upstream master's current state. **This is the responsibility of any contributor.** If your pull request cannot be applied cleanly, the project lead will most likely add a comment requesting that you make it merge-able. For a full explanation, see the Pro Git section on rebasing: [https://git-scm.com/book/en/v2/Git-Branching-Rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing). As stated there: "> Often, you’ll do this to make sure your commits apply cleanly on a remote branch — perhaps in a project to which you’re trying to contribute but that you don’t maintain." +* When ready for your contribution to be reviewed for potential inclusion in the main branch of the canonical *spring-batch* repository (what you know as 'upstream'), issue a pull request to the *spring-projects* repository (for more detail, see [GitHub help documentation][]). +* The project lead may merge your changes into the upstream main branch as-is, he may keep the pull request open yet add a comment about something that should be modified, or he might reject the pull request by closing it. +* A prerequisite for any pull request is that it will be cleanly merge-able with the upstream main's current state. **This is the responsibility of any contributor.** If your pull request cannot be applied cleanly, the project lead will most likely add a comment requesting that you make it merge-able. For a full explanation, see the Pro Git section on rebasing: [https://git-scm.com/book/en/v2/Git-Branching-Rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing). As stated there: "> Often, you’ll do this to make sure your commits apply cleanly on a remote branch — perhaps in a project to which you’re trying to contribute but that you don’t maintain." ## Keeping your Local Code in Sync -* As mentioned above, you should always work on topic branches (since 'master' is a moving target). However, you do want to always keep your own 'origin' master branch in synch with the 'upstream' master. +* As mentioned above, you should always work on topic branches (since 'main' is a moving target). However, you do want to always keep your own 'origin' main branch in synch with the 'upstream' main. * Within your local working directory, you can sync up all remotes' branches with: `git fetch --all` -* While on your own local master branch: `git pull upstream master` (which is the equivalent of fetching upstream/master and merging that into the branch you are in currently) -* Now that you're in synch, switch to the topic branch where you plan to work, e.g.: `git checkout -b BATCH-123` +* While on your own local main branch: `git pull upstream main` (which is the equivalent of fetching upstream/main and merging that into the branch you are in currently) +* Now that you're in sync, switch to the topic branch where you plan to work, e.g.: `git checkout -b GH-123` * When you get to a stopping point: `git commit` -* If changes have occurred on the upstream/master while you were working you can synch again: - - Switch back to master: `git checkout master` - - Then: `git pull upstream master` - - Switch back to the topic branch: `git checkout BATCH-123` (no -b needed since the branch already exists) - - Rebase the topic branch to minimize the distance between it and your recently synched master branch: `git rebase master` +* If changes have occurred on the upstream/main while you were working you can synch again: + - Switch back to main: `git checkout main` + - Then: `git pull upstream main` + - Switch back to the topic branch: `git checkout GH-123` (no -b needed since the branch already exists) + - Rebase the topic branch to minimize the distance between it and your recently synched main branch: `git rebase main` (Again, for more detail see the Pro Git section on rebasing: [https://git-scm.com/book/en/v2/Git-Branching-Rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing)) -* **Note** You cannot rebase if you have already pushed your branch to your remote because you'd be rewriting history (see **'The Perils of Rebasing'** in the article). If you rebase by mistake, you can undo it as discussed [in this stackoverflow discussion](http://stackoverflow.com/questions/134882/undoing-a-git-rebase). Once you have published your branch, you need to merge in the master rather than rebasing. +* **Note** You cannot rebase if you have already pushed your branch to your remote because you'd be rewriting history (see **'The Perils of Rebasing'** in the article). If you rebase by mistake, you can undo it as discussed [in this stackoverflow discussion](https://stackoverflow.com/questions/134882/undoing-a-git-rebase). Once you have published your branch, you need to merge in the main rather than rebasing. * Now, if you issue a pull request, it is much more likely to be merged without conflicts. Most likely, any pull request that would produce conflicts will be deferred until the issuer of that pull request makes these adjustments. -* Assuming your pull request is merged into the 'upstream' master, you will actually end up pulling that change into your own master eventually, and at that time, you may decide to delete the topic branch from your local repository and your fork (origin) if you pushed it there. - - to delete the local branch: `git branch -d BATCH-123` - - to delete the branch from your origin: `git push origin :BATCH-123` +* Assuming your pull request is merged into the 'upstream' main, you will actually end up pulling that change into your own main eventually, and at that time, you may decide to delete the topic branch from your local repository and your fork (origin) if you pushed it there. + - to delete the local branch: `git branch -d GH-123` + - to delete the branch from your origin: `git push origin :GH-123` -## Maintain a linear commit history +### Maintain a linear commit history When issuing pull requests, please ensure that your commit history is linear. From the command line you can check this using: @@ -86,20 +100,20 @@ git config --global alias.logg 'log --graph --pretty=oneline' This command, will provide the following output, which in this case shows a nice linear history: ```` -* e1f6de38e04a5227fea2d4df193a5b50beaf2d00 BATCH-2002: Initial support for complex conditional replacements +* e1f6de38e04a5227fea2d4df193a5b50beaf2d00 GH-2002: Initial support for complex conditional replacements * 65d2df652abaae2ca309d96e3026c2d67312655f Add ability to set a custom TaskExecutor impl, remove unused namespaces from JSR bootst * 85807568575c24d8878ad605a344f2bc35bb2b13 Update to allow restart parameters to override previous parameters in JsrJobOperator an -* a21df75ce9dfc92e9768353b827da4248aefe425 BATCH-2049: Support multiple fragmentRootElementNames in StaxEventItemReader +* a21df75ce9dfc92e9768353b827da4248aefe425 GH-2049: Support multiple fragmentRootElementNames in StaxEventItemReader * 7f1130c9a265a3ce18a46cbbc122e6573167a036 Fix TCK test JobOperatorTests.testJobOperatorRestartJobAlreadyAbandoned * c4231c4cc861bbcc43437c80a03ddd9b7b2897a3 Fixed no executions returned check and added a unit test ```` -If you see intersecting lines, that usually means that you forgot to rebase you branch. As mentioned earlier, **please rebase against master** before issuing a pull request. +If you see intersecting lines, that usually means that you forgot to rebase you branch. As mentioned earlier, **please rebase against main** before issuing a pull request. -## Code style +### Code style Please carefully follow the same [code style as Spring Framework](https://github.com/spring-projects/spring-framework/wiki/Code-Style). -## Add Apache license header to all new classes +### Add Apache license header to all new classes ```java /* @@ -109,7 +123,7 @@ Please carefully follow the same [code style as Spring Framework](https://github * 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 + * 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, @@ -121,7 +135,7 @@ Please carefully follow the same [code style as Spring Framework](https://github package ...; ``` -## Update license header to modified files as necessary +### Update license header to modified files as necessary Always check the date range in the Apache license header. For example, if you've modified a file in 2013 whose header still reads @@ -135,7 +149,7 @@ then be sure to update it to 2013 appropriately * Copyright 2002-2013 the original author or authors. ``` -## Use @since tags +### Use @since tags Use @since tags for newly-added public API types and methods e.g. @@ -149,15 +163,15 @@ Use @since tags for newly-added public API types and methods e.g. */ ``` -## Submit JUnit test cases for all behavior changes +### Submit JUnit test cases for all behavior changes -Search the codebase to find related unit tests and add additional @Test methods within. It is also acceptable to submit test cases on a per JIRA issue basis. +Search the codebase to find related unit tests and add additional @Test methods within. It is also acceptable to submit test cases on a per Github issue basis. -## Squash commits +### Squash commits Use `git rebase --interactive`, `git add --patch` and other tools to "squash" multiple commits into atomic changes. In addition to the man pages for git, there are many resources online to help you understand how these tools work. Here is one: https://book.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#_squashing . -## Use your real name in git commits +### Use your real name in git commits Please configure git to use your real first and last name for any commits you intend to submit as pull requests. For example, this is not acceptable: @@ -180,14 +194,14 @@ or locally for the *spring-batch repository only by omitting the '--global' flag git config user.name "First Last" git config user.email user@mail.com -## Run all tests prior to submission +### Run all tests prior to submission See the [checking out and building][] section of the README for instructions. Make sure that all tests pass prior to submitting your pull request. -## Mention your pull request on the associated JIRA issue +### Mention your pull request on the associated Github issue -Add a comment to the associated JIRA issue(s) linking to your new pull request. +Add a comment to the associated Github issue(s) linking to your new pull request. -[help documentation]: http://help.github.com/send-pull-requests -[JIRA issue tracker]: https://jira.spring.io/browse/BATCH +[GitHub help documentation]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests +[Github issues]: https://github.com/spring-projects/spring-batch/issues [checking out and building]: https://github.com/spring-projects/spring-batch#building-from-source diff --git a/ISSUE_REPORTING.md b/ISSUE_REPORTING.md new file mode 100644 index 0000000000..2e7b4e3c26 --- /dev/null +++ b/ISSUE_REPORTING.md @@ -0,0 +1,113 @@ +# Issue Reporting Guidelines + +Thank you very much for taking the time to report a bug to us, we greatly appreciate it! This document is designed to allow Spring Batch users and team members to contribute self-contained projects containing [minimal complete verifiable examples](https://en.wikipedia.org/wiki/Minimal_reproducible_example) for issues logged against the [issue tracker](https://github.com/spring-projects/spring-batch/issues) on GitHub. + +Our goal is to have a streamlined process for evaluating issues so that bugs get fixed more quickly! + +# How do I report a bug? + +## 1. Download the template of a minimal complete verifiable example + +We provide a template of a minimal complete verifiable example that you can download here: [spring-batch-mcve.zip](https://raw.githubusercontent.com/wiki/spring-projects/spring-batch/mcve/spring-batch-mcve.zip). +This example uses an in-memory H2 database and provides a starting point that you need to edit, zip and attach to your issue on GitHub. You need to use Java 17+ and Maven 3+. + +Please run the following commands to make sure you have the sample working as expected: + +```shell +$>unzip spring-batch-mcve.zip && cd spring-batch-mcve +$>mvn package exec:java -Dexec.mainClass=org.springframework.batch.MyBatchJobConfiguration +``` + +You should see something like the following output: + +``` +[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.configuration.annotation.BatchRegistrar - Finished Spring Batch infrastructure beans configuration in 5 ms. +[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory - Starting embedded database: url='jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false', username='sa' +[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.repository.support.JobRepositoryFactoryBean - No database type set, using meta data indicating: H2 +[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.configuration.annotation.BatchObservabilityBeanPostProcessor - No Micrometer observation registry found, defaulting to ObservationRegistry.NOOP +[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.configuration.annotation.BatchObservabilityBeanPostProcessor - No Micrometer observation registry found, defaulting to ObservationRegistry.NOOP +[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.launch.support.SimpleJobLauncher - No TaskExecutor has been set, defaulting to synchronous executor. +[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.launch.support.SimpleJobLauncher - Job: [SimpleJob: [name=job]] launched with the following parameters: [{}] +[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.job.SimpleStepHandler - Executing step: [step] +hello world +[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.step.AbstractStep - Step: [step] executed in 11ms +[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.launch.support.SimpleJobLauncher - Job: [SimpleJob: [name=job]] completed with the following parameters: [{}] and the following status: [COMPLETED] in 34ms +COMPLETED +``` + +## 2. Edit the example as needed + +Once you have the minimal complete verifiable example running as expected, you can import it as a Maven project in your favourite IDE. Please make sure to: + +* Update the sample as needed to reproduce your issue. We have placed a few TODOs where we expect you to modify the code. +* Add any dependency that is required to reproduce your issue in the `pom.xml` file. +* Keep only the code that is required to reproduce your issue. This is very important! Please reduce as much noise as possible to let us focus on the code related to the issue. + +## 3. Package the example and attach it to your issue + +Once you manage to reproduce the issue, please clean up the `target` directory *before* creating the zip archive to upload. Here are the commands you can run to create the archive: + +```shell +$>mvn clean +$>zip -r spring-batch-mcve.zip spring-batch-mcve +``` + +:exclamation: Important note: The `mvn clean` command is very important here. Please **DO NOT** include the `target` directory with all dependencies in the archive! We appreciate your collaboration on this. + +Heads-up: If you think you can reproduce the issue with a JUnit test, that is awesome! The minimal example that we provide has a JUnit test that you can edit as needed to reproduce the issue. + +# What if I use another database than H2? + +If your issue is related to a specific database, please start with the same example as in the previous section and add a Docker-based test using the [Testcontainers](https://www.testcontainers.org) library and the JDBC driver of your database. + +For example, if you use PostgreSQL, you might add the following dependencies to the `pom.xml` file: + +```xml + + + org.postgresql + postgresql + 42.6.0 + + + + + org.testcontainers + postgresql + 1.17.6 + test + +``` + +Also, remember to remove the H2 dependency as well, to keep the example as minimal as possible even in terms of dependencies. + +You can find several examples of Docker-based tests in the [test suite of Spring Batch](https://github.com/spring-projects/spring-batch/blob/main/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository), and a specific example for PostgreSQL [here](https://github.com/spring-projects/spring-batch/blob/main/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/PostgreSQLJobRepositoryIntegrationTests.java). + +# What if I use Spring Boot? + +If you use Spring Boot, the best way to create a minimal example is to generate a project on [https://start.spring.io](https://start.spring.io). + +Here is a quick link to generate a Maven-based Spring Boot application with Spring Batch and H2: [Sample project](https://start.spring.io/#!type=maven-project&language=java&platformVersion=3.0.4&packaging=jar&jvmVersion=17&groupId=com.example&artifactId=demo&name=demo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.demo&dependencies=batch,h2). + +You can also generate a project on the command line, for example with `cURL`: + +```shell +$>curl https://start.spring.io/starter.tgz -d dependencies=batch,h2 -d type=maven-project -d baseDir=spring-batch-mcve | tar -xzvf - +``` + +Once you have downloaded the project, please follow the same steps as in the previous section (edit the sample, zip it without the dependencies, etc). + +# Final thoughts + +More importantly, put yourself in the shoes of the project maintainer who is in charge of analysing and trying to reproduce your issue. Before uploading your minimal example, ask yourself: "How fast the Spring Batch team can understand and reproduce my issue?" + +Once we download your zip archive from the corresponding issue on GitHub, we expect to be two commands away from seeing a stack trace or the described abnormal behaviour: + +```shell +$>unzip spring-batch-mcve.zip && cd spring-batch-mcve +$>mvn package exec:java -Dexec.mainClass=org.springframework.batch.MyBatchJobConfiguration +``` + +Finally, please remember that those instructions are guidelines and not hard requirements. Be pragmatic! For example, if you already have a GitHub repository with the minimal example, there is no need to zip it and attach it to the issue, you would just need to add a link to it in your issue. If you think the issue is really obvious and does not require a minimal example, there is no need to create such an example, just go ahead and create the issue on GitHub by following the [Issue Template](https://github.com/spring-projects/spring-batch/blob/main/.github/ISSUE_TEMPLATE/bug_report.md). + +We appreciate your collaboration and we would like to thank you upfront for your time and effort! diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000000..62589edd12 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,202 @@ + + 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. diff --git a/README.md b/README.md index 0954cd7e7c..9bfa21b52c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,125 @@ - +# Latest news -# Spring Batch [![build status](https://build.spring.io/plugins/servlet/wittified/build-status/BATCH-GRAD)](https://build.spring.io/browse/BATCH-GRAD) +* June 10, 2026: [Spring Batch 6.0.4 and 5.2.6 released](https://spring.io/blog/2026/06/10/spring-batch-6-0-4-and-5-2-6-available-now) +* March 18, 2026: [Spring Batch 6.0.3 and 5.2.5 released](https://spring.io/blog/2026/03/18/spring-batch-6-0-3-and-5-2-5-available-now) +* January 21, 2026: [Spring Batch 6.0.2 is out](https://spring.io/blog/2026/01/21/spring-batch-6-0-2-available-now) +* December 17, 2025: [Spring Batch 6.0.1 available now](https://spring.io/blog/2025/12/17/spring-batch-6-0-1-available-now) +* November 19, 2025: [Spring Batch 6.0.0 GA is out!](https://spring.io/blog/2025/11/19/spring-batch-6-0-0-ga) -Spring Batch is a lightweight, comprehensive batch framework designed to enable the development of robust batch applications vital for the daily operations of enterprise systems. Spring Batch builds upon the productivity, POJO-based development approach, and general ease of use capabilities people have come to know from the [Spring Framework](https://github.com/SpringSource/spring-framework), while making it easy for developers to access and leverage more advanced enterprise services when necessary. +# Spring Batch [![build status](https://github.com/spring-projects/spring-batch/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/spring-projects/spring-batch/actions/workflows/continuous-integration.yml) -If you are looking for a runtime orchestration tool for your Batch applications, or need a management console to view current and historic executions, take a look at [Spring Cloud Data Flow](https://cloud.spring.io/spring-cloud-dataflow/). It is an orchestration tool for deploying and executing data integration based microservices including Spring Batch applications. +Spring Batch is a lightweight, comprehensive batch framework designed to enable the development of robust batch applications vital for the daily operations of enterprise systems. Spring Batch builds upon the productivity, POJO-based development approach, and general ease of use capabilities people have come to know from the [Spring Framework](https://github.com/spring-projects/spring-framework), while making it easy for developers to access and leverage more advanced enterprise services when necessary. + +# Getting Started + +## Two minutes tutorial + +This quick tutorial shows you how to setup a minimal project to run a simple batch job with Spring Batch. + +In your favorite IDE, create a new Maven-based Java 17+ project and add the following dependency to your `pom.xml`: + +```xml + + + org.springframework.batch + spring-batch-core + 6.0.4 + + +``` + +Then, create a class to define the batch job configuration: + +```java +import org.springframework.batch.core.job.Job; +import org.springframework.batch.core.job.parameters.JobParameters; +import org.springframework.batch.core.launch.JobOperator; +import org.springframework.batch.core.step.Step; +import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; +import org.springframework.batch.core.job.builder.JobBuilder; +import org.springframework.batch.core.repository.JobRepository; +import org.springframework.batch.core.step.builder.StepBuilder; +import org.springframework.batch.infrastructure.repeat.RepeatStatus; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +@EnableBatchProcessing +public class HelloWorldJobConfiguration { + + @Bean + public Step step(JobRepository jobRepository) { + return new StepBuilder(jobRepository).tasklet((contribution, chunkContext) -> { + System.out.println("Hello world!"); + return RepeatStatus.FINISHED; + }).build(); + } + + @Bean + public Job job(JobRepository jobRepository, Step step) { + return new JobBuilder(jobRepository) + .start(step) + .build(); + } + + public static void main(String[] args) throws Exception { + ApplicationContext context = new AnnotationConfigApplicationContext(HelloWorldJobConfiguration.class); + JobOperator jobOperator = context.getBean(JobOperator.class); + Job job = context.getBean(Job.class); + jobOperator.start(job, new JobParameters()); + } + +} +``` + +The job in this tutorial is composed of a single step that prints "Hello world!" to the standard output. + +You can now run the `main` method of the `HelloWorldJobConfiguration` class to launch the job. The output should be similar to the following: + +``` +[main] INFO org.springframework.batch.core.launch.support.TaskExecutorJobLauncher - COMMONS-LOGGING Job: [SimpleJob: [name=job]] launched with the following parameters: [{}] +[main] INFO org.springframework.batch.core.step.AbstractStep - COMMONS-LOGGING Executing step: [step] +Hello world! +[main] INFO org.springframework.batch.core.step.AbstractStep - COMMONS-LOGGING Step: [step] executed in 3ms +[main] INFO org.springframework.batch.core.launch.support.TaskExecutorJobLauncher - COMMONS-LOGGING Job: [SimpleJob: [name=job]] completed with the following parameters: [{}] and the following status: [COMPLETED] in 4ms +``` + +That's it! You have created and run your first Spring Batch job. + +## Getting Started Guide + +This guide is a more realistic tutorial that shows a typical ETL batch job that reads data from a flat file, transforms it and writes it to a relational database. +It is a Spring Batch project based on Spring Boot. You find the Getting Started Guide here: [Creating a Batch Service](https://spring.io/guides/gs/batch-processing/). + +## Samples + +You can find several samples to try out here: [Spring Batch Samples](https://github.com/spring-projects/spring-batch/tree/main/spring-batch-samples). + +# Getting Help + +If you have a question or a support request, please open a new discussion on [GitHub Discussions](https://github.com/spring-projects/spring-batch/discussions). + +> [!IMPORTANT] +> As of January 2026, we do not provide support on StackOverflow anymore. Please use GitHub Discussions for any questions or support requests. + +Please do **not** create issues on the [Issue Tracker](https://github.com/spring-projects/spring-batch/issues) for questions or support requests. +We would like to keep the issue tracker **exclusively** for bug reports and feature requests. + +# Reporting issues + +Spring Batch uses [GitHub Issues](https://github.com/spring-projects/spring-batch/issues) to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below: + +* Before you open an issue, please search the issue tracker to see if someone has already reported the problem. If the issue doesn't already exist, create a new issue. +* Please provide as much information as possible in the issue report by following the [Issue Reporting Template](https://github.com/spring-projects/spring-batch/blob/main/.github/ISSUE_TEMPLATE/bug_report.md). +* If you need to paste code or include a stack trace, please use Markdown escapes (```) before and after your text. + +For non trivial bugs, please create a test case or a project that replicates the problem and attach it to the issue, as detailed in the [Issue Reporting Guidelines](https://github.com/spring-projects/spring-batch/blob/main/ISSUE_REPORTING.md). + +# Reporting Security Vulnerabilities + +Please see our [Security policy](https://github.com/spring-projects/spring-batch/security/policy). # Building from Source @@ -13,42 +128,39 @@ Clone the git repository using the URL on the Github home page: $ git clone git@github.com:spring-projects/spring-batch.git $ cd spring-batch -## Command Line -Gradle is the build tool used for Spring Batch. You can perform a full build of Spring Batch via the command: +To build Spring Batch, you need a JDK 22+. Maven is the build tool used for Spring Batch. +You can build the project with the following command: - $ ./gradlew build + $ ./mvnw package -## Spring Tool Suite (STS) -In STS (or any Eclipse distro or other IDE with Gradle support), import the module directories as existing projects. They should compile and the tests should run with no additional steps. +If you want to perform a full build with all integration tests, then run: -# Getting Started Using Spring Boot -This is the quickest way to get started with a new Spring Batch project. You find the Getting Started Guide for Spring -Batch on Spring.io: [Creating a Batch Service](http://spring.io/guides/gs/batch-processing/) + $ ./mvnw verify -# Getting Started Using Spring Tool Suite (STS) +Please note that some integration tests are based on Docker, so please make sure to have Docker up and running before running a full build. -It requires an internet connection for download, and access to a Maven repository (remote or local). +To generate the reference documentation, run the following commands: -* Download STS version 3.4.* (or better) from the [Spring website](http://spring.io/tools/sts/). STS is a free Eclipse bundle with many features useful for Spring developers. -* Go to `File->New->Spring Template Project` from the menu bar (in the Spring perspective). -* The wizard has a drop down with a list of template projects. One of them is a "Simple Spring Batch Project". Select it and follow the wizard. -* A project is created with all dependencies and a simple input/output job configuration. It can be run using a unit test, or on the command line (see instructions in the pom.xml). - -# Getting Help +``` +$ ./mvnw antora -pl spring-batch-docs +``` -Read the main project [website](http://projects.spring.io/spring-batch/) and the [User Guide](http://docs.spring.io/spring-batch/trunk/reference/). Look at the source code and the Javadocs. For more detailed questions, use the [forum](http://forum.spring.io/forum/spring-projects/batch). If you are new to Spring as well as to Spring Batch, look for information about [Spring projects](http://spring.io/projects). +The reference documentation can be found in `spring-batch-docs/target/site`. # Contributing to Spring Batch -Here are some ways for you to get involved in the community: +We welcome contributions in any kind! Here are some ways for you to contribute to the project: -* Get involved with the Spring community on the Spring Community Forums. Please help out on the [forum](http://forum.spring.io/forum/spring-projects/batch) by responding to questions and joining the debate. -* Create [JIRA](https://jira.spring.io/browse/BATCH) tickets for bugs and new features and comment and vote on the ones that you are interested in. -* Github is for social coding: if you want to write code, we encourage contributions through pull requests from [forks of this repository](http://help.github.com/forking/). If you want to contribute code this way, please familiarize yourself with the process outlined for contributing to Spring projects here: [Contributor Guidelines](https://github.com/spring-projects/spring-batch/blob/master/CONTRIBUTING.md). -* Watch for upcoming articles on Spring by [subscribing](feed://assets.spring.io/drupal/node/feed.xml) to spring.io - -Before we accept a non-trivial patch or pull request we will need you to sign the [contributor's agreement](https://support.springsource.com/spring_committer_signup). Signing the contributor's agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and given the ability to merge pull requests. +* Get involved with the Spring Batch community on [Twitter](https://twitter.com/springbatch) and [GitHub Discussions](https://github.com/spring-projects/spring-batch/discussions) by answering questions and joining the debate. +* Create [issues](https://github.com/spring-projects/spring-batch/issues) for bugs and new features or comment and vote on the ones that you are interested in. +* Help us reproduce issues marked with [status: need-help-to-reproduce](https://github.com/spring-projects/spring-batch/labels/status%3A%20need-help-to-reproduce) by following the [Issue Reporting Guidelines](https://github.com/spring-projects/spring-batch/blob/main/ISSUE_REPORTING.md). +* GitHub is for social coding: if you want to write code, we encourage contributions through pull requests. If you want to contribute code this way, please familiarize yourself with the process outlined here: [Contributor Guidelines](https://github.com/spring-projects/spring-batch/blob/main/CONTRIBUTING.md). +* Watch for Spring Batch related articles on [spring.io](https://spring.io). # Code of Conduct - This project adheres to the [Contributor Covenant ](https://github.com/spring-projects/spring-batch/blob/master/CODE_OF_CONDUCT.adoc). By participating, you are expected to uphold this code. Please report unacceptable behavior to spring-code-of-conduct@pivotal.io. - \ No newline at end of file + +Please see our [code of conduct](https://github.com/spring-projects/.github/blob/main/CODE_OF_CONDUCT.md). + +# License + +Spring Batch is Open Source software released under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html). diff --git a/SUPPORT.md b/SUPPORT.md new file mode 100644 index 0000000000..fe4c3bbcd0 --- /dev/null +++ b/SUPPORT.md @@ -0,0 +1,5 @@ +If you have a question or a support request, please open a new discussion on [GitHub Discussions](https://github.com/spring-projects/spring-batch/discussions) +or ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/spring-batch). + +Please do **not** create issues on the [Issue Tracker](https://github.com/spring-projects/spring-batch/issues) for questions or support requests. +We would like to keep the issue tracker **exclusively** for bug reports and feature requests. \ No newline at end of file diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 5b0521caa5..0000000000 --- a/build.gradle +++ /dev/null @@ -1,912 +0,0 @@ -//description = 'Spring Batch' - -//apply plugin: 'base' - -buildscript { - repositories { - maven { url 'https://repo.spring.io/plugins-release' } - maven { url 'https://plugins.gradle.org/m2/' } - } - dependencies { - classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7' - classpath 'io.spring.gradle:spring-io-plugin:0.0.5.RELEASE' - classpath "io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE" - classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2" - classpath "org.asciidoctor:asciidoctor-gradle-plugin:1.5.3" - classpath "org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.14" - } -} - -plugins { - id 'org.sonarqube' version '2.6.2' -} - -ext { - linkHomepage = 'http://projects.spring.io/spring-batch/' - linkCi = 'https://build.spring.io/browse/BATCH' - linkIssue = 'https://jira.spring.io/browse/BATCH' - linkScmUrl = 'https://github.com/spring-projects/spring-batch' - linkScmConnection = 'git://github.com/spring-projects/spring-batch.git' - linkScmDevConnection = 'git@github.com:spring-projects/spring-batch.git' - - mainProjects = subprojects.findAll { !it.name.endsWith('tests') && !it.name.endsWith('samples') && it.name.startsWith('spring-batch-')} -} - -allprojects { - group = 'org.springframework.batch' - - repositories { - maven { url 'https://repo.spring.io/libs-snapshot' } - maven { url 'https://repo.spring.io/libs-milestone' } - maven { url 'https://repo.spring.io/plugins-release' } - mavenCentral() - } - - ext { - - environmentProperty = project.hasProperty('environment') ? getProperty('environment') : 'hsql' - - springVersionDefault = '5.2.0.BUILD-SNAPSHOT' - springVersion = project.hasProperty('springVersion') ? getProperty('springVersion') : springVersionDefault - springRetryVersion = '1.2.3.RELEASE' - springAmqpVersion = '2.1.4.BUILD-SNAPSHOT' - springDataCommonsVersion = '2.2.0.BUILD-SNAPSHOT' - springDataGemfireVersion = '2.2.0.BUILD-SNAPSHOT' - springDataJpaVersion = '2.2.0.BUILD-SNAPSHOT' - springDataMongodbVersion = '2.2.0.BUILD-SNAPSHOT' - springDataNeo4jVersion = '5.2.0.BUILD-SNAPSHOT' - springIntegrationVersion = '5.1.3.BUILD-SNAPSHOT' - springLdapVersion = '2.3.2.RELEASE' - - activemqVersion = '5.15.8' - aspectjVersion = '1.9.2' - commonsDdbcpVersion = '2.5.0' - commonsIoVersion = '2.6' - commonsLangVersion = '3.8.1' - commonsPoolVersion = '1.6' - derbyVersion = '10.14.2.0' - groovyVersion = '2.5.5' - hamcrestVersion = '1.3' - h2databaseVersion = '1.4.197' - hibernateVersion = '5.4.0.Final' - hibernateValidatorVersion = '6.0.14.Final' - javaxElVersion = '3.0.0' - hsqldbVersion = '2.4.1' - jackson2Version = '2.9.8' - gsonVersion = '2.8.5' - javaMailVersion = '1.6.2' - javaxBatchApiVersion = '1.0' - javaxAnnotationApiVersion = '1.3.2' - javaxInjectVersion = '1' - javaxTransactionVersion = '1.3' - jbatchTckSpi = '1.0' - jettisonVersion = '1.2' //? => upgrade to 1.4 and the build fails (deprecated anyway via xstream) - jmsVersion = '2.0.1' - junitVersion = '4.12' - log4jVersion = '2.11.1' - mysqlVersion = '8.0.13' - mockitoVersion = '2.23.4' - postgresqlVersion = '42.2.5' - quartzVersion = '2.3.0' - servletApiVersion = '4.0.1' - sqlfireclientVersion = '1.0.3' - sqliteVersion = '3.25.2' - woodstoxVersion = '5.2.0' - xmlunitVersion = '2.6.2' - xstreamVersion = '1.4.11.1' - jrubyVersion = '1.7.27' - beanshellVersion = '2.0b5' - jaxbApiVersion = '2.3.1' - jaxbImplVersion = '2.3.0.1' - } - - apply plugin: 'idea' -} - -configure(subprojects - project(":spring-build-src")) { subproject -> - - apply plugin: 'java' - apply from: "${rootProject.projectDir}/publish-maven.gradle" - apply plugin: 'jacoco' - apply plugin: 'propdeps-idea' - apply plugin: 'propdeps-eclipse' - apply plugin: 'merge' - - jacoco { - toolVersion = "0.8.2" - } - - compileJava { - sourceCompatibility=1.8 - targetCompatibility=1.8 - options.encoding='UTF-8' - } - - compileTestJava { - sourceCompatibility=1.8 - targetCompatibility=1.8 - options.encoding='UTF-8' - } - - eclipse { - project { - natures += 'org.springframework.ide.eclipse.core.springnature' - } - } - - sourceSets { - test { - resources { - srcDirs = ['src/test/resources', 'src/test/java'] - } - } - } - - // enable all compiler warnings; individual projects may customize further - ext.xLintArg = '-Xlint:all' - [compileJava, compileTestJava]*.options*.compilerArgs = [xLintArg] + '-proc:none' - - tasks.withType(Test).all { - // suppress all console output during testing unless running `gradle -i` - logging.captureStandardOutput(LogLevel.INFO) - systemProperty "ENVIRONMENT", environmentProperty - - jacoco { - append = false - destinationFile = file("$buildDir/jacoco.exec") - } - - include '**/*Tests.class' - exclude '**/Abstract*.class' - } - - test { - jacoco { - append = false - destinationFile = file("$buildDir/jacoco.exec") - } - -// testLogging { -// showStandardStreams = true -// } - } - - task sourcesJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allJava - } - - task javadocJar(type: Jar) { - classifier = 'javadoc' - from javadoc - } - - task checkTestConfigs { - doLast { - def configFiles = [] - sourceSets.test.java.srcDirs.each { - fileTree(it).include('**/*.xml').exclude('**/log4j.xml').each { configFile -> - def configXml = new XmlParser(false, false).parse(configFile) - - if (configXml.@'xsi:schemaLocation' ==~ /.*spring-[a-z-]*\d\.\d\.xsd.*/) { - configFiles << configFile - } - } - } - if (configFiles) { - throw new InvalidUserDataException('Hardcoded XSD version in the config files:\n' + - configFiles.collect { relativePath(it) }.join('\n') + - '\nPlease, use versionless schemaLocations for Spring XSDs to avoid issues with builds on different versions of dependencies.') - } - } - } - - jar { - manifest.attributes["Created-By"] = - "${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})" - manifest.attributes["Implementation-Title"] = subproject.name - manifest.attributes["Implementation-Version"] = subproject.version - - from("${rootProject.projectDir}/src/dist") { - include "license.txt" - include "notice.txt" - into "META-INF" - expand(copyright: new Date().format("yyyy"), version: project.version) - } - } - - test.dependsOn checkTestConfigs - - artifacts { - archives sourcesJar - archives javadocJar - } -} - -subprojects { - task allDeps(type: DependencyReportTask) {} -} - -configure(mainProjects) { - if (project.hasProperty('platformVersion')) { - apply plugin: 'spring-io' - - repositories { - maven { url "https://repo.spring.io/libs-snapshot" } - } - - dependencyManagement { - springIoTestRuntime { - imports { - mavenBom "io.spring.platform:platform-bom:${platformVersion}" - } - } - } - } -} - -project("spring-build-src") { - description = "Exposes gradle buildSrc for IDE support" - apply plugin: "groovy" - - dependencies { - compile gradleApi() - compile localGroovy() - } - - configurations.archives.artifacts.clear() -} - -project('spring-batch-core') { - description = 'Spring Batch Core' - - dependencies { - compile project(":spring-batch-infrastructure") - - compile "com.fasterxml.jackson.core:jackson-databind:${jackson2Version}" - compile ("org.codehaus.jettison:jettison:$jettisonVersion") { - exclude group: 'stax', module: 'stax-api' - } - compile "org.springframework:spring-aop:$springVersion" - compile "org.springframework:spring-beans:$springVersion" - compile "org.springframework:spring-context:$springVersion" - compile "org.springframework:spring-core:$springVersion" - compile "org.springframework:spring-tx:$springVersion" - compile "javax.batch:javax.batch-api:$javaxBatchApiVersion" - - testCompile "org.springframework:spring-test:$springVersion" - testCompile "org.mockito:mockito-core:$mockitoVersion" - testCompile "javax.inject:javax.inject:$javaxInjectVersion" - testCompile "org.hsqldb:hsqldb:$hsqldbVersion" - testCompile "com.h2database:h2:$h2databaseVersion" - testCompile "commons-io:commons-io:$commonsIoVersion" - testCompile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion" - testCompile "junit:junit:${junitVersion}" - testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion" - optional "com.ibm.jbatch:com.ibm.jbatch-tck-spi:$jbatchTckSpi" - optional "com.thoughtworks.xstream:xstream:$xstreamVersion" - optional "org.aspectj:aspectjrt:$aspectjVersion" - optional "org.aspectj:aspectjweaver:$aspectjVersion" - optional "org.springframework:spring-jdbc:$springVersion" - optional "org.apache.logging.log4j:log4j-api:$log4jVersion" - optional "org.apache.logging.log4j:log4j-core:$log4jVersion" - optional "javax.annotation:javax.annotation-api:$javaxAnnotationApiVersion" - // JSR-305 only used for non-required meta-annotations - compileOnly("com.google.code.findbugs:jsr305:3.0.2") - testCompileOnly("com.google.code.findbugs:jsr305:3.0.2") - } -} - -project('spring-batch-infrastructure') { - description = 'Spring Batch Infrastructure' - - dependencies { - - compile "org.springframework:spring-core:$springVersion" - compile "org.springframework.retry:spring-retry:$springRetryVersion" - - testCompile "org.apache.logging.log4j:log4j-api:$log4jVersion" - testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion" - testCompile "commons-io:commons-io:$commonsIoVersion" - testCompile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion" - testCompile "org.hsqldb:hsqldb:$hsqldbVersion" - testCompile "com.h2database:h2:$h2databaseVersion" - testCompile "org.apache.derby:derby:$derbyVersion" - testCompile "org.springframework:spring-test:$springVersion" - testCompile "junit:junit:${junitVersion}" - testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion" - testCompile "org.aspectj:aspectjrt:$aspectjVersion" - testCompile "org.aspectj:aspectjweaver:$aspectjVersion" - testCompile "org.mockito:mockito-core:$mockitoVersion" - testCompile "org.xerial:sqlite-jdbc:$sqliteVersion" - testCompile "javax.xml.bind:jaxb-api:$jaxbApiVersion" - - testRuntime "com.sun.mail:javax.mail:$javaMailVersion" - testRuntime "org.codehaus.groovy:groovy-jsr223:$groovyVersion" - testRuntime "org.jruby:jruby:$jrubyVersion" - testRuntime "org.hibernate.validator:hibernate-validator:$hibernateValidatorVersion" - testRuntime "org.glassfish:javax.el:$javaxElVersion" - testRuntime "org.beanshell:bsh:$beanshellVersion" - testRuntime "com.sun.xml.bind:jaxb-core:$jaxbImplVersion" - testRuntime "com.sun.xml.bind:jaxb-impl:$jaxbImplVersion" - - optional "javax.jms:javax.jms-api:$jmsVersion" - optional "com.fasterxml.jackson.core:jackson-databind:${jackson2Version}" - optional "com.google.code.gson:gson:${gsonVersion}" - compile("org.hibernate:hibernate-core:$hibernateVersion") { dep -> - optional dep - exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec' - } - compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep -> - optional dep - exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec' - } - optional "org.hibernate.validator:hibernate-validator:$hibernateValidatorVersion" - optional "javax.transaction:javax.transaction-api:$javaxTransactionVersion" - optional "javax.mail:javax.mail-api:$javaMailVersion" - optional "javax.batch:javax.batch-api:$javaxBatchApiVersion" - compile("org.springframework:spring-oxm:$springVersion") { dep -> - optional dep - exclude group: 'commons-lang', module: 'commons-lang' - } - optional "org.springframework:spring-aop:$springVersion" - optional "org.springframework:spring-context:$springVersion" - compile("org.springframework:spring-context-support:$springVersion") { dep -> - optional dep - } - optional "org.springframework:spring-jdbc:$springVersion" - optional "org.springframework:spring-jms:$springVersion" - optional "org.springframework:spring-orm:$springVersion" - optional "org.springframework:spring-tx:$springVersion" - optional "org.springframework.data:spring-data-commons:$springDataCommonsVersion" - optional "org.springframework.data:spring-data-mongodb:$springDataMongodbVersion" - optional ("org.springframework.data:spring-data-neo4j:$springDataNeo4jVersion") { - exclude group: "org.springframework", module: "spring-aspects" - } - optional "org.springframework.data:spring-data-gemfire:$springDataGemfireVersion" - compile("com.fasterxml.woodstox:woodstox-core:$woodstoxVersion") { dep -> - optional dep - exclude group: 'stax', module: 'stax-api' - } - optional "org.springframework.amqp:spring-amqp:$springAmqpVersion" - optional ("org.springframework.amqp:spring-rabbit:$springAmqpVersion") { - exclude group: "org.springframework", module: "spring-messaging" - exclude group: "org.springframework", module: "spring-web" - } - optional "org.springframework.ldap:spring-ldap-core:$springLdapVersion" - optional "org.springframework.ldap:spring-ldap-core-tiger:$springLdapVersion" - optional "org.springframework.ldap:spring-ldap-ldif-core:$springLdapVersion" - // JSR-305 only used for non-required meta-annotations - compileOnly("com.google.code.findbugs:jsr305:3.0.2") - testCompileOnly("com.google.code.findbugs:jsr305:3.0.2") - } - - if (project.hasProperty('platformVersion')) { - def dataNeo4jVersion = dependencyManagement.springIoTestRuntime.managedVersions['org.springframework.data:spring-data-neo4j'] - if (dataNeo4jVersion?.startsWith('4.')) { - tasks.withType(Test).matching { it.name =~ "springIoJdk.Test" }.all { - exclude '**/Neo4jItemReaderTests.class' - } - } - } -} - -project('spring-batch-docs') { - description = 'Spring Batch Docs' -} - -project('spring-batch-core-tests') { - description = 'Spring Batch Core Tests' - project.tasks.findByPath("artifactoryPublish")?.enabled = false - dependencies { - compile project(":spring-batch-core") - compile project(":spring-batch-infrastructure") - compile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion" - compile "org.springframework:spring-jdbc:$springVersion" - compile "org.springframework.retry:spring-retry:$springRetryVersion" - compile "org.springframework:spring-tx:$springVersion" - compile "org.springframework:spring-aop:$springVersion" - - testCompile "org.hsqldb:hsqldb:$hsqldbVersion" - testCompile "commons-io:commons-io:$commonsIoVersion" - testCompile "org.apache.derby:derby:$derbyVersion" - testCompile "junit:junit:${junitVersion}" - testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion" - testCompile "org.apache.logging.log4j:log4j-api:$log4jVersion" - testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion" - testCompile "org.springframework:spring-test:$springVersion" - testCompile "org.springframework:spring-jdbc:$springVersion" - - runtime "mysql:mysql-connector-java:$mysqlVersion" - runtime "org.postgresql:postgresql:$postgresqlVersion" - runtime "javax.batch:javax.batch-api:$javaxBatchApiVersion" - - optional "org.aspectj:aspectjrt:$aspectjVersion" - optional "org.aspectj:aspectjweaver:$aspectjVersion" - optional "org.springframework.ldap:spring-ldap-core:$springLdapVersion" - optional "org.springframework.ldap:spring-ldap-core-tiger:$springLdapVersion" - optional "org.springframework.ldap:spring-ldap-ldif-core:$springLdapVersion" - } - test { - enabled = project.hasProperty('alltests') - } -} - -project('spring-batch-infrastructure-tests') { - description = 'Spring Batch Infrastructure Tests' - project.tasks.findByPath("artifactoryPublish")?.enabled = false - dependencies { - compile project(":spring-batch-infrastructure") - compile "javax.jms:javax.jms-api:$jmsVersion" - compile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion" - compile "org.springframework:spring-tx:$springVersion" - compile "org.springframework:spring-aop:$springVersion" - - testCompile "org.hsqldb:hsqldb:$hsqldbVersion" - testCompile "commons-io:commons-io:$commonsIoVersion" - testCompile "org.apache.derby:derby:$derbyVersion" - testCompile "org.apache.activemq:activemq-broker:$activemqVersion" - testCompile "org.apache.activemq:activemq-kahadb-store:$activemqVersion" - testCompile "junit:junit:${junitVersion}" - testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion" - testCompile "org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:1.0.1" - testCompile "org.xmlunit:xmlunit-core:$xmlunitVersion" - testCompile "org.xmlunit:xmlunit-matchers:$xmlunitVersion" - testCompile "org.apache.logging.log4j:log4j-api:$log4jVersion" - testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion" - testCompile "com.thoughtworks.xstream:xstream:$xstreamVersion" - testCompile("com.fasterxml.woodstox:woodstox-core:$woodstoxVersion") { - exclude group: 'stax', module: 'stax-api' - } - testCompile "org.apache.commons:commons-lang3:$commonsLangVersion" - testCompile("org.springframework:spring-oxm:$springVersion") { - exclude group: 'commons-lang', module: 'commons-lang' - } - testCompile "org.springframework:spring-jdbc:$springVersion" - testCompile "org.springframework:spring-test:$springVersion" - testCompile "org.mockito:mockito-core:$mockitoVersion" - testCompile "javax.xml.bind:jaxb-api:$jaxbApiVersion" - - compile("org.hibernate:hibernate-core:$hibernateVersion") { dep -> - optional dep - exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec' - } - compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep -> - optional dep - exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec' - } - optional "javax.transaction:javax.transaction-api:1.2" - optional "org.springframework:spring-orm:$springVersion" - optional "org.springframework:spring-jms:$springVersion" - - runtime "mysql:mysql-connector-java:$mysqlVersion" - runtime "org.postgresql:postgresql:$postgresqlVersion" - } - test { - enabled = project.hasProperty('alltests') - } -} - -//Domain for batch job testing -project('spring-batch-test') { - description = 'Spring Batch Test' - - dependencies { - compile project(":spring-batch-core") - - compile "junit:junit:${junitVersion}" - compile "org.springframework:spring-test:$springVersion" - compile "org.springframework:spring-jdbc:$springVersion" - - testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion" - testCompile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion" - testCompile "org.hsqldb:hsqldb:$hsqldbVersion" - testCompile "org.mockito:mockito-core:$mockitoVersion" - - optional "org.aspectj:aspectjrt:$aspectjVersion" - optional "javax.batch:javax.batch-api:$javaxBatchApiVersion" - } -} - -project('spring-batch-integration') { - description = 'Batch Integration' - - dependencies { - compile project(":spring-batch-core") - - compile "org.springframework.retry:spring-retry:$springRetryVersion" - compile "org.springframework:spring-context:$springVersion" - compile "org.springframework:spring-messaging:$springVersion" - compile "org.springframework:spring-aop:$springVersion" - compile "org.springframework.integration:spring-integration-core:$springIntegrationVersion" - compile "org.springframework:spring-tx:$springVersion" - - testCompile project(":spring-batch-test") - - testCompile "org.apache.activemq:activemq-broker:$activemqVersion" - testCompile "org.apache.activemq:activemq-kahadb-store:$activemqVersion" - testCompile "junit:junit:${junitVersion}" - testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion" - testCompile "org.aspectj:aspectjrt:$aspectjVersion" - testCompile "org.aspectj:aspectjweaver:$aspectjVersion" - testCompile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion" - testCompile "com.h2database:h2:$h2databaseVersion" - testCompile "mysql:mysql-connector-java:$mysqlVersion" - testCompile "org.apache.derby:derby:$derbyVersion" - testCompile "org.hsqldb:hsqldb:$hsqldbVersion" - testCompile "org.springframework:spring-test:$springVersion" - testCompile "org.mockito:mockito-core:$mockitoVersion" - testCompile("org.springframework.integration:spring-integration-test:$springIntegrationVersion") { - exclude group: 'junit', module: 'junit-dep' - exclude group:'org.hamcrest', module:'hamcrest-all' - } - testCompile "org.springframework.integration:spring-integration-jdbc:$springIntegrationVersion" - - optional "javax.jms:javax.jms-api:$jmsVersion" - optional "org.apache.logging.log4j:log4j-api:$log4jVersion" - optional "org.apache.logging.log4j:log4j-core:$log4jVersion" - optional "org.springframework.integration:spring-integration-jms:$springIntegrationVersion" - optional "org.springframework:spring-jms:$springVersion" - - optional "javax.batch:javax.batch-api:$javaxBatchApiVersion" - - // JSR-305 only used for non-required meta-annotations - compileOnly("com.google.code.findbugs:jsr305:3.0.2") - } -} - -project('spring-batch-samples') { - description = 'Batch Batch Samples' - project.tasks.findByPath("artifactoryPublish")?.enabled = false - - dependencies { - - compile project(":spring-batch-integration") - compile "org.aspectj:aspectjrt:$aspectjVersion" - compile "org.aspectj:aspectjweaver:$aspectjVersion" - compile "org.quartz-scheduler:quartz:$quartzVersion" - compile "commons-io:commons-io:$commonsIoVersion" - compile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion" - compile "com.thoughtworks.xstream:xstream:$xstreamVersion" - compile("com.fasterxml.woodstox:woodstox-core:$woodstoxVersion") { - exclude group: 'stax', module: 'stax-api' - } - compile("org.hibernate:hibernate-core:$hibernateVersion") { dep -> - optional dep - exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec' - } - compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep -> - optional dep - exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec' - } - compile "javax.transaction:javax.transaction-api:$javaxTransactionVersion" - compile "org.springframework:spring-aop:$springVersion" - compile("org.springframework:spring-oxm:$springVersion") { - exclude group: 'commons-lang', module: 'commons-lang' - } - compile "org.springframework:spring-core:$springVersion" - compile "org.springframework:spring-context-support:$springVersion" - compile "org.springframework:spring-jdbc:$springVersion" - compile "org.springframework:spring-orm:$springVersion" - compile "org.springframework:spring-tx:$springVersion" - compile "org.springframework.data:spring-data-jpa:$springDataJpaVersion" - compile "javax.mail:javax.mail-api:$javaMailVersion" - compile "org.apache.activemq:activemq-client:$activemqVersion" - compile "org.apache.activemq:activemq-broker:$activemqVersion" - - testCompile "org.xmlunit:xmlunit-core:$xmlunitVersion" - testCompile "org.xmlunit:xmlunit-matchers:$xmlunitVersion" - testCompile project(":spring-batch-test") - testCompile "junit:junit:${junitVersion}" - testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion" - testCompile "org.hsqldb:hsqldb:$hsqldbVersion" - testCompile "org.apache.logging.log4j:log4j-api:$log4jVersion" - testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion" - testCompile "org.codehaus.groovy:groovy:$groovyVersion" - testCompile "org.codehaus.groovy:groovy-ant:$groovyVersion" - testCompile "org.springframework:spring-test:$springVersion" - testCompile "org.mockito:mockito-core:$mockitoVersion" - testCompile "org.apache.activemq:activemq-kahadb-store:$activemqVersion" - - testRuntime "com.sun.mail:javax.mail:$javaMailVersion" - testRuntime "org.hibernate.validator:hibernate-validator:$hibernateValidatorVersion" - testRuntime "org.glassfish:javax.el:$javaxElVersion" - testRuntime "javax.xml.bind:jaxb-api:$jaxbApiVersion" - testRuntime "com.sun.xml.bind:jaxb-core:$jaxbImplVersion" - testRuntime "com.sun.xml.bind:jaxb-impl:$jaxbImplVersion" - - provided "mysql:mysql-connector-java:$mysqlVersion" - provided "com.h2database:h2:$h2databaseVersion" - provided "javax.servlet:javax.servlet-api:$servletApiVersion" - - optional "com.vmware.sqlfire:sqlfireclient:$sqlfireclientVersion" - optional "org.apache.derby:derby:$derbyVersion" - optional "org.postgresql:postgresql:$postgresqlVersion" - optional "org.springframework:spring-web:$springVersion" - optional "org.springframework.data:spring-data-commons:$springDataCommonsVersion" - optional "org.springframework.amqp:spring-amqp:$springAmqpVersion" - optional ("org.springframework.amqp:spring-rabbit:$springAmqpVersion") { - exclude group: "org.springframework", module: "spring-messaging" - exclude group: "org.springframework", module: "spring-web" - } - optional "javax.inject:javax.inject:1" - - optional "javax.batch:javax.batch-api:$javaxBatchApiVersion" - } -} - -apply plugin: "org.asciidoctor.convert" -asciidoctor { - sourceDir = file('spring-batch-docs/asciidoc') - sources { - include '*.adoc' - } - resources { - from(sourceDir) { - include 'images/**' - include 'jsfiles/**' - include 'tocbot-3.0.2/**' - } - } - logDocuments = true - backends = ["html", "pdf"] - options doctype: 'book', eruby: 'erubis' - attributes 'icons': 'font', - 'idprefix': '', - 'idseparator': '-', - docinfo: 'shared', - revnumber: project.version, - sectanchors: '', - sectnums: '', - 'source-highlighter': 'coderay@', // TODO switch to 'rouge' once supported by the html5 backend - stylesdir: 'stylesheets/', - stylesheet: 'spring.css', - 'spring-version': project.version, - 'allow-uri-read': '' - -} - -apply plugin: 'org.sonarqube' - -sonarqube { - properties { - property "sonar.projectName", "Spring Batch" - property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec" - property "sonar.links.homepage", linkHomepage - property "sonar.links.ci", linkCi - property "sonar.links.issue", linkIssue - property "sonar.links.scm", linkScmUrl - property "sonar.links.scm_dev", linkScmDevConnection - property "sonar.java.coveragePlugin", "jacoco" - } -} - -task api(type: Javadoc) { - group = 'Documentation' - description = 'Generates aggregated Javadoc API documentation.' - title = "Spring Batch ${version} API" - options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED - options.author = true - options.header = 'Spring Batch' - options.overview = 'src/api/overview.html' - if (JavaVersion.current().isJava8Compatible()) { - options.addStringOption('Xdoclint:none', '-quiet') - } - - source subprojects.collect { project -> - project.sourceSets.main.allJava - } - destinationDir = new File(buildDir, "api") - classpath = files(subprojects.collect { project -> - project.sourceSets.main.compileClasspath - }) -} - -task schemaZip(type: Zip) { - group = 'Distribution' - classifier = 'schema' - description = "Builds -${classifier} archive containing all " + - "XSDs for deployment at static.springframework.org/schema." - - subprojects.each { subproject -> - def Properties schemas = new Properties(); - def shortName = subproject.name.replaceFirst("${rootProject.name}-", '') - if (subproject.name.endsWith("-core")) { - shortName = '' - } - - subproject.sourceSets.main.resources.find { - it.path.endsWith("META-INF${File.separator}spring.schemas") - }?.withInputStream { schemas.load(it) } - - for (def key : schemas.keySet()) { - File xsdFile = subproject.sourceSets.main.resources.find { - it.path.replaceAll('\\\\', '/').endsWith(schemas.get(key)) - } - assert xsdFile != null - into ("batch/${shortName}") { - from xsdFile.path - } - } - } -} - -task docsZip(type: Zip) { - group = 'Distribution' - classifier = 'docs' - description = "Builds -${classifier} archive containing api and reference " + - "for deployment at static.springframework.org/spring-batch/reference." - - from('src/dist') { - include 'changelog.txt' - } - - from (api) { - into 'api' - } - - from (asciidoctor) { - exclude '*.pdf' - exclude '*.html' - exclude 'images' - exclude 'jsfiles' - exclude 'tocbot-3.0.2' - exclude 'html/index-pdf.html' - exclude 'pdf/images' - exclude 'pdf/jsfiles' - exclude 'pdf/tocbot-3.0.2' - exclude 'pdf/appendix.pdf' - exclude 'pdf/common-patterns.pdf' - exclude 'pdf/domain.pdf' - exclude 'pdf/index.pdf' - exclude 'pdf/toggle.pdf' - exclude 'pdf/job.pdf' - exclude 'pdf/jsr-352.pdf' - exclude 'pdf/readersAndWriters.pdf' - exclude 'pdf/repeat.pdf' - exclude 'pdf/retry.pdf' - exclude 'pdf/scalability.pdf' - exclude 'pdf/schema-appendix.pdf' - exclude 'pdf/spring-batch-integration.pdf' - exclude 'pdf/spring-batch-intro.pdf' - exclude 'pdf/step.pdf' - exclude 'pdf/testing.pdf' - exclude 'pdf/transaction-appendix.pdf' - exclude 'pdf/whatsnew.pdf' - exclude 'pdf/glossary.pdf' - - rename 'index-single.pdf', 'spring-batch-reference.pdf' - - into 'reference' - } -} - -task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) { - group = 'Distribution' - classifier = 'dist' - description = "Builds -${classifier} archive, containing all jars and docs, " + - "suitable for community download page." - - ext.baseDir = "${project.name}-${project.version}"; - - from('src/dist') { - include 'readme.txt' - include 'license.txt' - include 'notice.txt' - into "${baseDir}" - expand(copyright: new Date().format("yyyy"), version: project.version) - } - - from(zipTree(docsZip.archivePath)) { - into "${baseDir}/docs" - } - - from(zipTree(schemaZip.archivePath)) { - into "${baseDir}/schema" - } - - [project(':spring-batch-core'), project(':spring-batch-infrastructure'), project(':spring-batch-test'), project(':spring-batch-integration')].each { subproject -> - into ("${baseDir}/libs") { - from subproject.jar - from subproject.sourcesJar - from subproject.javadocJar - } - } -} - -// Create an optional "with dependencies" distribution. -// Not published by default; only for use when building from source. -task depsZip(type: Zip, dependsOn: distZip) { zipTask -> - group = 'Distribution' - classifier = 'dist-with-deps' - description = "Builds -${classifier} archive, containing everything " + - "in the -${distZip.classifier} archive plus all dependencies." - - from zipTree(distZip.archivePath) - - gradle.taskGraph.whenReady { taskGraph -> - if (taskGraph.hasTask(":${zipTask.name}")) { - def projectNames = rootProject.subprojects*.name - def artifacts = new HashSet() - subprojects.each { subproject -> - subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts.each { artifact -> - def dependency = artifact.moduleVersion.id - if (!projectNames.contains(dependency.name)) { - artifacts << artifact.file - } - } - } - - zipTask.from(artifacts) { - into "${distZip.baseDir}/deps" - } - } - } -} - -artifacts { - archives distZip - archives docsZip - archives schemaZip -} - -task dist(dependsOn: assemble) { - group = 'Distribution' - description = 'Builds -dist, -docs and -schema distribution archives.' -} - -task runTck(dependsOn: subprojects.compileJava) { - - configurations { - tck { - transitive = true - } - antcp { - transitive = true - exclude module: 'ant' - } - } - - dependencies { - tck project(":spring-batch-core") - - tck "commons-pool:commons-pool:$commonsPoolVersion" - tck "javax.batch:javax.batch-api:$javaxBatchApiVersion" - tck "org.springframework:spring-core:$springVersion" - tck "org.springframework:spring-context:$springVersion" - tck "org.springframework:spring-beans:$springVersion" - tck 'commons-logging:commons-logging-api:1.1' - tck "org.springframework:spring-aop:$springVersion" - tck "org.springframework:spring-tx:$springVersion" - tck "org.springframework.retry:spring-retry:$springRetryVersion" - tck "org.hsqldb:hsqldb:$hsqldbVersion" - tck "org.springframework:spring-jdbc:$springVersion" - tck "com.thoughtworks.xstream:xstream:$xstreamVersion" - tck "org.codehaus.jettison:jettison:$jettisonVersion" - tck "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion" - tck "org.apache.derby:derby:$derbyVersion" - - antcp "ant-contrib:ant-contrib:1.0b3" - } - - doLast { - logger.info('tck dependencies: ' + configurations.tck.asPath) - def tckHome = project.hasProperty('TCK_HOME') ? getProperty('TCK_HOME') : System.getenv("JSR_352_TCK_HOME") - - assert tckHome : '''\ -tckHome is not set. Please set either the environment variable 'JSR_352_TCK_HOME' -or specify the Gradle property `TCK_HOME`, e.g: ./gradlew runTck -PTCK_HOME=/path/to/tck''' - - println "Using the JSR 352 TCK at: '$tckHome'" - - ant.taskdef resource: "net/sf/antcontrib/antcontrib.properties", - classpath: configurations.antcp.asPath - ant.properties['batch.impl.classes'] = configurations.tck.asPath - ant.ant antfile: "$tckHome/build.xml", target: "run", dir: "$tckHome" - } -} - -wrapper { - description = 'Generates gradlew[.bat] scripts' - gradleVersion = '4.10.3' -} diff --git a/build.properties b/build.properties deleted file mode 100644 index 76fddd2749..0000000000 --- a/build.properties +++ /dev/null @@ -1,15 +0,0 @@ -version=2.2.0 -integration.repo.dir=${basedir}/../integration-repo -ivy.cache.dir=${basedir}/../ivy-cache - -# For when releasing -#release.type=release -#build.stamp=RELEASE - -# For when releasing milestones -#release.type=milestone -#build.stamp=M1 - -# For development in trunk (the default) -#release.type=integration - diff --git a/buildSrc/src/main/groovy/org/springframework/build/gradle/MergePlugin.groovy b/buildSrc/src/main/groovy/org/springframework/build/gradle/MergePlugin.groovy deleted file mode 100644 index 1933dd0fb1..0000000000 --- a/buildSrc/src/main/groovy/org/springframework/build/gradle/MergePlugin.groovy +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright 2002-2015 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 - * - * 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. - */ - -package org.springframework.build.gradle - -import org.gradle.api.Project -import org.gradle.api.Action -import org.gradle.api.Plugin -import org.gradle.api.invocation.Gradle -import org.gradle.api.artifacts.Configuration -import org.gradle.api.artifacts.ProjectDependency -import org.gradle.api.artifacts.maven.Conf2ScopeMapping -import org.gradle.api.plugins.MavenPlugin -import org.gradle.plugins.ide.eclipse.EclipsePlugin -import org.gradle.plugins.ide.idea.IdeaPlugin -/** - * Gradle plugin that allows projects to merged together. Primarily developed to - * allow Spring to support multiple incompatible versions of third-party - * dependencies (for example Hibernate v3 and v4). - *

- * The 'merge' extension should be used to define how projects are merged, for example: - *

- * configure(subprojects) {
- *     apply plugin: MergePlugin
- * }
- *
- * project("myproject") {
- * }
- *
- * project("myproject-extra") {
- *     merge.into = project("myproject")
- * }
- * 
- *

- * This plugin adds two new configurations: - *