Standardize Build

Fixes gh-769
This commit is contained in:
Rob Winch
2017-02-03 22:31:18 -06:00
parent e23aaeca5f
commit d590ca58e4
87 changed files with 710 additions and 1257 deletions

View File

@@ -1,92 +1,21 @@
buildscript { buildscript {
repositories {
maven { url "https://repo.spring.io/plugins-release" }
}
dependencies { dependencies {
classpath 'io.spring.gradle:dependency-management-plugin:1.0.2.RELEASE' classpath 'io.spring.gradle:spring-build-conventions:0.0.1.BUILD-SNAPSHOT'
classpath("com.bmuschko:gradle-tomcat-plugin:2.2.5") classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7") }
classpath("io.spring.gradle:spring-io-plugin:0.0.6.RELEASE") repositories {
classpath('me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1') maven { url 'https://repo.spring.io/libs-snapshot' }
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.2' maven { url 'https://repo.spring.io/plugins-snapshot' }
classpath 'com.github.ben-manes:gradle-versions-plugin:0.12.0'
} }
} }
apply plugin: 'io.spring.convention.root'
plugins {
id "org.sonarqube" version "2.1"
id "io.spring.dependency-management" version "1.0.2.RELEASE"
}
group = 'org.springframework.session' group = 'org.springframework.session'
description = 'Spring Session'
ext.springBootVersion = '2.0.0.BUILD-SNAPSHOT'
ext.IDE_GRADLE = "$rootDir/gradle/ide.gradle"
ext.JAVA_GRADLE = "$rootDir/gradle/java.gradle"
ext.SPRING3_GRADLE = "$rootDir/gradle/spring3.gradle"
ext.MAVEN_GRADLE = "$rootDir/gradle/publish-maven.gradle"
ext.BOM_GRADLE = "$rootDir/gradle/bom.gradle"
ext.SAMPLE_GRADLE = "$rootDir/gradle/sample.gradle"
ext.TOMCAT_GRADLE = "$rootDir/gradle/tomcat.gradle"
ext.TOMCAT_6_GRADLE = "$rootDir/gradle/tomcat6.gradle"
ext.TOMCAT_7_GRADLE = "$rootDir/gradle/tomcat7.gradle"
ext.releaseBuild = version.endsWith('RELEASE') ext.releaseBuild = version.endsWith('RELEASE')
ext.snapshotBuild = version.endsWith('SNAPSHOT') ext.snapshotBuild = version.endsWith('SNAPSHOT')
ext.milestoneBuild = !(releaseBuild || snapshotBuild) ext.milestoneBuild = !(releaseBuild || snapshotBuild)
apply plugin: 'base'
apply from: JAVA_GRADLE
dependencyManagement {
imports {
mavenBom "org.springframework.data:spring-data-releasetrain:$springDataReleaseTrainVersion"
}
}
def managedVersions = dependencyManagement.managedVersions
//println "ManagedVersions Count: " + managedVersions.size()
//managedVersions.each { entry -> println entry }
ext.springDataGemFireVersion = managedVersions['org.springframework.data:spring-data-gemfire']
ext.springDataMongoDBVersion = managedVersions['org.springframework.data:spring-data-mongodb']
ext.springDataRedisVersion = managedVersions['org.springframework.data:spring-data-redis']
sonarqube {
properties {
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.projectName", "Spring Session"
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
property "sonar.links.homepage", 'https://github.com/spring-projects/spring-session'
property "sonar.links.ci", 'https://build.spring.io/browse/SESSION'
property "sonar.links.issue", 'https://github.com/spring-projects/spring-session/issues'
property "sonar.links.scm", 'https://github.com/spring-projects/spring-session'
property "sonar.links.scm_dev", 'https://github.com/spring-projects/spring-session.git'
property "sonar.java.coveragePlugin", "jacoco"
}
}
task configDocsZip(dependsOn: [':docs:asciidoctor',':spring-session:javadoc']) {
doLast {
project.tasks.docsZip.from(project(':docs').asciidoctor) {
into('reference')
}
project.tasks.docsZip.from(project(':spring-session').javadoc) {
into('api')
}
}
}
task docsZip(type: Zip, dependsOn: 'configDocsZip') {
group = "Distribution"
baseName = "spring-session"
classifier = "docs"
description = "Builds -${classifier} archive containing api and reference " +
"for deployment."
}
artifacts {
archives docsZip
}

View File

@@ -0,0 +1,70 @@
package build;
import org.gradle.api.plugins.JavaPlugin
import org.gradle.api.tasks.bundling.Zip
import org.gradle.api.DefaultTask
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.tasks.TaskAction
public class GemFireServerPlugin implements Plugin<Project> {
@Override
public void apply(Project project) {
project.tasks.create('gemFireServer', GemFireServerTask)
project.tasks.integrationTest.doLast {
println 'Stopping GemFire Server...'
project.tasks.gemFireServer.process?.destroyForcibly()
}
project.tasks.prepareAppServerForIntegrationTests {
dependsOn project.tasks.gemFireServer
doFirst {
project.gretty {
jvmArgs = ["-Dspring.session.data.gemfire.port=${project.tasks.gemFireServer.port}"]
}
}
}
}
static int availablePort() {
new ServerSocket(0).withCloseable { socket ->
socket.localPort
}
}
static class GemFireServerTask extends DefaultTask {
def mainClassName = "sample.ServerConfig"
def process
def port
boolean debug
@TaskAction
def greet() {
port = availablePort()
println "Starting GemFire Server on port [$port]..."
def out = debug ? System.out : new StringBuilder()
def err = debug ? System.out : new StringBuilder()
String classpath = project.sourceSets.main.runtimeClasspath.collect { it }.join(File.pathSeparator)
String gemfireLogLevel = System.getProperty('spring.session.data.gemfire.log-level', 'warning')
String[] commandLine = [
'java', '-server', '-ea', '-classpath', classpath,
//"-Dgemfire.log-file=gemfire-server.log",
//"-Dgemfire.log-level=config",
"-Dspring.session.data.gemfire.log-level=" + gemfireLogLevel,
"-Dspring.session.data.gemfire.port=${port}",
'sample.ServerConfig'
]
//println commandLine
project.tasks.appRun.ext.process = process = commandLine.execute()
process.consumeProcessOutput(out, err)
}
}
}

View File

@@ -0,0 +1 @@
implementation-class=build.GemFireServerPlugin

View File

@@ -1,75 +0,0 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.kordamp.gradle:livereload-gradle-plugin:0.2.1'
}
}
apply plugin: 'org.kordamp.gradle.livereload'
apply from: JAVA_GRADLE
apply plugin: 'org.asciidoctor.convert'
liveReload {
docRoot asciidoctor.sourceDir.canonicalPath
}
asciidoctorj {
}
tasks.findByPath("artifactoryPublish")?.enabled = false
dependencies {
testCompile project(':spring-session'),
project(':spring-session-data-gemfire'),
project(':spring-session-data-mongo'),
project(':spring-session-data-redis'),
"org.springframework:spring-jdbc:${springVersion}",
"org.springframework:spring-messaging:${springVersion}",
"org.springframework:spring-webmvc:${springVersion}",
"org.springframework:spring-websocket:${springVersion}",
"org.springframework.security:spring-security-config:${springSecurityVersion}",
"org.springframework.security:spring-security-web:${springSecurityVersion}",
"org.springframework.security:spring-security-test:${springSecurityVersion}",
"junit:junit:$junitVersion",
"org.mockito:mockito-core:$mockitoVersion",
"org.springframework:spring-test:$springVersion",
"org.assertj:assertj-core:$assertjVersion",
"com.hazelcast:hazelcast:$hazelcastVersion",
"io.lettuce:lettuce-core:$lettuceVersion",
"javax.servlet:javax.servlet-api:$servletApiVersion"
}
asciidoctor {
def ghTag = snapshotBuild ? 'master' : project.version
def ghUrl = "https://github.com/spring-projects/spring-session/tree/$ghTag"
attributes 'version-snapshot': snapshotBuild,
'version-milestone': milestoneBuild,
'version-release': releaseBuild,
'gh-url': ghUrl,
'gh-samples-url': "$ghUrl/samples/",
'download-url' : "https://github.com/spring-projects/spring-session/archive/${ghTag}.zip",
'spring-session-version' : version,
'spring-version' : springVersion,
'lettuce-version' : lettuceVersion,
'hazelcast-version' : hazelcastVersion,
'docs-itest-dir' : rootProject.projectDir.path + '/docs/src/integration-test/java/',
'docs-test-dir' : rootProject.projectDir.path + '/docs/src/test/java/',
'docs-test-resources-dir' : rootProject.projectDir.path + '/docs/src/test/resources/',
'samples-dir' : rootProject.projectDir.path + '/samples/',
'session-main-resources-dir' : rootProject.projectDir.path + '/spring-session/src/main/resources/',
'source-highlighter' : 'coderay',
'imagesdir':'./images',
'icons': 'font',
'sectanchors':'',
'idprefix':'',
'idseparator':'-',
'docinfo1':'true',
'revnumber' : project.version
}
eclipse.project.name = 'spring-session-docs'

View File

