diff --git a/build.gradle b/build.gradle index f231bf9f..2ffed10b 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,6 @@ description = 'Spring GemFire' abbreviation = 'SGF' apply plugin: 'base' -apply plugin: 'idea' buildscript { repositories { diff --git a/samples/.project b/samples/.project deleted file mode 100644 index c4a74340..00000000 --- a/samples/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - samples - - - - - - org.maven.ide.eclipse.maven2Builder - - - - - - org.maven.ide.eclipse.maven2Nature - - diff --git a/samples/.settings/org.maven.ide.eclipse.prefs b/samples/.settings/org.maven.ide.eclipse.prefs deleted file mode 100644 index 34d95234..00000000 --- a/samples/.settings/org.maven.ide.eclipse.prefs +++ /dev/null @@ -1,9 +0,0 @@ -#Wed Sep 15 11:32:59 EDT 2010 -activeProfiles= -eclipse.preferences.version=1 -fullBuildGoals=process-test-resources -includeModules=false -resolveWorkspaceProjects=true -resourceFilterGoals=process-resources resources\:testResources -skipCompilerPlugin=true -version=1 diff --git a/samples/hello-world/build.gradle b/samples/hello-world/build.gradle new file mode 100644 index 00000000..d27ee73f --- /dev/null +++ b/samples/hello-world/build.gradle @@ -0,0 +1,44 @@ +description = 'Spring GemFire Samples - Hello World' + +apply plugin: 'base' +apply plugin: 'idea' +apply plugin: 'java' +apply plugin: 'eclipse' // `gradle eclipse` to generate .classpath/.project + +[compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:-serial"] + + +repositories { + mavenLocal() + mavenCentral() + // Public Spring artefacts + mavenRepo name: "springsource-org-release", urls: "http://repository.springsource.com/maven/bundles/release" + mavenRepo name: "spring-release", urls: "http://maven.springframework.org/release" + mavenRepo name: "spring-milestone", urls: "http://maven.springframework.org/milestone" + mavenRepo name: "spring-snapshot", urls: "http://maven.springframework.org/snapshot" + mavenRepo name: "sonatype-snapshot", urls: "http://oss.sonatype.org/content/repositories/snapshots" + mavenRepo name: "ext-snapshots", urls: "http://springframework.svn.sourceforge.net/svnroot/springframework/repos/repo-ext/" +} + +dependencies { + compile "org.springframework.data.gemfire:spring-gemfire:$version" + compile "javax.inject:javax.inject:1" + compile "javax.annotation:jsr250-api:1.0" + + testCompile "junit:junit:$junitVersion" + testCompile "org.springframework:spring-test:$springVersion" +} + +sourceCompatibility = 1.5 +targetCompatibility = 1.5 + + +task run(type: JavaExec) { + description = 'Runs the application' + main = "org.springframework.data.gemfire.samples.helloworld.Main" + classpath = sourceSets.main.runtimeClasspath + standardInput = System.in + systemProperties['java.net.preferIPv4Stack'] = 'true' +} + +defaultTasks 'run' \ No newline at end of file diff --git a/samples/hello-world/gradle.properties b/samples/hello-world/gradle.properties new file mode 100644 index 00000000..c9c5db2b --- /dev/null +++ b/samples/hello-world/gradle.properties @@ -0,0 +1,3 @@ +junitVersion = 4.8.1 +springVersion = 3.1.0.M2 +version = 1.1.0.BUILD-SNAPSHOT diff --git a/samples/hello-world/pom.xml b/samples/hello-world/pom.xml deleted file mode 100644 index 3468ff0f..00000000 --- a/samples/hello-world/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - samples - org.springframework.data.gemfire.samples - 1.1.0.BUILD-SNAPSHOT - ../ - - 4.0.0 - org.springframework.data.gemfire.samples - hello-world - 1.1.0.BUILD-SNAPSHOT - Spring GemFire - Hello World Sample - - A simple Hello World example illustrating the basic steps in configuring GemFire with Spring - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.1 - - - - org.springframework.data.gemfire.samples.helloworld.Main - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.1 - - org.springframework.data.gemfire.samples.helloworld.Main - - - java.net.preferIPv4Stack - true - - - - - - - - \ No newline at end of file diff --git a/samples/hello-world/readme.txt b/samples/hello-world/readme.txt index efa7b3fe..ef0dfc70 100644 --- a/samples/hello-world/readme.txt +++ b/samples/hello-world/readme.txt @@ -14,12 +14,15 @@ Multiple nodes can be started which will share and exchange information transpar 2. BUILD AND DEPLOYMENT This directory contains the source files. -For building, Maven 2 and JDK 1.5+ are required. +For building, JDK 1.5+ are required To build the sample, use the following command: -# mvn clean package +*nix/BSD OS: +# ../../gradlew -q -To run the sample, use: +Windows OS: +# ..\..\gradlew -q -# mvn exec:java +If you have Gradle installed and available in your classpath, you can simply type: +# gradle -q diff --git a/samples/pom.xml b/samples/pom.xml deleted file mode 100644 index cded87e4..00000000 --- a/samples/pom.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - 4.0.0 - org.springframework.data.gemfire.samples - samples - 1.1.0.BUILD-SNAPSHOT - Spring GemFire Samples - pom - http://www.springframework.org/spring-gemfire - - - Issue Tracker - http://jira.springframework.org/browse/SGF - - - http://git.springsource.org/spring-gemfire - - - SpringSource, a division of VMware - www.SpringSource.org - - - - 3.0.5.RELEASE - 4.7 - - - - hello-world - - - - - org.springframework.data.gemfire - spring-gemfire - ${version} - - - - javax.inject - javax.inject - 1 - test - - - - javax.annotation - jsr250-api - 1.0 - test - - - - org.springframework - spring-test - ${spring.version} - test - - - - junit - junit - ${junit.version} - test - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - - - - - - maven-javadoc-plugin - - ${basedir}/../../docs/src/javadoc/javadoc.css - - - - - - - - gemfire-release-repo - GemFire Release Repository - http://dist.gemstone.com/maven/release/ - - - repository.springframework.maven.milestone - Spring Framework Maven Milestone Repository - http://maven.springframework.org/milestone - - - - \ No newline at end of file diff --git a/samples/readme.txt b/samples/readme.txt index 3a307bf9..ba16df50 100644 --- a/samples/readme.txt +++ b/samples/readme.txt @@ -19,14 +19,15 @@ A simple demo for configuring and interacting with the GemFire grid. BUILDING AND DEPLOYMENT ----------------------- -All demos require Maven 2.0.7+ and JDK 1.5+. +All demos require JDK 1.5+. -Each module should be run from its top folder using maven: +Each module should be run from its top folder using gradle wrapper: -# mvn clean install +# ../../gradlew RUNNING UNDER LINUX ------------------- -If you experience network problems under Linux, try passing "-Djava.net.preferIPv4Stack=true" to the command. +If you experience network problems under Linux, try passing "-Djava.net.preferIPv4Stack=true" to the command +(note this is passed automatically when using the provided script). See https://jira.springsource.org/browse/SGF-28 for more information. \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java b/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java index bb3a80d4..64dfb095 100644 --- a/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java +++ b/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java @@ -58,6 +58,7 @@ public class GemfireCache implements Cache { region.destroy(key); } + @SuppressWarnings("unchecked") public ValueWrapper get(Object key) { Object value = region.get(key);