+ separated sample from the build

+ updated readme files with regards to gradle
This commit is contained in:
Costin Leau
2011-07-20 18:48:30 +03:00
parent bcfaafc5e8
commit be8bcc5d93
10 changed files with 60 additions and 197 deletions

View File

@@ -3,7 +3,6 @@ description = 'Spring GemFire'
abbreviation = 'SGF'
apply plugin: 'base'
apply plugin: 'idea'
buildscript {
repositories {

View File

@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>samples</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>

View File

@@ -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

View File

@@ -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'

View File

@@ -0,0 +1,3 @@
junitVersion = 4.8.1
springVersion = 3.1.0.M2
version = 1.1.0.BUILD-SNAPSHOT

View File

@@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>samples</artifactId>
<groupId>org.springframework.data.gemfire.samples</groupId>
<version>1.1.0.BUILD-SNAPSHOT</version>
<relativePath>../</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.data.gemfire.samples</groupId>
<artifactId>hello-world</artifactId>
<version>1.1.0.BUILD-SNAPSHOT</version>
<name>Spring GemFire - Hello World Sample</name>
<description>A simple Hello World example illustrating the basic steps in configuring GemFire with Spring</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.1</version>
<configuration>
<archive>
<manifestEntries>
<Main-Class>org.springframework.data.gemfire.samples.helloworld.Main</Main-Class>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<mainClass>org.springframework.data.gemfire.samples.helloworld.Main</mainClass>
<systemProperties>
<systemProperty>
<key>java.net.preferIPv4Stack</key>
<value>true</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -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

View File

@@ -1,113 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.data.gemfire.samples</groupId>
<artifactId>samples</artifactId>
<version>1.1.0.BUILD-SNAPSHOT</version>
<name>Spring GemFire Samples</name>
<packaging>pom</packaging>
<url>http://www.springframework.org/spring-gemfire</url>
<issueManagement>
<system>Issue Tracker</system>
<url>http://jira.springframework.org/browse/SGF</url>
</issueManagement>
<scm>
<url>http://git.springsource.org/spring-gemfire</url>
</scm>
<organization>
<name>SpringSource, a division of VMware</name>
<url>www.SpringSource.org</url>
</organization>
<properties>
<spring.version>3.0.5.RELEASE</spring.version>
<junit.version>4.7</junit.version>
</properties>
<modules>
<module>hello-world</module>
</modules>
<dependencies>
<dependency>
<groupId>org.springframework.data.gemfire</groupId>
<artifactId>spring-gemfire</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!--
<dependency>
<groupId>com.gemstone.gemfire</groupId>
<artifactId>gemfire</artifactId>
<version>6.5.1.2</version>
<scope>compile</scope>
</dependency>
-->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<stylesheetfile>${basedir}/../../docs/src/javadoc/javadoc.css</stylesheetfile>
</configuration>
</plugin>
</plugins>
</reporting>
<repositories>
<repository>
<id>gemfire-release-repo</id>
<name>GemFire Release Repository</name>
<url>http://dist.gemstone.com/maven/release/</url>
</repository>
<repository>
<id>repository.springframework.maven.milestone</id>
<name>Spring Framework Maven Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>
</repository>
</repositories>
</project>

View File

@@ -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.

View File

@@ -58,6 +58,7 @@ public class GemfireCache implements Cache {
region.destroy(key);
}
@SuppressWarnings("unchecked")
public ValueWrapper get(Object key) {
Object value = region.get(key);