@@ -0,0 +1,45 @@
apply plugin: 'io.spring.convention.docs'
apply plugin: 'io.spring.convention.spring-test'
dependencies {
testCompile project(':spring-session')
testCompile project(':spring-session-data-gemfire')
testCompile project(':spring-session-data-mongo')
testCompile project(':spring-session-data-redis')
testCompile "org.springframework:spring-jdbc"
testCompile "org.springframework:spring-messaging"
testCompile "org.springframework:spring-webmvc"
testCompile "org.springframework:spring-websocket"
testCompile "org.springframework.security:spring-security-config"
testCompile "org.springframework.security:spring-security-web"
testCompile "org.springframework.security:spring-security-test"
testCompile "junit:junit"
testCompile "org.mockito:mockito-core"
testCompile "org.springframework:spring-test"
testCompile "org.assertj:assertj-core"
testCompile "com.hazelcast:hazelcast"
testCompile "io.lettuce:lettuce-core"
testCompile "javax.servlet:javax.servlet-api"
}
def versions = dependencyManagement.managedVersions
asciidoctor {
def ghTag = snapshotBuild ? 'master' : project.version
def ghUrl = "https://github.com/spring-projects/spring-session/tree/$ghTag"
attributes 'version-snapshot': snapshotBuild,
'version-milestone': milestoneBuild,
'version-release': releaseBuild,
'gh-url': ghUrl,
'gh-samples-url': "$ghUrl/samples/",
'download-url' : "https://github.com/spring-projects/spring-session/archive/${ghTag}.zip",
'spring-session-version' : version,
'spring-version' : versions['org.springframework:spring-core'],
'lettuce-version' : versions['io.lettuce:lettuce-core'],
'hazelcast-version' : versions['com.hazelcast:hazelcast'],
'docs-itest-dir' : rootProject.projectDir.path + '/docs/src/integration-test/java/',
'docs-test-dir' : rootProject.projectDir.path + '/docs/src/test/java/',
'docs-test-resources-dir' : rootProject.projectDir.path + '/docs/src/test/resources/',
'samples-dir' : rootProject.projectDir.path + '/samples/',
'session-main-resources-dir' : rootProject.projectDir.path + '/spring-session/src/main/resources/'
}

View File

@@ -24,8 +24,8 @@ If you are using Maven, ensure to add the following dependencies:
<type>pom</type> <type>pom</type>
</dependency> </dependency>
<dependency> <dependency>
<groupId>biz.paluch.redis</groupId> <groupId>io.lettuce</groupId>
<artifactId>lettuce</artifactId> <artifactId>lettuce-core</artifactId>
<version>{lettuce-version}</version> <version>{lettuce-version}</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@@ -24,8 +24,8 @@ If you are using Maven, ensure to add the following dependencies:
<type>pom</type> <type>pom</type>
</dependency> </dependency>
<dependency> <dependency>
<groupId>biz.paluch.redis</groupId> <groupId>io.lettuce</groupId>
<artifactId>lettuce</artifactId> <artifactId>lettuce-core</artifactId>
<version>{lettuce-version}</version> <version>{lettuce-version}</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@@ -25,8 +25,8 @@ If you are using Maven, ensure to add the following dependencies:
<type>pom</type> <type>pom</type>
</dependency> </dependency>
<dependency> <dependency>
<groupId>biz.paluch.redis</groupId> <groupId>io.lettuce</groupId>
<artifactId>lettuce</artifactId> <artifactId>lettuce-core</artifactId>
<version>{lettuce-version}</version> <version>{lettuce-version}</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@@ -24,8 +24,8 @@ If you are using Maven, ensure to add the following dependencies:
<type>pom</type> <type>pom</type>
</dependency> </dependency>
<dependency> <dependency>
<groupId>biz.paluch.redis</groupId> <groupId>io.lettuce</groupId>
<artifactId>lettuce</artifactId> <artifactId>lettuce-core</artifactId>
<version>{lettuce-version}</version> <version>{lettuce-version}</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@@ -1,25 +1,3 @@
assertjVersion=2.5.0
bootstrapVersion=2.3.2
commonsLoggingVersion=1.2
commonsPoolVersion=2.4.2
h2Version=1.4.192
hazelcastVersion=3.6.5
html5ShivVersion=3.7.3
htmlUnitVersion=2.24
httpClientVersion=4.5.1
jacksonVersion=2.9.0.pr2
jedisVersion=2.9.0
jspApiVersion=2.0
jstlVersion=1.2.1
jstlelVersion=1.2.5
junitVersion=4.12
lettuceVersion=5.0.0.BUILD-SNAPSHOT
mockitoVersion=2.5.4
seleniumVersion=3.1.0
servletApiVersion=3.0.1
springVersion=5.0.0.BUILD-SNAPSHOT
springDataReleaseTrainVersion=Kay-BUILD-SNAPSHOT
springSecurityVersion=4.2.2.BUILD-SNAPSHOT
springShellVersion=1.1.0.RELEASE
webjarsTaglibVersion=0.3
version=2.0.0.BUILD-SNAPSHOT version=2.0.0.BUILD-SNAPSHOT
springBootVersion=2.0.0.BUILD-SNAPSHOT
springIoVersion=Cairo-BUILD-SNAPSHOT

View File

@@ -0,0 +1,9 @@
com.maxmind.geoip2\:geoip2=2.3.1
edu.umd.cs.mtc\:multithreadedtc=1.01
org.springframework.shell\:spring-shell=1.1.0.RELEASE
org.webjars\:bootstrap=2.3.2
org.webjars\:html5shiv=3.7.3
org.webjars\:knockout=2.3.0
org.webjars\:sockjs-client=0.3.4
org.webjars\:stomp-websocket=2.3.0
org.webjars\:webjars-taglib=0.3

View File

@@ -1,57 +0,0 @@
buildscript {
repositories {
mavenCentral()
maven { url "https://repo.spring.io/plugins-snapshot" }
}
dependencies {
classpath 'io.spring.gradle:dependency-management-plugin:1.0.2.RELEASE'
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
}
}
apply from: JAVA_GRADLE
apply from: SAMPLE_GRADLE
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'samples'
ext['spring-data-releasetrain.version'] = springDataReleaseTrainVersion
dependencies {
compile project(':spring-session-data-redis'),
"org.springframework.boot:spring-boot-starter-security",
"org.springframework.boot:spring-boot-starter-thymeleaf",
"org.springframework.boot:spring-boot-starter-web",
"nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:html5shiv:$html5ShivVersion",
"org.webjars:webjars-locator",
"com.maxmind.geoip2:geoip2:2.3.1",
"org.apache.httpcomponents:httpclient"
testCompile "org.springframework.boot:spring-boot-starter-test",
"org.assertj:assertj-core:$assertjVersion"
integrationTestCompile seleniumDependencies
}
integrationTest {
doFirst {
def port = reservePort()
systemProperties['server.port'] = port
systemProperties['management.port'] = 0
systemProperties['spring.session.redis.namespace'] = project.name
}
}
def reservePort() {
def socket = new ServerSocket(0)
def result = socket.localPort
socket.close()
result
}

View File

@@ -0,0 +1,31 @@
apply plugin: 'io.spring.convention.spring-sample-boot'
dependencies {
compile project(':spring-session-data-redis')
compile "org.springframework.boot:spring-boot-starter-security"
compile "org.springframework.boot:spring-boot-starter-thymeleaf"
compile "org.springframework.boot:spring-boot-starter-web"
compile "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect"
compile "org.webjars:bootstrap"
compile "org.webjars:html5shiv"
compile "org.webjars:webjars-locator"
compile "com.maxmind.geoip2:geoip2"
compile "org.apache.httpcomponents:httpclient"
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile "org.assertj:assertj-core"
integrationTestCompile seleniumDependencies
}
integrationTest {
doFirst {
systemProperties['spring.session.redis.namespace'] = project.name
}
}
integrationTest {
doFirst {
systemProperties['spring.session.redis.namespace'] = project.name
}
}

View File

