1 Star 0 Fork 0

Zzz/spring-amqp-copy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.gradle 18.24 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
buildscript {
ext.kotlinVersion = '1.3.61'
repositories {
maven { url 'https://repo.spring.io/plugins-release' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
}
}
plugins {
id 'base'
id 'project-report'
id 'idea'
id 'org.sonarqube' version '2.8'
id 'org.ajoberstar.grgit' version '4.0.1'
id 'io.spring.nohttp' version '0.0.4.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE' apply false
id 'com.jfrog.artifactory' version '4.13.0' apply false
id 'org.asciidoctor.jvm.pdf' version '3.1.0'
id 'org.asciidoctor.jvm.gems' version '3.1.0'
id 'org.asciidoctor.jvm.convert' version '3.1.0'
}
description = 'Spring AMQP'
ext {
isTravisBuild = System.getenv().get('TRAVIS') == 'true'
linkHomepage = 'https://projects.spring.io/spring-amqp'
linkCi = 'https://build.spring.io/browse/AMQP'
linkIssue = 'https://jira.spring.io/browse/AMQP'
linkScmUrl = 'https://github.com/spring-projects/spring-amqp'
linkScmConnection = 'git://github.com/spring-projects/spring-amqp.git'
linkScmDevConnection = 'git@github.com:spring-projects/spring-amqp.git'
docResourcesVersion = '0.2.1.RELEASE'
modifiedFiles =
files(grgit.status().unstaged.modified).filter{ f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }
assertjVersion = '3.15.0'
assertkVersion = '0.20'
awaitilityVersion = '4.0.3'
commonsHttpClientVersion = '4.5.10'
commonsPoolVersion = '2.8.0'
googleJsr305Version = '3.0.2'
hamcrestVersion = '2.2'
jacksonVersion = '2.10.3'
jaywayJsonPathVersion = '2.4.0'
junit4Version = '4.12'
junitJupiterVersion = '5.6.0'
log4jVersion = '2.12.1'
logbackVersion = '1.2.3'
micrometerVersion = '1.5.3'
mockitoVersion = '3.4.6'
rabbitmqVersion = project.hasProperty('rabbitmqVersion') ? project.rabbitmqVersion : '5.9.0'
rabbitmqHttpClientVersion = '3.2.0.RELEASE'
reactorVersion = '2020.0.0-RC1'
springDataCommonsVersion = '2.4.0-RC1'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.3.0-RC1'
springRetryVersion = '1.3.0'
}
nohttp {
source.include '**/src/**'
source.exclude '**/*.gif', '**/*.ks'
}
allprojects {
group = 'org.springframework.amqp'
apply plugin: 'io.spring.dependency-management'
dependencyManagement {
resolutionStrategy {
cacheChangingModulesFor 0, 'seconds'
}
applyMavenExclusions = false
generatedPomCustomization {
enabled = false
}
imports {
mavenBom "com.fasterxml.jackson:jackson-bom:$jacksonVersion"
mavenBom "org.junit:junit-bom:$junitJupiterVersion"
mavenBom "org.springframework:spring-framework-bom:$springVersion"
mavenBom "io.projectreactor:reactor-bom:$reactorVersion"
mavenBom "org.apache.logging.log4j:log4j-bom:$log4jVersion"
}
}
repositories {
maven { url 'https://repo.spring.io/libs-release' }
if (version.endsWith('-SNAPSHOT')) {
maven { url 'https://repo.spring.io/libs-snapshot' }
}
// maven { url 'https://repo.spring.io/libs-staging-local' }
}
}
ext {
expandPlaceholders = '**/quick-tour.xml'
javadocLinks = [
'https://docs.oracle.com/javase/8/docs/api/',
'https://docs.oracle.com/javaee/7/api/',
'https://docs.spring.io/spring/docs/current/javadoc-api/'
] as String[]
}
subprojects { subproject ->
apply plugin: 'java-library'
apply plugin: 'java'
apply from: "${rootProject.projectDir}/publish-maven.gradle"
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'project-report'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
apply plugin: 'kotlin'
apply plugin: 'kotlin-spring'
java {
withJavadocJar()
withSourcesJar()
registerFeature('optional') {
usingSourceSet(sourceSets.main)
}
registerFeature('provided') {
usingSourceSet(sourceSets.main)
}
}
compileJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
eclipse {
project {
natures += 'org.springframework.ide.eclipse.core.springnature'
}
}
jacoco {
toolVersion = '0.8.5'
}
// dependencies that are common across all java projects
dependencies {
compileOnly "com.google.code.findbugs:jsr305:$googleJsr305Version"
testImplementation 'org.apache.logging.log4j:log4j-core'
testImplementation "org.hamcrest:hamcrest-core:$hamcrestVersion"
testImplementation ("org.mockito:mockito-core:$mockitoVersion") {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion"
testImplementation 'org.springframework:spring-test'
testRuntimeOnly 'org.apache.logging.log4j:log4j-jcl'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.jupiter:junit-jupiter-params'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
testImplementation 'org.junit.platform:junit-platform-launcher'
testImplementation("org.awaitility:awaitility:$awaitilityVersion") {
exclude group: 'org.hamcrest'
}
// To avoid compiler warnings about @API annotations in JUnit code
testCompileOnly 'org.apiguardian:apiguardian-api:1.0.0'
testCompileOnly "com.google.code.findbugs:jsr305:$googleJsr305Version"
testImplementation 'org.jetbrains.kotlin:kotlin-reflect'
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
}
// enable all compiler warnings; individual projects may customize further
ext.xLintArg = '-Xlint:all,-options,-processing'
[compileJava, compileTestJava]*.options*.compilerArgs = [xLintArg]
publishing {
publications {
mavenJava(MavenPublication) {
suppressAllPomMetadataWarnings()
from components.java
pom.withXml {
def pomDeps = asNode().dependencies.first()
subproject.configurations.providedImplementation.allDependencies.each { dep ->
pomDeps.remove(pomDeps.'*'.find { it.artifactId.text() == dep.name })
pomDeps.appendNode('dependency').with {
it.appendNode('groupId', dep.group)
it.appendNode('artifactId', dep.name)
it.appendNode('version', dep.version)
it.appendNode('scope', 'provided')
}
}
}
}
}
}
task updateCopyrights {
onlyIf { !System.getenv('TRAVIS') && !System.getenv('bamboo_buildKey') }
inputs.files(modifiedFiles.filter { f -> f.path.contains(subproject.name) })
outputs.dir('build/classes')
doLast {
def now = Calendar.instance.get(Calendar.YEAR) as String
inputs.files.each { file ->
def line
file.withReader { reader ->
while (line = reader.readLine()) {
def matcher = line =~ /Copyright (20\d\d)-?(20\d\d)?/
if (matcher.count) {
def beginningYear = matcher[0][1]
if (now != beginningYear && now != matcher[0][2]) {
def years = "$beginningYear-$now"
def sourceCode = file.text
sourceCode = sourceCode.replaceFirst(/20\d\d(-20\d\d)?/, years)
file.text = sourceCode
println "Copyright updated for file: $file"
}
break
}
}
}
}
}
}
compileKotlin.dependsOn updateCopyrights
test {
jacoco {
destinationFile = file("$buildDir/jacoco.exec")
}
if (isTravisBuild) {
// restrict memory usage, so tests don't fail with exit code 137 on travis
maxHeapSize = '256m'
}
}
task testAll(type: Test, dependsOn: check)
gradle.taskGraph.whenReady { graph ->
if (graph.hasTask(testAll)) {
test.enabled = false
}
}
tasks.withType(Test).all {
// suppress all console output during testing unless running `gradle -i`
logging.captureStandardOutput(LogLevel.INFO)
if (name ==~ /(testAll)/) {
systemProperty 'RUN_LONG_INTEGRATION_TESTS', 'true'
}
useJUnitPlatform()
}
checkstyle {
configDirectory.set(rootProject.file("src/checkstyle"))
toolVersion = '8.24'
}
jar {
manifest {
attributes(
'Implementation-Version': archiveVersion,
'Created-By': "JDK ${System.properties['java.version']} (${System.properties['java.specification.vendor']})",
'Implementation-Title': subproject.name,
'Implementation-Vendor-Id': subproject.group,
'Implementation-Vendor': 'Pivotal Software, Inc.',
'Implementation-URL': linkHomepage,
'Automatic-Module-Name': subproject.name.replace('-', '.') // for Jigsaw
)
}
from("${rootProject.projectDir}/src/dist") {
include 'license.txt'
include 'notice.txt'
into 'META-INF'
expand(copyright: new Date().format('yyyy'), version: project.version)
}
}
check.dependsOn javadoc
build.dependsOn jacocoTestReport
}
project('spring-amqp') {
description = 'Spring AMQP Core'
dependencies {
api 'org.springframework:spring-core'
optionalApi 'org.springframework:spring-messaging'
optionalApi 'org.springframework:spring-oxm'
optionalApi 'org.springframework:spring-context'
api ("org.springframework.retry:spring-retry:$springRetryVersion") {
exclude group: 'org.springframework'
}
optionalApi 'com.fasterxml.jackson.core:jackson-core'
optionalApi 'com.fasterxml.jackson.core:jackson-databind'
optionalApi 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml'
// Spring Data projection message binding support
optionalApi ("org.springframework.data:spring-data-commons:$springDataCommonsVersion") {
exclude group: 'org.springframework'
}
optionalApi "com.jayway.jsonpath:json-path:$jaywayJsonPathVersion"
testImplementation "org.assertj:assertj-core:$assertjVersion"
}
}
project('spring-rabbit') {
description = 'Spring RabbitMQ Support'
dependencies {
api project(':spring-amqp')
api "com.rabbitmq:amqp-client:$rabbitmqVersion"
optionalApi "com.rabbitmq:http-client:$rabbitmqHttpClientVersion"
optionalApi 'org.springframework:spring-aop'
api 'org.springframework:spring-context'
api 'org.springframework:spring-messaging'
api 'org.springframework:spring-tx'
optionalApi 'io.projectreactor:reactor-core'
optionalApi "ch.qos.logback:logback-classic:$logbackVersion"
optionalApi 'org.apache.logging.log4j:log4j-core'
optionalApi "io.micrometer:micrometer-core:$micrometerVersion"
// Spring Data projection message binding support
optionalApi ("org.springframework.data:spring-data-commons:$springDataCommonsVersion") {
exclude group: 'org.springframework'
}
optionalApi "com.jayway.jsonpath:json-path:$jaywayJsonPathVersion"
optionalApi "org.apache.commons:commons-pool2:$commonsPoolVersion"
testApi project(':spring-rabbit-junit')
testImplementation("com.willowtreeapps.assertk:assertk-jvm:$assertkVersion")
testRuntimeOnly 'org.springframework:spring-web'
testRuntimeOnly "org.apache.httpcomponents:httpclient:$commonsHttpClientVersion"
testRuntimeOnly 'com.fasterxml.jackson.core:jackson-core'
testRuntimeOnly 'com.fasterxml.jackson.core:jackson-databind'
testRuntimeOnly 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml'
testRuntimeOnly 'com.fasterxml.jackson.module:jackson-module-kotlin'
testRuntimeOnly ("junit:junit:$junit4Version") {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = '1.8'
}
}
}
project('spring-rabbit-junit') {
description = 'Spring Rabbit JUnit Support'
dependencies { // no spring-amqp dependencies allowed
api 'org.springframework:spring-core'
api 'org.springframework:spring-test'
optionalApi ("junit:junit:$junit4Version") {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
api "com.rabbitmq:amqp-client:$rabbitmqVersion"
api ("com.rabbitmq:http-client:$rabbitmqHttpClientVersion") {
exclude group: 'org.springframework', module: 'spring-web'
}
api 'org.springframework:spring-web'
api 'org.junit.jupiter:junit-jupiter-api'
api "org.assertj:assertj-core:$assertjVersion"
optionalApi "ch.qos.logback:logback-classic:$logbackVersion"
optionalApi 'org.apache.logging.log4j:log4j-core'
compileOnly 'org.apiguardian:apiguardian-api:1.0.0'
}
}
project('spring-rabbit-test') {
description = 'Spring Rabbit Test Support'
dependencies {
api project(':spring-rabbit')
api project(':spring-rabbit-junit')
api "org.hamcrest:hamcrest-library:$hamcrestVersion"
api "org.hamcrest:hamcrest-core:$hamcrestVersion"
api "org.mockito:mockito-core:$mockitoVersion"
testImplementation project(':spring-rabbit').sourceSets.test.output
}
}
configurations {
docs
}
dependencies {
docs "io.spring.docresources:spring-doc-resources:${docResourcesVersion}@zip"
}
task prepareAsciidocBuild(type: Sync) {
dependsOn configurations.docs
from {
configurations.docs.collect { zipTree(it) }
}
from 'src/reference/asciidoc/'
into "$buildDir/asciidoc"
}
asciidoctorPdf {
dependsOn prepareAsciidocBuild
baseDirFollowsSourceFile()
asciidoctorj {
sourceDir "$buildDir/asciidoc"
inputs.dir(sourceDir)
sources {
include 'index.adoc'
}
options doctype: 'book'
attributes 'icons': 'font',
'sectanchors': '',
'sectnums': '',
'toc': '',
'source-highlighter' : 'coderay',
revnumber: project.version,
'project-version': project.version
}
}
asciidoctor {
dependsOn asciidoctorPdf
baseDirFollowsSourceFile()
sourceDir "$buildDir/asciidoc"
resources {
from(sourceDir) {
include 'images/*', 'css/**', 'js/**'
}
}
options doctype: 'book', eruby: 'erubis'
attributes 'docinfo': 'shared',
stylesdir: "css/",
stylesheet: 'spring.css',
'linkcss': true,
'icons': 'font',
'sectanchors': '',
'source-highlighter': 'highlight.js',
'highlightjsdir': 'js/highlight',
'highlightjs-theme': 'github',
'idprefix': '',
'idseparator': '-',
'spring-version': project.version,
'allow-uri-read': '',
'toc': 'left',
'toclevbels': '4',
revnumber: project.version,
'project-version': project.version
}
task reference(dependsOn: asciidoctor) {
group = 'Documentation'
description = 'Generate the reference documentation'
}
sonarqube {
properties {
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 = "${rootProject.description} ${version} API"
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = rootProject.description
options.overview = 'src/api/overview.html'
options.stylesheetFile = file('src/api/stylesheet.css')
options.links(rootProject.ext.javadocLinks)
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'
archiveClassifier = 'schema'
description = "Builds -${archiveClassifier} archive containing all " +
"XSDs for deployment at static.springframework.org/schema."
subprojects.each { subproject ->
def Set files = new HashSet()
def Properties schemas = new Properties();
def shortName = subproject.name.replaceFirst("${rootProject.name}-", '')
if (subproject.name.endsWith('-rabbit')) {
shortName = 'rabbit'
}
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
if (!files.contains(xsdFile.path)) {
into ("${shortName}") {
from xsdFile.path
rename { String fileName ->
String[] versionNumbers = project.version.split(/\./, 3)
fileName.replace('.xsd', "-${versionNumbers[0]}.${versionNumbers[1]}.xsd")
}
}
files.add(xsdFile.path)
}
}
}
}
task docsZip(type: Zip, dependsOn: [reference]) {
group = 'Distribution'
archiveClassifier = 'docs'
description = "Builds -${archiveClassifier} archive containing api and reference " +
"for deployment at static.springframework.org/spring-integration/docs."
from('src/dist') {
include 'changelog.txt'
}
from (api) {
into 'api'
}
from ('build/docs/asciidoc') {
into 'reference/html'
}
from ('build/docs/asciidocPdf') {
include 'index.pdf'
rename 'index.pdf', 'spring-amqp-reference.pdf'
into 'reference/pdf'
}
}
task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
group = 'Distribution'
archiveClassifier = 'dist'
description = "Builds -${archiveClassifier} archive, containing all jars and docs, " +
"suitable for community download page."
ext.baseDir = "${project.name}-${project.version}";
from('src/dist') {
include 'README.md'
include 'apache-license.txt'
include 'epl-license.txt'
include 'notice.txt'
into "${baseDir}"
}
from(zipTree(docsZip.archivePath)) {
into "${baseDir}/docs"
}
from(zipTree(schemaZip.archivePath)) {
into "${baseDir}/schema"
}
subprojects.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'
archiveClassifier = 'dist-with-deps'
description = "Builds -${archiveClassifier} archive, containing everything " +
"in the -${distZip.archiveClassifier} 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"
}
}
}
}
tasks.build.dependsOn assemble
artifacts {
archives distZip
archives docsZip
archives schemaZip
}
task dist(dependsOn: assemble) {
group = 'Distribution'
description = 'Builds -dist, -docs and -schema distribution archives.'
}
apply from: "${rootProject.projectDir}/publish-maven.gradle"
publishing {
publications {
mavenJava(MavenPublication) {
artifact docsZip
artifact distZip
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/huz/spring-amqp-copy.git
git@gitee.com:huz/spring-amqp-copy.git
huz
spring-amqp-copy
spring-amqp-copy
master

搜索帮助