upgrade versions
Conflicts:
spring-integration-splunk/gradle.properties
upgrade gradle version
revert spring integration upgrade version
Add a feature to be able to declare more than one splunk server.
It's a simple failover mechanism with any pooling.
Before give back the Service instance, the framework just try a getInfo call.
To preserve backward compat this check it's not activated per default but only
if the splunk server instance is marked with testOnBorrow.
Sample:
````xml
<int-splunk:server id="splunkServer" host="${splunk.server.host}" port="${splunk.server.port}"
username="${splunk.server.username}" password="${splunk.server.password}"
owner="${splunk.server.owner}" scheme="${splunk.server.scheme}" testOnBorrow="true" />
<int-splunk:server id="splunkServerBackup" host="localhost" port="9999"
username="${splunk.server.username}" password="${splunk.server.password}"
owner="${splunk.server.owner}" scheme="${splunk.server.scheme}" testOnBorrow="true" />
<util:list id="splunkServersList">
<ref bean="splunkServer" />
<ref bean="splunkServerBackup" />
</util:list>
<bean id="splunkServiceFactory" class="org.springframework.integration.splunk.support.SplunkServiceFactory">
<constructor-arg ref="splunkServersList"/>
</bean>
<int-splunk:inbound-channel-adapter id="splunk-notify-order-status-change-channel"
auto-startup="true"
search=""
splunk-server-ref="splunkServer;splunkServerBackup"
channel="notify-order-status-change-input"
mode="BLOCKING"
init-earliest-time="${splunk.order-status-change.init-earliest-time}"
>
<int:poller fixed-rate="${splunk.order-status-change.pooling.rate.time}" time-unit="SECONDS"/>
</int-splunk:inbound-channel-adapter>
````
some changes due to pr comments
Conflicts:
spring-integration-splunk/gradle.properties
formatting: tabs instead of spaces.....
fix documentation with failover mechanism
formatting
formatting
upgrade versions
some changes due to pr comments
fix javadoc issues
1.1 xsd file
Polishing and upgrading
258 lines
6.8 KiB
Groovy
258 lines
6.8 KiB
Groovy
description = 'Spring Integration Splunk Adapter'
|
|
|
|
buildscript {
|
|
repositories {
|
|
maven { url 'http://repo.spring.io/plugins-release' }
|
|
}
|
|
dependencies {
|
|
classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.2.8'
|
|
}
|
|
}
|
|
|
|
apply plugin: 'java'
|
|
apply from: "${rootProject.projectDir}/publish-maven.gradle"
|
|
apply plugin: 'eclipse'
|
|
apply plugin: 'idea'
|
|
|
|
group = 'org.springframework.integration'
|
|
|
|
repositories {
|
|
maven { url 'http://repo.spring.io/libs-milestone' }
|
|
}
|
|
|
|
sourceCompatibility=1.6
|
|
targetCompatibility=1.6
|
|
|
|
ext {
|
|
linkHomepage = 'https://github.com/spring-projects/spring-integration-extensions'
|
|
linkCi = 'https://build.spring.io/browse/INTEXT'
|
|
linkIssue = 'https://jira.spring.io/browse/INTEXT'
|
|
linkScmUrl = 'https://github.com/spring-projects/spring-integration-extensions'
|
|
linkScmConnection = 'https://github.com/spring-projects/spring-integration-extensions.git'
|
|
linkScmDevConnection = 'git@github.com:spring-projects/spring-integration-extensions.git'
|
|
|
|
shortName = 'splunk'
|
|
}
|
|
|
|
// See http://www.gradle.org/docs/current/userguide/dependency_management.html#sub:configurations
|
|
// and http://www.gradle.org/docs/current/dsl/org.gradle.api.artifacts.ConfigurationContainer.html
|
|
configurations {
|
|
jacoco //Configuration Group used by Sonar to provide Code Coverage using JaCoCo
|
|
}
|
|
|
|
dependencies {
|
|
compile "com.splunk:splunk:$splunkVersion"
|
|
compile "org.springframework.integration:spring-integration-core:$springIntegrationVersion"
|
|
compile "joda-time:joda-time:$jodaTimeVersion"
|
|
compile "commons-pool:commons-pool:$commonsPoolVersion"
|
|
|
|
testCompile "org.mockito:mockito-all:$mockitoVersion"
|
|
testCompile "org.springframework.integration:spring-integration-test:$springIntegrationVersion"
|
|
testCompile "junit:junit-dep:$junitVersion"
|
|
testCompile "log4j:log4j:$log4jVersion"
|
|
testCompile "org.springframework.integration:spring-integration-stream:$springIntegrationVersion"
|
|
jacoco group: "org.jacoco", name: "org.jacoco.agent", version: "0.5.6.201201232323", classifier: "runtime"
|
|
}
|
|
|
|
|
|
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,-options'
|
|
[compileJava, compileTestJava]*.options*.compilerArgs = [xLintArg]
|
|
|
|
test {
|
|
// suppress all console output during testing unless running `gradle -i`
|
|
logging.captureStandardOutput(LogLevel.INFO)
|
|
jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=*"
|
|
}
|
|
|
|
task sourcesJar(type: Jar) {
|
|
classifier = 'sources'
|
|
from sourceSets.main.allJava
|
|
}
|
|
|
|
task javadocJar(type: Jar) {
|
|
classifier = 'javadoc'
|
|
from javadoc
|
|
}
|
|
|
|
artifacts {
|
|
archives sourcesJar
|
|
archives javadocJar
|
|
}
|
|
|
|
apply plugin: 'docbook-reference'
|
|
|
|
reference {
|
|
sourceDir = file('src/reference/docbook')
|
|
}
|
|
|
|
apply plugin: 'sonar-runner'
|
|
|
|
sonarRunner {
|
|
sonarProperties {
|
|
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'
|
|
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."
|
|
|
|
def Properties schemas = new Properties();
|
|
|
|
project.sourceSets.main.resources.find {
|
|
it.path.endsWith('META-INF/spring.schemas')
|
|
}?.withInputStream { schemas.load(it) }
|
|
|
|
for (def key : schemas.keySet()) {
|
|
File xsdFile = project.sourceSets.main.resources.find {
|
|
it.path.endsWith(schemas.get(key))
|
|
}
|
|
assert xsdFile != null
|
|
into ("integration/${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-integration/docs."
|
|
|
|
from('src/dist') {
|
|
include 'changelog.txt'
|
|
}
|
|
|
|
from (api) {
|
|
into 'api'
|
|
}
|
|
|
|
from (reference) {
|
|
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}"
|
|
}
|
|
|
|
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'
|
|
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 wrapper(type: Wrapper) {
|
|
description = 'Generates gradlew[.bat] scripts'
|
|
gradleVersion = '1.12'
|
|
distributionUrl = "http://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
|
|
}
|
|
|
|
defaultTasks 'build'
|