@@ -53,9 +53,7 @@ public class FindByUsernameTests {
@After @After
public void tearDown() { public void tearDown() {
if (this.driver != null) { this.driver.quit();
this.driver.quit();
}
} }
@Test @Test

View File

@@ -20,10 +20,10 @@
</tr> </tr>
<tr th:each="sessionElement : ${sessions}" th:with="details=${sessionElement.getAttribute('SESSION_DETAILS')}"> <tr th:each="sessionElement : ${sessions}" th:with="details=${sessionElement.getAttribute('SESSION_DETAILS')}">
<td th:text="${sessionElement.id.substring(30)}"></td> <td th:text="${sessionElement.id.substring(30)}"></td>
<td th:text="${details.location}"></td> <td th:text="${details?.location}"></td>
<td th:text="${#dates.format(new java.util.Date(sessionElement.creationTime),'dd/MMM/yyyy HH:mm:ss')}"></td> <td th:text="${#dates.format(new java.util.Date(sessionElement.creationTime),'dd/MMM/yyyy HH:mm:ss')}"></td>
<td th:text="${#dates.format(new java.util.Date(sessionElement.lastAccessedTime),'dd/MMM/yyyy HH:mm:ss')}"></td> <td th:text="${#dates.format(new java.util.Date(sessionElement.lastAccessedTime),'dd/MMM/yyyy HH:mm:ss')}"></td>
<td th:text="${details.accessType}"></td> <td th:text="${details?.accessType}"></td>
<td> <td>
<form th:action="@{'/sessions/' + ${sessionElement.id}}" th:method="delete"> <form th:action="@{'/sessions/' + ${sessionElement.id}}" th:method="delete">
<input th:id="'terminate-' + ${sessionElement.id}" type="submit" value="Terminate" th:disabled="${sessionElement.id == #httpSession.id}"/> <input th:id="'terminate-' + ${sessionElement.id}" type="submit" value="Terminate" th:disabled="${sessionElement.id == #httpSession.id}"/>

View File

@@ -1,37 +1,20 @@
buildscript { apply plugin: 'io.spring.convention.spring-sample-boot'
repositories {
mavenCentral()
maven { url "https://repo.spring.io/plugins-snapshot" }
}
dependencies {
classpath 'io.spring.gradle:dependency-management-plugin:1.0.2.RELEASE'
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
}
}
apply from: JAVA_GRADLE
apply from: SAMPLE_GRADLE
apply plugin: "application" apply plugin: "application"
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
ext['spring-data-releasetrain.version'] = springDataReleaseTrainVersion
dependencies { dependencies {
compile project(':spring-session-data-gemfire'), compile project(':spring-session-data-gemfire')
"org.springframework.boot:spring-boot-starter-thymeleaf", compile "org.springframework.boot:spring-boot-starter-thymeleaf"
"org.springframework.boot:spring-boot-starter-web", compile "org.springframework.boot:spring-boot-starter-web"
"org.webjars:bootstrap:$bootstrapVersion", compile "org.webjars:bootstrap"
"org.webjars:webjars-locator" compile "org.webjars:webjars-locator"
runtime "org.springframework.shell:spring-shell:1.1.0.RELEASE" runtime "org.springframework.shell:spring-shell"
testCompile "org.springframework.boot:spring-boot-starter-test" testCompile "org.springframework.boot:spring-boot-starter-test"
integrationTestCompile seleniumDependencies integrationTestCompile seleniumDependencies
integrationTestRuntime "org.springframework.shell:spring-shell:1.1.0.RELEASE" integrationTestRuntime "org.springframework.shell:spring-shell"
} }
run { run {
@@ -40,8 +23,8 @@ run {
} }
} }
springBoot { bootJar {
mainClassName = 'sample.client.Application' mainClass = 'sample.client.Application'
} }
task runGemFireServer() { task runGemFireServer() {

View File

@@ -53,7 +53,7 @@ public class HomePage {
} }
private static void get(WebDriver driver, String get) { private static void get(WebDriver driver, String get) {
String baseUrl = "http://localhost:" + System.getProperty("tomcat.port", "8080"); String baseUrl = "http://localhost:" + System.getProperty("app.port", "8080");
driver.get(baseUrl + get); driver.get(baseUrl + get);
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright 2014-2017 the original author or authors. * Copyright 2014-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -23,7 +23,6 @@ import org.apache.geode.cache.Cache;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
@@ -51,7 +50,7 @@ public class GemFireServer {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(GemFireServer.class); SpringApplication springApplication = new SpringApplication(GemFireServer.class);
springApplication.setWebApplicationType(WebApplicationType.NONE); springApplication.setWebEnvironment(false);
springApplication.run(args); springApplication.run(args);
} }

View File

@@ -1,58 +0,0 @@
buildscript {
repositories {
mavenCentral()
maven { url "https://repo.spring.io/plugins-snapshot" }
}
dependencies {
classpath 'io.spring.gradle:dependency-management-plugin:1.0.2.RELEASE'
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
}
}
apply from: JAVA_GRADLE
apply from: SAMPLE_GRADLE
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'samples'
dependencies {
compile project(':spring-session-jdbc'),
"org.springframework.boot:spring-boot-starter-jdbc",
"org.springframework.boot:spring-boot-starter-web",
"org.springframework.boot:spring-boot-starter-security",
"org.springframework.boot:spring-boot-starter-thymeleaf",
"nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:html5shiv:$html5ShivVersion",
"org.webjars:webjars-locator",
"com.h2database:h2"
testCompile "org.springframework.boot:spring-boot-starter-test",
"org.assertj:assertj-core:$assertjVersion"
integrationTestCompile seleniumDependencies
}
integrationTest {
doFirst {
def port = reservePort()
def host = 'localhost:' + port
systemProperties['geb.build.baseUrl'] = 'http://'+host+'/'
systemProperties['geb.build.reportsDir'] = 'build/geb-reports'
systemProperties['server.port'] = port
systemProperties['management.port'] = 0
systemProperties['spring.session.redis.namespace'] = project.name
}
}
def reservePort() {
def socket = new ServerSocket(0)
def result = socket.localPort
socket.close()
result
}

View File

@@ -0,0 +1,20 @@
apply plugin: 'io.spring.convention.spring-sample-boot'
dependencies {
compile project(':spring-session-jdbc')
compile "org.springframework.boot:spring-boot-starter-jdbc"
compile"org.springframework.boot:spring-boot-starter-web"
compile"org.springframework.boot:spring-boot-starter-security"
compile"org.springframework.boot:spring-boot-starter-thymeleaf"
compile"nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect"
compile"org.webjars:bootstrap"
compile"org.webjars:html5shiv"
compile"org.webjars:webjars-locator"
compile"com.h2database:h2"
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile "org.assertj:assertj-core"
integrationTestCompile seleniumDependencies
}

View File

@@ -1,54 +0,0 @@
buildscript {
repositories {
mavenCentral()
maven { url "https://repo.spring.io/plugins-snapshot" }
}
dependencies {
classpath 'io.spring.gradle:dependency-management-plugin:1.0.2.RELEASE'
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
}
}
apply from: JAVA_GRADLE
apply from: SAMPLE_GRADLE
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'samples'
dependencies {
compile project(':spring-session'),
"org.springframework.data:spring-data-mongodb:$springDataMongoDBVersion",
"org.springframework.boot:spring-boot-starter-web",
"org.springframework.boot:spring-boot-starter-security",
"org.springframework.boot:spring-boot-starter-thymeleaf",
"nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:html5shiv:$html5ShivVersion",
"org.webjars:webjars-locator",
"de.flapdoodle.embed:de.flapdoodle.embed.mongo"
testCompile "org.springframework.boot:spring-boot-starter-test"
integrationTestCompile seleniumDependencies
}
integrationTest {
doFirst {
def port = reservePort()
systemProperties['server.port'] = port
systemProperties['management.port'] = 0
systemProperties['spring.session.redis.namespace'] = project.name
}
}
def reservePort() {
def socket = new ServerSocket(0)
def result = socket.localPort
socket.close()
result
}

View File

@@ -0,0 +1,19 @@
apply plugin: 'io.spring.convention.spring-sample-boot'
dependencies {
compile project(':spring-session')
compile "org.springframework.data:spring-data-mongodb"
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-security"
compile "org.springframework.boot:spring-boot-starter-thymeleaf"
compile "nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect"
compile "org.webjars:bootstrap"
compile "org.webjars:html5shiv"
compile "org.webjars:webjars-locator"
compile "de.flapdoodle.embed:de.flapdoodle.embed.mongo"
testCompile "org.springframework.boot:spring-boot-starter-test"
integrationTestCompile seleniumDependencies
}

View File

@@ -1,66 +0,0 @@
buildscript {
repositories {
mavenCentral()
maven { url "https://repo.spring.io/plugins-snapshot" }
}
dependencies {
classpath 'io.spring.gradle:dependency-management-plugin:1.0.2.RELEASE'
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
}
}
apply from: JAVA_GRADLE
apply from: SAMPLE_GRADLE
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'samples'
ext {
jsonassertVersion="1.3.0"
assertjVersion = "2.4.0"
}
ext['spring-security.version'] = springSecurityVersion
dependencies {
compile project(':spring-session'),
"org.springframework.data:spring-data-redis:$springDataRedisVersion",
"io.lettuce:lettuce-core:$lettuceVersion",
"org.springframework.boot:spring-boot-starter-web",
"org.springframework.boot:spring-boot-starter-thymeleaf",
"org.springframework.boot:spring-boot-starter-security",
"nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect",
"org.apache.httpcomponents:httpclient"
testCompile "org.springframework.boot:spring-boot-starter-test",
"org.assertj:assertj-core:$assertjVersion"
testCompile "org.skyscreamer:jsonassert:$jsonassertVersion"
integrationTestCompile seleniumDependencies
}
//
integrationTest {
doFirst {
def port = reservePort()
systemProperties['server.port'] = port
systemProperties['management.port'] = 0
systemProperties['spring.session.redis.namespace'] = project.name
}
jvmArgs "-XX:-UseSplitVerifier"
}
integrationTest {
testLogging {
events "passed", "skipped", "failed"
}
}
def reservePort() {
def socket = new ServerSocket(0)
def result = socket.localPort
socket.close()
result
}

View File

@@ -0,0 +1,19 @@
apply plugin: 'io.spring.convention.spring-sample-boot'
dependencies {
compile project(':spring-session')
compile"org.springframework.data:spring-data-redis"
compile"io.lettuce:lettuce-core"
compile"org.springframework.boot:spring-boot-starter-web"
compile"org.springframework.boot:spring-boot-starter-thymeleaf"
compile"org.springframework.boot:spring-boot-starter-security"
compile"nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect"
compile"org.apache.httpcomponents:httpclient"
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile"org.assertj:assertj-core"
testCompile "org.skyscreamer:jsonassert"
integrationTestCompile seleniumDependencies
}

View File

@@ -53,7 +53,7 @@ public class HomePage {
} }
private static void get(WebDriver driver, String get) { private static void get(WebDriver driver, String get) {
String baseUrl = "http://localhost:" + System.getProperty("tomcat.port", "8080"); String baseUrl = "http://localhost:" + System.getProperty("app.port", "8080");
driver.get(baseUrl + get); driver.get(baseUrl + get);
} }

View File

@@ -1,54 +0,0 @@
buildscript {
repositories {
mavenCentral()
maven { url "https://repo.spring.io/plugins-snapshot" }
}
dependencies {
classpath 'io.spring.gradle:dependency-management-plugin:1.0.2.RELEASE'
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
}
}
apply from: JAVA_GRADLE
apply from: SAMPLE_GRADLE
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'samples'
ext['spring-data-releasetrain.version'] = springDataReleaseTrainVersion
dependencies {
compile project(':spring-session-data-redis'),
"org.springframework.boot:spring-boot-starter-security",
"org.springframework.boot:spring-boot-starter-thymeleaf",
"org.springframework.boot:spring-boot-starter-web",
"nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:html5shiv:$html5ShivVersion",
"org.webjars:webjars-locator"
testCompile "org.springframework.boot:spring-boot-starter-test"
integrationTestCompile seleniumDependencies
}
integrationTest {
doFirst {
def port = reservePort()
systemProperties['server.port'] = port
systemProperties['management.port'] = 0
systemProperties['spring.session.redis.namespace'] = project.name
}
}
def reservePort() {
def socket = new ServerSocket(0)
def result = socket.localPort
socket.close()
result
}

View File

@@ -0,0 +1,18 @@
apply plugin: 'io.spring.convention.spring-sample-boot'
dependencies {
compile project(':spring-session-data-redis')
compile "io.lettuce:lettuce-core"
compile"org.springframework.boot:spring-boot-starter-security"
compile"org.springframework.boot:spring-boot-starter-thymeleaf"
compile"org.springframework.boot:spring-boot-starter-web"
compile"nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect"
compile"org.webjars:bootstrap"
compile"org.webjars:html5shiv"
compile"org.webjars:webjars-locator"
testCompile "org.springframework.boot:spring-boot-starter-test"
integrationTestCompile seleniumDependencies
}

View File

@@ -1,48 +0,0 @@
buildscript {
repositories {
mavenCentral()
maven { url "https://repo.spring.io/plugins-snapshot" }
}
dependencies {
classpath 'io.spring.gradle:dependency-management-plugin:1.0.2.RELEASE'
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
}
}
apply from: JAVA_GRADLE
apply from: TOMCAT_7_GRADLE
apply from: SAMPLE_GRADLE
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'samples'
dependencies {
compile(project(':spring-session-data-redis')) {
exclude module: 'jedis'
}
compile "org.springframework.boot:spring-boot-starter-data-jpa",
"org.springframework.boot:spring-boot-starter-thymeleaf",
"org.springframework.boot:spring-boot-starter-web",
"org.springframework.boot:spring-boot-starter-websocket",
"org.springframework:spring-websocket:${springVersion}",
"nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect",
"io.lettuce:lettuce-core:$lettuceVersion",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:html5shiv:$html5ShivVersion",
"org.webjars:knockout:2.3.0",
"org.webjars:sockjs-client:0.3.4",
"org.webjars:stomp-websocket:2.3.0",
"org.webjars:webjars-locator",
"com.h2database:h2",
"org.springframework.security:spring-security-web:$springSecurityVersion",
"org.springframework.security:spring-security-config:$springSecurityVersion",
"org.springframework.security:spring-security-messaging:$springSecurityVersion",
"org.springframework.security:spring-security-data:$springSecurityVersion"
testCompile "org.springframework.boot:spring-boot-starter-test",
"org.springframework.security:spring-security-test:$springSecurityVersion"
}

View File

@@ -0,0 +1,30 @@
apply plugin: 'io.spring.convention.spring-sample-boot'
dependencies {
compile(project(':spring-session-data-redis')) {
exclude module: 'jedis'
}
compile "org.springframework.boot:spring-boot-starter-data-jpa"
compile"org.springframework.boot:spring-boot-starter-thymeleaf"
compile"org.springframework.boot:spring-boot-starter-web"
compile"org.springframework.boot:spring-boot-starter-websocket"
compile"org.springframework:spring-websocket"
compile"nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect"
compile"io.lettuce:lettuce-core"
compile"org.webjars:bootstrap"
compile"org.webjars:html5shiv"
compile"org.webjars:knockout"
compile"org.webjars:sockjs-client"
compile"org.webjars:stomp-websocket"
compile"org.webjars:webjars-locator"
compile"com.h2database:h2"
compile"org.springframework.security:spring-security-web"
compile"org.springframework.security:spring-security-config"
compile"org.springframework.security:spring-security-messaging"
compile"org.springframework.security:spring-security-data"
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile "org.springframework.security:spring-security-test"
}

View File

@@ -68,10 +68,6 @@ public class UserRepositoryUserDetailsService implements UserDetailsService {
return AuthorityUtils.createAuthorityList("ROLE_USER"); return AuthorityUtils.createAuthorityList("ROLE_USER");
} }
public String getName() {
return getUsername();
}
public String getUsername() { public String getUsername() {
return getEmail(); return getEmail();
} }

View File

@@ -16,8 +16,7 @@
package sample.websocket; package sample.websocket;
import java.util.Collections; import java.util.Arrays;
import java.util.Optional;
import sample.data.ActiveWebSocketUser; import sample.data.ActiveWebSocketUser;
import sample.data.ActiveWebSocketUserRepository; import sample.data.ActiveWebSocketUserRepository;
@@ -43,11 +42,14 @@ public class WebSocketDisconnectHandler<S>
if (id == null) { if (id == null) {
return; return;
} }
Optional<ActiveWebSocketUser> user = this.repository.findOne(id); ActiveWebSocketUser user = this.repository.findOne(id);
if (user.isPresent()) { if (user == null) {
this.repository.delete(id); return;
this.messagingTemplate.convertAndSend("/topic/friends/signout",
Collections.singleton(user.map(ActiveWebSocketUser::getUsername)));
} }
this.repository.delete(id);
this.messagingTemplate.convertAndSend("/topic/friends/signout",
Arrays.asList(user.getUsername()));
} }
} }

View File

@@ -1,21 +0,0 @@
apply from: JAVA_GRADLE
apply from: TOMCAT_7_GRADLE
apply from: SAMPLE_GRADLE
dependencies {
compile(project(':spring-session-data-redis')) {
exclude module: 'jedis'
}
compile "org.springframework:spring-web:$springVersion",
"io.lettuce:lettuce-core:$lettuceVersion",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:webjars-taglib:$webjarsTaglibVersion",
jstlDependencies
providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
testCompile "junit:junit:$junitVersion",
"org.assertj:assertj-core:$assertjVersion"
integrationTestCompile seleniumDependencies
}

View File

@@ -0,0 +1,20 @@
apply plugin: 'io.spring.convention.spring-sample-war'
dependencies {
compile(project(':spring-session-data-redis')) {
exclude module: 'jedis'
}
compile "org.springframework:spring-web"
compile "io.lettuce:lettuce-core"
compile "org.webjars:bootstrap"
compile "org.webjars:webjars-taglib"
compile jstlDependencies
compile slf4jDependencies
providedCompile "javax.servlet:javax.servlet-api"
testCompile "junit:junit"
testCompile "org.assertj:assertj-core"
integrationTestCompile seleniumDependencies
}

View File

@@ -50,7 +50,7 @@ public class HomePage {
} }
private static void get(WebDriver driver, String get) { private static void get(WebDriver driver, String get) {
String baseUrl = "http://localhost:" + System.getProperty("tomcat.port", "8080"); String baseUrl = "http://localhost:" + System.getProperty("app.port", "8080");
driver.get(baseUrl + get); driver.get(baseUrl + get);
} }

View File

@@ -1,79 +0,0 @@
apply from: JAVA_GRADLE
apply from: SAMPLE_GRADLE
apply from: TOMCAT_7_GRADLE
apply plugin: "application"
dependencies {
compile project(':spring-session-data-gemfire'),
"org.springframework:spring-web:$springVersion",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:webjars-taglib:$webjarsTaglibVersion",
jstlDependencies
providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
runtime "org.springframework.shell:spring-shell:1.1.0.RELEASE"
testCompile "junit:junit:$junitVersion",
"org.assertj:assertj-core:$assertjVersion"
integrationTestCompile seleniumDependencies
integrationTestRuntime "org.springframework.shell:spring-shell:1.1.0.RELEASE"
}
def port
def process
mainClassName = "sample.ServerConfig"
task availablePort() {
doLast {
def serverSocket = new ServerSocket(0)
port = serverSocket.localPort
serverSocket.close()
}
}
task runGemFireServer(dependsOn: availablePort) {
doLast {
println "Starting GemFire Server on port [$port]..."
def out = new StringBuilder()
def err = new StringBuilder()
String classpath = sourceSets.main.runtimeClasspath.collect { it }.join(File.pathSeparator)
String gemfireLogLevel = System.getProperty('spring.session.data.gemfire.log-level', 'warning')
String[] commandLine = [
'java', '-server', '-ea', '-classpath', classpath,
//"-Dgemfire.log-file=gemfire-server.log",
//"-Dgemfire.log-level=config",
"-Dspring.session.data.gemfire.log-level=" + gemfireLogLevel,
"-Dspring.session.data.gemfire.port=$port",
'sample.ServerConfig'
]
//println commandLine
process = commandLine.execute()
process.consumeProcessOutput(out, err)
//println 'OUT: ' + out
//println 'ERR: ' + err
}
}
integrationTest.doLast {
println 'Stopping GemFire Server...'
process?.destroyForcibly()
}
integrationTomcatRun {
dependsOn runGemFireServer
doFirst {
System.setProperty("spring.session.data.gemfire.port", "$port");
}
}

View File

@@ -0,0 +1,22 @@
apply plugin: 'io.spring.convention.spring-sample-war'
apply plugin: "gemfire-server"
dependencies {
compile project(':spring-session-data-gemfire')
compile "org.springframework:spring-web"
compile "org.webjars:bootstrap"
compile "org.webjars:webjars-taglib"
compile jstlDependencies
compile slf4jDependencies
providedCompile "javax.servlet:javax.servlet-api"
runtime "org.springframework.shell:spring-shell"
testCompile "junit:junit"
testCompile "org.assertj:assertj-core"
integrationTestCompile seleniumDependencies
integrationTestRuntime "org.springframework.shell:spring-shell"
}

View File

@@ -53,7 +53,7 @@ public class HomePage {
} }
private static void get(WebDriver driver, String get) { private static void get(WebDriver driver, String get) {
String baseUrl = "http://localhost:" + System.getProperty("tomcat.port", "8080"); String baseUrl = "http://localhost:" + System.getProperty("app.port", "8080");
driver.get(baseUrl + get); driver.get(baseUrl + get);
} }

View File

@@ -1,20 +0,0 @@
apply from: JAVA_GRADLE
apply from: TOMCAT_7_GRADLE
apply from: SAMPLE_GRADLE
dependencies {
compile project(':spring-session-data-gemfire'),
"org.springframework:spring-web:$springVersion",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:webjars-taglib:$webjarsTaglibVersion",
jstlDependencies
providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
testCompile "junit:junit:$junitVersion"
integrationTestCompile seleniumDependencies,
"org.assertj:assertj-core:$assertjVersion"
integrationTestRuntime "org.springframework.shell:spring-shell:1.1.0.RELEASE"
}

View File

@@ -0,0 +1,19 @@
apply plugin: 'io.spring.convention.spring-sample-war'
dependencies {
compile project(':spring-session-data-gemfire')
compile "org.springframework:spring-web"
compile "org.webjars:bootstrap"
compile "org.webjars:webjars-taglib"
compile jstlDependencies
compile slf4jDependencies
providedCompile "javax.servlet:javax.servlet-api"
testCompile "junit:junit"
integrationTestCompile seleniumDependencies
integrationTestCompile "org.assertj:assertj-core"
integrationTestRuntime "org.springframework.shell:spring-shell"
}

View File

@@ -53,7 +53,7 @@ public class HomePage {
} }
private static void get(WebDriver driver, String get) { private static void get(WebDriver driver, String get) {
String baseUrl = "http://localhost:" + System.getProperty("tomcat.port", "8080"); String baseUrl = "http://localhost:" + System.getProperty("app.port", "8080");
driver.get(baseUrl + get); driver.get(baseUrl + get);
} }

View File

@@ -1,22 +0,0 @@
apply from: JAVA_GRADLE
apply from: TOMCAT_7_GRADLE
apply from: SAMPLE_GRADLE
dependencies {
compile project(':spring-session'),
"org.springframework:spring-web:$springVersion",
"org.springframework.security:spring-security-config:$springSecurityVersion",
"org.springframework.security:spring-security-web:$springSecurityVersion",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:webjars-taglib:$webjarsTaglibVersion",
"com.hazelcast:hazelcast-client:$hazelcastVersion",
jstlDependencies
providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion",
"javax.servlet:jsp-api:$jspApiVersion"
testCompile "junit:junit:$junitVersion",
"org.assertj:assertj-core:$assertjVersion"
integrationTestCompile seleniumDependencies
}

View File

@@ -0,0 +1,21 @@
apply plugin: 'io.spring.convention.spring-sample-war'
dependencies {
compile project(':spring-session')
compile "org.springframework:spring-web"
compile "org.springframework.security:spring-security-config"
compile "org.springframework.security:spring-security-web"
compile "org.webjars:bootstrap"
compile "org.webjars:webjars-taglib"
compile "com.hazelcast:hazelcast-client"
compile jstlDependencies
compile slf4jDependencies
providedCompile "javax.servlet:javax.servlet-api"
providedCompile "javax.servlet.jsp:javax.servlet.jsp-api"
testCompile "junit:junit"
testCompile "org.assertj:assertj-core"
integrationTestCompile seleniumDependencies
}

View File

@@ -35,7 +35,7 @@ public class BasePage {
} }
public static void get(WebDriver driver, String get) { public static void get(WebDriver driver, String get) {
String baseUrl = "http://localhost:" + System.getProperty("tomcat.port", "8080"); String baseUrl = "http://localhost:" + System.getProperty("app.port", "8080");
driver.get(baseUrl + get); driver.get(baseUrl + get);
} }

View File

@@ -1,19 +0,0 @@
apply from: JAVA_GRADLE
apply from: TOMCAT_7_GRADLE
apply from: SAMPLE_GRADLE
dependencies {
compile project(':spring-session-jdbc'),
"org.springframework:spring-web:$springVersion",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:webjars-taglib:$webjarsTaglibVersion",
"com.h2database:h2:$h2Version",
jstlDependencies
providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
testCompile "junit:junit:$junitVersion",
"org.assertj:assertj-core:$assertjVersion"
integrationTestCompile seleniumDependencies
}

View File

@@ -0,0 +1,18 @@
apply plugin: 'io.spring.convention.spring-sample-war'
dependencies {
compile project(':spring-session-jdbc')
compile "org.springframework:spring-web"
compile "org.webjars:bootstrap"
compile "org.webjars:webjars-taglib"
compile "com.h2database:h2"
compile jstlDependencies
compile slf4jDependencies
providedCompile "javax.servlet:javax.servlet-api"
testCompile "junit:junit"
testCompile "org.assertj:assertj-core"
integrationTestCompile seleniumDependencies
}

View File

@@ -50,7 +50,7 @@ public class HomePage {
} }
private static void get(WebDriver driver, String get) { private static void get(WebDriver driver, String get) {
String baseUrl = "http://localhost:" + System.getProperty("tomcat.port", "8080"); String baseUrl = "http://localhost:" + System.getProperty("app.port", "8080");
driver.get(baseUrl + get); driver.get(baseUrl + get);
} }

View File

@@ -1,21 +0,0 @@
apply from: JAVA_GRADLE
apply from: TOMCAT_7_GRADLE
apply from: SAMPLE_GRADLE
dependencies {
compile(project(':spring-session-data-redis')) {
exclude module: 'jedis'
}
compile "org.springframework:spring-web:$springVersion",
"io.lettuce:lettuce-core:$lettuceVersion",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:webjars-taglib:$webjarsTaglibVersion",
jstlDependencies
providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
testCompile "junit:junit:$junitVersion",
"org.assertj:assertj-core:$assertjVersion"
integrationTestCompile seleniumDependencies
}

View File

@@ -0,0 +1,20 @@
apply plugin: 'io.spring.convention.spring-sample-war'
dependencies {
compile(project(':spring-session-data-redis')) {
exclude module: 'jedis'
}
compile "org.springframework:spring-web"
compile "io.lettuce:lettuce-core"
compile "org.webjars:bootstrap"
compile "org.webjars:webjars-taglib"
compile jstlDependencies
compile slf4jDependencies
providedCompile "javax.servlet:javax.servlet-api"
testCompile "junit:junit"
testCompile "org.assertj:assertj-core"
integrationTestCompile seleniumDependencies
}

View File

@@ -50,7 +50,7 @@ public class HomePage {
} }
private static void get(WebDriver driver, String get) { private static void get(WebDriver driver, String get) {
String baseUrl = "http://localhost:" + System.getProperty("tomcat.port", "8080"); String baseUrl = "http://localhost:" + System.getProperty("app.port", "8080");
driver.get(baseUrl + get); driver.get(baseUrl + get);
} }

View File

@@ -1,23 +0,0 @@
apply from: JAVA_GRADLE
apply from: TOMCAT_7_GRADLE
apply from: SAMPLE_GRADLE
dependencies {
compile(project(':spring-session-data-redis')) {
exclude module: 'jedis'
}
compile "io.lettuce:lettuce-core:$lettuceVersion",
"org.springframework:spring-webmvc:$springVersion",
"org.springframework.security:spring-security-config:$springSecurityVersion",
"org.springframework.security:spring-security-web:$springSecurityVersion",
"com.fasterxml.jackson.core:jackson-databind:$jacksonVersion",
jstlDependencies
providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
testCompile "junit:junit:$junitVersion",
"org.springframework.security:spring-security-test:$springSecurityVersion",
"org.assertj:assertj-core:$assertjVersion",
"org.springframework:spring-test:$springVersion",
"commons-codec:commons-codec:1.6"
}

View File

@@ -0,0 +1,22 @@
apply plugin: 'io.spring.convention.spring-sample-war'
dependencies {
compile(project(':spring-session-data-redis')) {
exclude module: 'jedis'
}
compile "io.lettuce:lettuce-core"
compile "org.springframework:spring-webmvc"
compile "org.springframework.security:spring-security-config"
compile "org.springframework.security:spring-security-web"
compile "com.fasterxml.jackson.core:jackson-databind"
compile jstlDependencies
compile slf4jDependencies
providedCompile "javax.servlet:javax.servlet-api"
testCompile "junit:junit"
testCompile "org.springframework.security:spring-security-test"
testCompile "org.assertj:assertj-core"
testCompile "org.springframework:spring-test"
testCompile "commons-codec:commons-codec"
}

View File

@@ -48,7 +48,7 @@ public class RestTests {
@Before @Before
public void setUp() { public void setUp() {
this.baseUrl = "http://localhost:" + System.getProperty("tomcat.port"); this.baseUrl = "http://localhost:" + System.getProperty("app.port");
this.restTemplate = new RestTemplate(); this.restTemplate = new RestTemplate();
} }

View File

@@ -1,25 +0,0 @@
apply from: JAVA_GRADLE
apply from: TOMCAT_7_GRADLE
apply from: SAMPLE_GRADLE
dependencies {
compile(project(':spring-session-data-redis')) {
exclude module: 'jedis'
}
compile "org.springframework:spring-web:$springVersion",
"org.springframework.security:spring-security-config:$springSecurityVersion",
"org.springframework.security:spring-security-web:$springSecurityVersion",
"io.lettuce:lettuce-core:$lettuceVersion",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:webjars-taglib:$webjarsTaglibVersion",
jstlDependencies
providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion",
"javax.servlet:jsp-api:$jspApiVersion"
testCompile "junit:junit:$junitVersion",
"org.assertj:assertj-core:$assertjVersion",
"org.springframework:spring-test:$springVersion"
integrationTestCompile seleniumDependencies
}

View File

@@ -0,0 +1,24 @@
apply plugin: 'io.spring.convention.spring-sample-war'
dependencies {
compile(project(':spring-session-data-redis')) {
exclude module: 'jedis'
}
compile "org.springframework:spring-web"
compile "org.springframework.security:spring-security-config"
compile "org.springframework.security:spring-security-web"
compile "io.lettuce:lettuce-core"
compile "org.webjars:bootstrap"
compile "org.webjars:webjars-taglib"
compile jstlDependencies
compile slf4jDependencies
providedCompile "javax.servlet:javax.servlet-api"
providedCompile "javax.servlet.jsp:javax.servlet.jsp-api"
testCompile "junit:junit"
testCompile "org.assertj:assertj-core"
testCompile "org.springframework:spring-test"
integrationTestCompile seleniumDependencies
}

View File

@@ -35,7 +35,7 @@ public abstract class BasePage {
} }
public static void get(WebDriver driver, String get) { public static void get(WebDriver driver, String get) {
String baseUrl = "http://localhost:" + System.getProperty("tomcat.port"); String baseUrl = "http://localhost:" + System.getProperty("app.port");
driver.get(baseUrl + get); driver.get(baseUrl + get);
} }
} }

View File

@@ -1,22 +0,0 @@
apply from: JAVA_GRADLE
apply from: TOMCAT_7_GRADLE
apply from: SAMPLE_GRADLE
dependencies {
compile(project(':spring-session-data-redis')) {
exclude module: 'jedis'
}
compile "org.springframework:spring-web:$springVersion",
"io.lettuce:lettuce-core:$lettuceVersion",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:webjars-taglib:$webjarsTaglibVersion",
jstlDependencies
providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
testCompile "junit:junit:$junitVersion",
"org.springframework:spring-test:$springVersion",
"org.assertj:assertj-core:$assertjVersion"
integrationTestCompile seleniumDependencies
}

View File

@@ -0,0 +1,21 @@
apply plugin: 'io.spring.convention.spring-sample-war'
dependencies {
compile(project(':spring-session-data-redis')) {
exclude module: 'jedis'
}
compile "org.springframework:spring-web"
compile "io.lettuce:lettuce-core"
compile "org.webjars:bootstrap"
compile "org.webjars:webjars-taglib"
compile jstlDependencies
compile slf4jDependencies
providedCompile "javax.servlet:javax.servlet-api"
testCompile "junit:junit"
testCompile "org.springframework:spring-test"
testCompile "org.assertj:assertj-core"
integrationTestCompile seleniumDependencies
}

View File

@@ -39,7 +39,7 @@ public abstract class BasePage {
} }
public static void get(WebDriver driver, String get) { public static void get(WebDriver driver, String get) {
String baseUrl = "http://localhost:" + System.getProperty("tomcat.port"); String baseUrl = "http://localhost:" + System.getProperty("app.port");
driver.get(baseUrl + get); driver.get(baseUrl + get);
} }

View File

@@ -55,9 +55,9 @@ dependencies {
runtime "com.h2database:h2" runtime "com.h2database:h2"
testCompile "org.grails:grails-plugin-testing" testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb" testCompile "org.grails.plugins:geb"
testCompile "org.assertj:assertj-core:$assertjVersion" testCompile "org.assertj:assertj-core"
testCompile "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1" testCompile "org.seleniumhq.selenium:selenium-htmlunit-driver"
testCompile "net.sourceforge.htmlunit:htmlunit:2.18" testCompile "net.sourceforge.htmlunit:htmlunit"
compile "org.springframework.boot:spring-boot-starter-redis" compile "org.springframework.boot:spring-boot-starter-redis"
compile 'org.springframework.session:spring-session:1.1.1.RELEASE' compile 'org.springframework.session:spring-session:1.1.1.RELEASE'

View File

@@ -1,18 +0,0 @@
apply from: JAVA_GRADLE
apply from: TOMCAT_7_GRADLE
apply from: SAMPLE_GRADLE
dependencies {
compile project(':spring-session'),
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:webjars-taglib:$webjarsTaglibVersion",
"com.hazelcast:hazelcast-client:$hazelcastVersion",
jstlDependencies
providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
testCompile "junit:junit:$junitVersion",
"org.assertj:assertj-core:$assertjVersion"
integrationTestCompile seleniumDependencies
}

View File

@@ -0,0 +1,17 @@
apply plugin: 'io.spring.convention.spring-sample-war'
dependencies {
compile project(':spring-session')
compile "org.webjars:bootstrap"
compile "org.webjars:webjars-taglib"
compile "com.hazelcast:hazelcast-client"
compile jstlDependencies
compile slf4jDependencies
providedCompile "javax.servlet:javax.servlet-api"
testCompile "junit:junit"
testCompile "org.assertj:assertj-core"
integrationTestCompile seleniumDependencies
}

View File

@@ -50,7 +50,7 @@ public class HomePage {
} }
private static void get(WebDriver driver, String get) { private static void get(WebDriver driver, String get) {
String baseUrl = "http://localhost:" + System.getProperty("tomcat.port", "8080"); String baseUrl = "http://localhost:" + System.getProperty("app.port", "8080");
driver.get(baseUrl + get); driver.get(baseUrl + get);
} }

View File

@@ -1,78 +0,0 @@
apply from: JAVA_GRADLE
apply from: SAMPLE_GRADLE
apply from: TOMCAT_7_GRADLE
apply plugin: "application"
dependencies {
compile project(':spring-session-data-gemfire'),
"org.springframework:spring-web:$springVersion",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:webjars-taglib:$webjarsTaglibVersion",
jstlDependencies
providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
runtime "org.springframework.shell:spring-shell:1.1.0.RELEASE"
testCompile "junit:junit:$junitVersion",
"org.assertj:assertj-core:$assertjVersion"
integrationTestCompile seleniumDependencies
integrationTestRuntime "org.springframework.shell:spring-shell:1.1.0.RELEASE"
}
mainClassName = 'sample.Application'
def port
def process
task availablePort() {
doLast {
def serverSocket = new ServerSocket(0)
port = serverSocket.localPort
serverSocket.close()
}
}
task runGemFireServer(dependsOn: availablePort) {
doLast {
println "Starting GemFire Server on port [$port]..."
def out = new StringBuilder()
def err = new StringBuilder()
String classpath = sourceSets.main.runtimeClasspath.collect { it }.join(File.pathSeparator)
String gemfireLogLevel = System.getProperty('spring.session.data.gemfire.log-level', 'warning')
String[] commandLine = [
'java', '-server', '-ea', '-classpath', classpath,
//"-Dgemfire.log-file=gemfire-server.log",
//"-Dgemfire.log-level=config",
"-Dspring.session.data.gemfire.log-level=" + gemfireLogLevel,
"-Dspring.session.data.gemfire.port=$port",
'sample.Application'
]
//println commandLine
process = commandLine.execute()
process.consumeProcessOutput(out, err)
//println 'OUT: ' + out
//println 'ERR: ' + err
}
}
integrationTest.doLast {
println 'Stopping GemFire Server...'
process?.destroyForcibly()
}
integrationTomcatRun {
dependsOn runGemFireServer
doFirst {
System.setProperty("spring.session.data.gemfire.port", "$port");
}
}

View File

@@ -0,0 +1,22 @@
apply plugin: 'io.spring.convention.spring-sample-war'
apply plugin: "gemfire-server"
dependencies {
compile project(':spring-session-data-gemfire')
compile "org.springframework:spring-web"
compile "org.webjars:bootstrap"
compile "org.webjars:webjars-taglib"
compile jstlDependencies
compile slf4jDependencies
providedCompile "javax.servlet:javax.servlet-api"
runtime "org.springframework.shell:spring-shell"
testCompile "junit:junit"
testCompile "org.assertj:assertj-core"
integrationTestCompile seleniumDependencies
integrationTestRuntime "org.springframework.shell:spring-shell"
}

View File

@@ -53,7 +53,7 @@ public class HomePage {
} }
private static void get(WebDriver driver, String get) { private static void get(WebDriver driver, String get) {
String baseUrl = "http://localhost:" + System.getProperty("tomcat.port", "8080"); String baseUrl = "http://localhost:" + System.getProperty("app.port", "8080");
driver.get(baseUrl + get); driver.get(baseUrl + get);
} }

View File

@@ -1,20 +0,0 @@
apply from: JAVA_GRADLE
apply from: TOMCAT_7_GRADLE
apply from: SAMPLE_GRADLE
dependencies {
compile project(':spring-session-data-gemfire'),
"org.springframework:spring-web:$springVersion",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:webjars-taglib:$webjarsTaglibVersion",
jstlDependencies
providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
testCompile "junit:junit:$junitVersion"
integrationTestCompile seleniumDependencies,
"org.assertj:assertj-core:$assertjVersion"
integrationTestRuntime "org.springframework.shell:spring-shell:1.1.0.RELEASE"
}

View File

@@ -0,0 +1,19 @@
apply plugin: 'io.spring.convention.spring-sample-war'
dependencies {
compile project(':spring-session-data-gemfire')
compile "org.springframework:spring-web"
compile "org.webjars:bootstrap"
compile "org.webjars:webjars-taglib"
compile jstlDependencies
compile slf4jDependencies
providedCompile "javax.servlet:javax.servlet-api"
testCompile "junit:junit"
integrationTestCompile seleniumDependencies
integrationTestCompile "org.assertj:assertj-core"
integrationTestRuntime "org.springframework.shell:spring-shell"
}

View File

@@ -53,7 +53,7 @@ public class HomePage {
} }
private static void get(WebDriver driver, String get) { private static void get(WebDriver driver, String get) {
String baseUrl = "http://localhost:" + System.getProperty("tomcat.port", "8080"); String baseUrl = "http://localhost:" + System.getProperty("app.port", "8080");
driver.get(baseUrl + get); driver.get(baseUrl + get);
} }

View File

@@ -1,19 +0,0 @@
apply from: JAVA_GRADLE
apply from: TOMCAT_7_GRADLE
apply from: SAMPLE_GRADLE
dependencies {
compile project(':spring-session-jdbc'),
"org.springframework:spring-web:$springVersion",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:webjars-taglib:$webjarsTaglibVersion",
"com.h2database:h2:$h2Version",
jstlDependencies
providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
testCompile "junit:junit:$junitVersion",
"org.assertj:assertj-core:$assertjVersion"
integrationTestCompile seleniumDependencies
}

View File

@@ -0,0 +1,18 @@
apply plugin: 'io.spring.convention.spring-sample-war'
dependencies {
compile project(':spring-session-jdbc')
compile "org.springframework:spring-web"
compile "org.webjars:bootstrap"
compile "org.webjars:webjars-taglib"
compile "com.h2database:h2"
compile jstlDependencies
compile slf4jDependencies
providedCompile "javax.servlet:javax.servlet-api"
testCompile "junit:junit"
testCompile "org.assertj:assertj-core"
integrationTestCompile seleniumDependencies
}

View File

@@ -50,7 +50,7 @@ public class HomePage {
} }
private static void get(WebDriver driver, String get) { private static void get(WebDriver driver, String get) {
String baseUrl = "http://localhost:" + System.getProperty("tomcat.port", "8080"); String baseUrl = "http://localhost:" + System.getProperty("app.port", "8080");
driver.get(baseUrl + get); driver.get(baseUrl + get);
} }

View File

@@ -1,21 +0,0 @@
apply from: JAVA_GRADLE
apply from: TOMCAT_7_GRADLE
apply from: SAMPLE_GRADLE
dependencies {
compile(project(':spring-session-data-redis')) {
exclude module: 'jedis'
}
compile "org.springframework:spring-web:$springVersion",
"io.lettuce:lettuce-core:$lettuceVersion",
"org.webjars:bootstrap:$bootstrapVersion",
"org.webjars:webjars-taglib:$webjarsTaglibVersion",
jstlDependencies
providedCompile "javax.servlet:javax.servlet-api:$servletApiVersion"
testCompile "junit:junit:$junitVersion",
"org.assertj:assertj-core:$assertjVersion"
integrationTestCompile seleniumDependencies
}

View File

@@ -0,0 +1,20 @@
apply plugin: 'io.spring.convention.spring-sample-war'
dependencies {
compile(project(':spring-session-data-redis')) {
exclude module: 'jedis'
}
compile "org.springframework:spring-web"
compile "io.lettuce:lettuce-core"
compile "org.webjars:bootstrap"
compile "org.webjars:webjars-taglib"
compile jstlDependencies
compile slf4jDependencies
providedCompile "javax.servlet:javax.servlet-api"
testCompile "junit:junit"
testCompile "org.assertj:assertj-core"
integrationTestCompile seleniumDependencies
}

View File

@@ -50,7 +50,7 @@ public class HomePage {
} }
private static void get(WebDriver driver, String get) { private static void get(WebDriver driver, String get) {
String baseUrl = "http://localhost:" + System.getProperty("tomcat.port", "8080"); String baseUrl = "http://localhost:" + System.getProperty("app.port", "8080");
driver.get(baseUrl + get); driver.get(baseUrl + get);
} }

View File

@@ -1,38 +1,27 @@
rootProject.name = 'spring-session-build' rootProject.name = 'spring-session-build'
include 'docs'
include 'spring-session' FileTree buildFiles = fileTree(rootDir) {
include 'spring-session-data-gemfire' include '**/*.gradle'
include 'spring-session-data-mongo' exclude '**/gradle', 'settings.gradle', 'buildSrc', '/build.gradle', '.*'
include 'spring-session-data-redis' exclude '**/grails3'
include 'spring-session-hazelcast' }
include 'spring-session-jdbc'
includeSamples("samples" + File.separator + "boot") String rootDirPath = rootDir.absolutePath + File.separator
includeSamples("samples" + File.separator + "javaconfig") buildFiles.each { File buildFile ->
includeSamples("samples" + File.separator + "misc")
includeSamples("samples" + File.separator + "xml")
void includeSamples(String samplesDir) {
FileTree tree = fileTree(samplesDir) {
include '**' + File.separator + '*.gradle'
exclude 'grails3'
}
tree.each {File file ->
String projectDir = file.path.substring(file.path.indexOf(samplesDir), file.path.lastIndexOf(File.separator))
String projectPath = projectDir.substring(projectDir.lastIndexOf(File.separator) + 1)
String projectNamePrefix = samplesDir.substring(samplesDir.lastIndexOf(File.separator) + 1).toLowerCase();
boolean isDefaultName = 'build.gradle'.equals(buildFile.name)
if(isDefaultName) {
String buildFilePath = buildFile.parentFile.absolutePath
String projectPath = buildFilePath.replace(rootDirPath, '').replaceAll(File.separator, ':')
include projectPath include projectPath
} else {
def project = findProject(":${projectPath}") String projectName = buildFile.name.replace('.gradle', '');
String projectPath = ':' + projectName;
project.name = "spring-session-samples-${projectNamePrefix}-${project.name}" include projectPath
project.projectDir = new File(settingsDir, projectDir) def project = findProject("${projectPath}")
project.name = projectName
if (!project.buildFile.exists()) { project.projectDir = buildFile.parentFile
project.buildFileName = file.path.substring(file.path.lastIndexOf(File.separator) + 1) project.buildFileName = buildFile.name
}
} }
} }

View File

@@ -1,22 +0,0 @@
apply from: JAVA_GRADLE
apply from: MAVEN_GRADLE
apply from: BOM_GRADLE
apply plugin: 'spring-io'
description = "Aggregator for Spring Session and Spring Data GemFire"
dependencyManagement {
springIoTestRuntime {
imports {
mavenBom "io.spring.platform:platform-bom:${springIoVersion}"
}
}
}
dependencies {
compile project(':spring-session')
compile("org.springframework.data:spring-data-gemfire:$springDataGemFireVersion") {
exclude group: "org.slf4j", module: 'slf4j-api'
exclude group: "org.slf4j", module: 'jcl-over-slf4j'
}
}

View File

@@ -0,0 +1,11 @@
apply plugin: 'io.spring.convention.spring-pom'
description = "Aggregator for Spring Session and Spring Data GemFire"
dependencies {
compile project(':spring-session')
compile("org.springframework.data:spring-data-gemfire") {
exclude group: "org.slf4j", module: 'slf4j-api'
exclude group: "org.slf4j", module: 'jcl-over-slf4j'
}
}

View File

@@ -1,20 +0,0 @@
apply from: JAVA_GRADLE
apply from: MAVEN_GRADLE
apply from: BOM_GRADLE
apply plugin: 'spring-io'
description = "Aggregator for Spring Session and Spring Data Mongo"
dependencyManagement {
springIoTestRuntime {
imports {
mavenBom "io.spring.platform:platform-bom:${springIoVersion}"
}
}
}
dependencies {
compile project(':spring-session'),
"org.springframework.data:spring-data-mongodb:$springDataMongoDBVersion"
}

View File

@@ -0,0 +1,8 @@
apply plugin: 'io.spring.convention.spring-pom'
description = "Aggregator for Spring Session and Spring Data Mongo"
dependencies {
compile project(':spring-session')
compile "org.springframework.data:spring-data-mongodb"
}

View File

@@ -1,25 +0,0 @@
apply from: JAVA_GRADLE
apply from: MAVEN_GRADLE
apply from: BOM_GRADLE
apply plugin: 'spring-io'
description = "Aggregator for Spring Session and Spring Data Redis"
dependencyManagement {
springIoTestRuntime {
imports {
mavenBom "io.spring.platform:platform-bom:${springIoVersion}"
}
}
}
dependencies {
compile project(':spring-session')
compile ("org.springframework.data:spring-data-redis:$springDataRedisVersion") {
exclude group: "org.slf4j", module: 'slf4j-api'
exclude group: "org.slf4j", module: 'jcl-over-slf4j'
}
compile "redis.clients:jedis:$jedisVersion",
"org.apache.commons:commons-pool2:$commonsPoolVersion"
}

View File

@@ -0,0 +1,13 @@
apply plugin: 'io.spring.convention.spring-pom'
description = "Aggregator for Spring Session and Spring Data Redis"
dependencies {
compile project(':spring-session')
compile ("org.springframework.data:spring-data-redis") {
exclude group: "org.slf4j", module: 'slf4j-api'
exclude group: "org.slf4j", module: 'jcl-over-slf4j'
}
compile "redis.clients:jedis"
compile "org.apache.commons:commons-pool2"
}

View File

@@ -1,20 +0,0 @@
apply from: JAVA_GRADLE
apply from: MAVEN_GRADLE
apply from: BOM_GRADLE
apply plugin: 'spring-io'
description = "Aggregator for Spring Session and Hazelcast"
dependencies {
compile project(':spring-session'),
"com.hazelcast:hazelcast:$hazelcastVersion"
}
dependencyManagement {
springIoTestRuntime {
imports {
mavenBom "io.spring.platform:platform-bom:${springIoVersion}"
}
}
}

View File

@@ -0,0 +1,6 @@
apply plugin: 'io.spring.convention.spring-pom'
dependencies {
compile project(':spring-session')
compile "com.hazelcast:hazelcast"
}

View File

@@ -1,20 +0,0 @@
apply from: JAVA_GRADLE
apply from: MAVEN_GRADLE
apply from: BOM_GRADLE
apply plugin: 'spring-io'
description = "Aggregator for Spring Session and Spring JDBC"
dependencies {
compile project(':spring-session'),
"org.springframework:spring-jdbc:$springVersion"
}
dependencyManagement {
springIoTestRuntime {
imports {
mavenBom "io.spring.platform:platform-bom:${springIoVersion}"
}
}
}

View File

@@ -0,0 +1,8 @@
apply plugin: 'io.spring.convention.spring-pom'
description = "Aggregator for Spring Session and Spring JDBC"
dependencies {
compile project(':spring-session')
compile "org.springframework:spring-jdbc"
}

View File

@@ -1,123 +0,0 @@
apply from: JAVA_GRADLE
apply from: SPRING3_GRADLE
apply from: MAVEN_GRADLE
apply plugin: 'spring-io'
description = "Spring Session"
project.conf2ScopeMappings.addMapping(MavenPlugin.TEST_COMPILE_PRIORITY + 1, project.configurations.getByName("integrationTestCompile"), Conf2ScopeMappingContainer.TEST)
project.conf2ScopeMappings.addMapping(MavenPlugin.TEST_COMPILE_PRIORITY + 2, project.configurations.getByName("integrationTestRuntime"), Conf2ScopeMappingContainer.TEST)
check.dependsOn integrationTest
configurations {
jacoco //Configuration Group used by Sonar to provide Code Coverage using JaCoCo
}
dependencyManagement {
springIoTestRuntime {
imports {
mavenBom "io.spring.platform:platform-bom:$springIoVersion"
}
}
}
dependencies {
compile "commons-logging:commons-logging:$commonsLoggingVersion"
optional "org.springframework:spring-context:$springVersion",
"org.springframework:spring-jdbc:$springVersion",
"org.springframework:spring-messaging:$springVersion",
"org.springframework:spring-web:$springVersion",
"org.springframework:spring-websocket:$springVersion",
"org.springframework.data:spring-data-gemfire:$springDataGemFireVersion",
"org.springframework.data:spring-data-mongodb:$springDataMongoDBVersion",
"org.springframework.data:spring-data-redis:$springDataRedisVersion",
"org.springframework.security:spring-security-core:$springSecurityVersion",
"org.springframework.security:spring-security-web:$springSecurityVersion",
"com.hazelcast:hazelcast:$hazelcastVersion"
provided "javax.servlet:javax.servlet-api:$servletApiVersion"
integrationTestCompile "redis.clients:jedis:$jedisVersion",
"org.apache.commons:commons-pool2:2.2",
"org.apache.derby:derby:10.12.1.1",
"com.h2database:h2:$h2Version",
"com.hazelcast:hazelcast-client:$hazelcastVersion",
"org.hsqldb:hsqldb:2.4.0",
"de.flapdoodle.embed:de.flapdoodle.embed.mongo:1.50.2"
integrationTestRuntime "org.springframework.shell:spring-shell:1.1.0.RELEASE"
testCompile "junit:junit:$junitVersion",
"org.mockito:mockito-core:$mockitoVersion",
"edu.umd.cs.mtc:multithreadedtc:1.01",
"org.springframework:spring-test:$springVersion",
"org.assertj:assertj-core:$assertjVersion",
"org.springframework.security:spring-security-core:$springSecurityVersion",
"org.apache.commons:commons-pool2:2.2",
"org.apache.derby:derby:10.12.1.1",
"com.h2database:h2:$h2Version",
"com.hazelcast:hazelcast-client:$hazelcastVersion",
"org.hsqldb:hsqldb:2.4.0",
"de.flapdoodle.embed:de.flapdoodle.embed.mongo:1.50.2",
"redis.clients:jedis:$jedisVersion"
jacoco "org.jacoco:org.jacoco.agent:0.7.2.201409121644:runtime"
}
ext.javadocLinks = [
"http://docs.oracle.com/javase/8/docs/api/",
"http://docs.oracle.com/javaee/7/api/",
"http://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/", // CommonJ
"http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.javadoc.doc/web/apidocs/",
"http://glassfish.java.net/nonav/docs/v3/api/",
"http://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
"http://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
"http://commons.apache.org/proper/commons-lang/javadocs/api-2.5/",
"http://commons.apache.org/proper/commons-codec/apidocs/",
"http://commons.apache.org/proper/commons-dbcp/apidocs/",
"http://portals.apache.org/pluto/portlet-2.0-apidocs/",
"http://tiles.apache.org/tiles-request/apidocs/",
"http://tiles.apache.org/framework/apidocs/",
"http://aopalliance.sourceforge.net/doc/",
"http://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
"http://quartz-scheduler.org/api/2.2.0/",
"http://fasterxml.github.com/jackson-core/javadoc/2.3.0/",
"http://fasterxml.github.com/jackson-databind/javadoc/2.3.0/",
"http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/"
] as String[]
javadoc {
description = "Generates project-level javadoc for use in -javadoc jar"
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = project.name
options.links(project.ext.javadocLinks)
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
// don't include or exclude anything explicitly by default. See SPR-12085.
}
task javadocJar(type: Jar) {
classifier = "javadoc"
from javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
test {
jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=${project.group}.*"
}
integrationTest {
jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=${project.group}.*"
}

View File

@@ -0,0 +1,38 @@
apply plugin: 'io.spring.convention.spring-module'
description = "Spring Session"
dependencies {
compile "commons-logging:commons-logging"
optional "org.springframework:spring-context"
optional "org.springframework:spring-jdbc"
optional "org.springframework:spring-messaging"
optional "org.springframework:spring-web"
optional "org.springframework:spring-websocket"
optional "org.springframework.data:spring-data-gemfire"
optional "org.springframework.data:spring-data-mongodb"
optional "org.springframework.data:spring-data-redis"
optional "org.springframework.security:spring-security-core"
optional "org.springframework.security:spring-security-web"
optional "com.hazelcast:hazelcast"
provided "javax.servlet:javax.servlet-api"
integrationTestCompile "redis.clients:jedis"
integrationTestCompile "org.apache.commons:commons-pool2"
integrationTestCompile "org.apache.derby:derby"
integrationTestCompile "com.h2database:h2"
integrationTestCompile "com.hazelcast:hazelcast-client"
integrationTestCompile "org.hsqldb:hsqldb"
integrationTestCompile "de.flapdoodle.embed:de.flapdoodle.embed.mongo"
integrationTestRuntime "org.springframework.shell:spring-shell"
testCompile "junit:junit"
testCompile "org.mockito:mockito-core"
testCompile "edu.umd.cs.mtc:multithreadedtc"
testCompile "org.springframework:spring-test"
testCompile "org.assertj:assertj-core"
testCompile "org.springframework.security:spring-security-core"
}