Răsfoiți Sursa

Edit per Greg Turnquist's recommendations.

Craig Walls 11 ani în urmă
părinte
comite
7e051b6a2d
4 a modificat fișierele cu 76 adăugiri și 131 ștergeri
  1. 1 1
      README.ftl.md
  2. 17 10
      README.md
  3. 16 9
      initial/build.gradle
  4. 42 111
      initial/pom.xml

+ 1 - 1
README.ftl.md

@@ -93,7 +93,7 @@ Create a Java class named `WebSocketConfig` that looks like this:
 
 `WebSocketConfig` is annotated with `@Configuration` to indicate that it is a Spring configuration class.
 It is also annotated [`@EnableWebSocketMessageBroker`][AtEnableWebSocketMessageBroker].
-As its name suggests, `@EnableWebSocketMessageBroker` enables a WebSocket message handling, backed by a message broker.
+As its name suggests, `@EnableWebSocketMessageBroker` enables WebSocket message handling, backed by a message broker.
 
 The `configureMessageBroker()` method overrides the default method in `WebSocketMessageBrokerConfigurer` to configure the message broker.
 It starts by calling `enableSimpleBroker()` to enable a simple memory-based message broker to carry the greeting messages back to the client on destinations prefixed with "/queue".

+ 17 - 10
README.md

@@ -61,31 +61,38 @@ Below is the [initial Gradle build file](https://github.com/spring-guides/gs-mes
 
 `build.gradle`
 ```gradle
+buildscript {
+    repositories {
+        maven { url "http://repo.spring.io/libs-snapshot" }
+        mavenLocal()
+    }
+}
+
 apply plugin: 'java'
-apply plugin: 'war'
 apply plugin: 'eclipse'
 apply plugin: 'idea'
 
-war {
-    baseName = 'gs-messaging-websocket'
+jar {
+    baseName = 'gs-messaging-stomp-websocket'
     version =  '0.1.0'
 }
 
 repositories {
     mavenCentral()
-    maven { url "http://repo.springsource.org/libs-snapshot" }
+    maven { url "http://repo.spring.io/libs-snapshot" }
 }
 
 dependencies {
-    compile("org.springframework:spring-webmvc:4.0.0.BUILD-SNAPSHOT")
-    compile("org.springframework:spring-websocket:4.0.0.BUILD-SNAPSHOT")
-    providedCompile("javax.websocket:javax.websocket-api:1.0-rc5")
-    providedCompile("javax.servlet:javax.servlet-api:3.1-b09")
+    compile("org.springframework.boot:spring-boot-starter-web:0.5.0.M6")
+    compile("org.springframework.boot:spring-boot-starter-websocket:0.5.0.M6")
+    compile("org.springframework:spring-messaging:4.0.0.RC1")
+    compile("org.projectreactor:reactor-tcp:1.0.0.RC1")
+    compile("com.fasterxml.jackson.core:jackson-databind")
     testCompile("junit:junit:4.11")
 }
 
 task wrapper(type: Wrapper) {
-    gradleVersion = '1.6'
+    gradleVersion = '1.8'
 }
 ```
     
@@ -241,7 +248,7 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
 
 `WebSocketConfig` is annotated with `@Configuration` to indicate that it is a Spring configuration class.
 It is also annotated [`@EnableWebSocketMessageBroker`][AtEnableWebSocketMessageBroker].
-As its name suggests, `@EnableWebSocketMessageBroker` enables a WebSocket message handling, backed by a message broker.
+As its name suggests, `@EnableWebSocketMessageBroker` enables WebSocket message handling, backed by a message broker.
 
 The `configureMessageBroker()` method overrides the default method in `WebSocketMessageBrokerConfigurer` to configure the message broker.
 It starts by calling `enableSimpleBroker()` to enable a simple memory-based message broker to carry the greeting messages back to the client on destinations prefixed with "/queue".

+ 16 - 9
initial/build.gradle

@@ -1,26 +1,33 @@
+buildscript {
+    repositories {
+        maven { url "http://repo.spring.io/libs-snapshot" }
+        mavenLocal()
+    }
+}
+
 apply plugin: 'java'
-apply plugin: 'war'
 apply plugin: 'eclipse'
 apply plugin: 'idea'
 
-war {
-    baseName = 'gs-messaging-websocket'
+jar {
+    baseName = 'gs-messaging-stomp-websocket'
     version =  '0.1.0'
 }
 
 repositories {
     mavenCentral()
-    maven { url "http://repo.springsource.org/libs-snapshot" }
+    maven { url "http://repo.spring.io/libs-snapshot" }
 }
 
 dependencies {
-    compile("org.springframework:spring-webmvc:4.0.0.BUILD-SNAPSHOT")
-    compile("org.springframework:spring-websocket:4.0.0.BUILD-SNAPSHOT")
-    providedCompile("javax.websocket:javax.websocket-api:1.0-rc5")
-    providedCompile("javax.servlet:javax.servlet-api:3.1-b09")
+    compile("org.springframework.boot:spring-boot-starter-web:0.5.0.M6")
+    compile("org.springframework.boot:spring-boot-starter-websocket:0.5.0.M6")
+    compile("org.springframework:spring-messaging:4.0.0.RC1")
+    compile("org.projectreactor:reactor-tcp:1.0.0.RC1")
+    compile("com.fasterxml.jackson.core:jackson-databind")
     testCompile("junit:junit:4.11")
 }
 
 task wrapper(type: Wrapper) {
-    gradleVersion = '1.6'
+    gradleVersion = '1.8'
 }

+ 42 - 111
initial/pom.xml

@@ -1,140 +1,71 @@
+<?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">
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
-    <groupId>org.springframework.samples</groupId>
-    <artifactId>gs-messaging-stomp-websocket-initial</artifactId>
-    <packaging>war</packaging>
+
+    <groupId>org.springframework</groupId>
+    <artifactId>gs-messaging-stomp-websocket</artifactId>
     <version>0.1.0</version>
 
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>0.5.0.M6</version>
+    </parent>
+
     <dependencies>
         <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-webmvc</artifactId>
-            <version>4.0.0.BUILD-SNAPSHOT</version>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-messaging</artifactId>
-            <version>4.0.0.BUILD-SNAPSHOT</version>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-websocket</artifactId>
         </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
-            <artifactId>spring-websocket</artifactId>
-            <version>4.0.0.BUILD-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>com.fasterxml.jackson.core</groupId>
-            <artifactId>jackson-databind</artifactId>
-            <version>2.2.2</version>
-        </dependency>
-        <dependency>
-            <groupId>javax.websocket</groupId>
-            <artifactId>javax.websocket-api</artifactId>
-            <version>1.0-rc5</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>javax.servlet</groupId>
-            <artifactId>javax.servlet-api</artifactId>
-            <version>3.1-b09</version>
-            <scope>provided</scope>
-        </dependency>
-        
-        
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <version>1.6.4</version>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>jcl-over-slf4j</artifactId>
-            <version>1.6.4</version>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <version>1.6.4</version>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-            <version>1.2.16</version>
-            <scope>runtime</scope>
-        </dependency>
-        
-        <dependency>
-            <groupId>org.projectreactor</groupId>
-            <artifactId>reactor-core</artifactId>
-            <version>1.0.0.M1</version>
+            <artifactId>spring-messaging</artifactId>
         </dependency>
-
-        <!-- Required when the "stomp-broker-relay" profile is enabled -->
         <dependency>
             <groupId>org.projectreactor</groupId>
             <artifactId>reactor-tcp</artifactId>
-            <version>1.0.0.M1</version>
+            <version>1.0.0.RC1</version>
         </dependency>
-        
-
         <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-            <version>1.1</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>javax.servlet</groupId>
-                    <artifactId>servlet-api</artifactId>
-                </exclusion>
-            </exclusions>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
         </dependency>
-        
     </dependencies>
 
-    <repositories>
-        <repository>
-            <id>spring-snapshots</id>
-            <url>http://repo.springsource.org/libs-snapshot</url>
-            <snapshots>
-                <enabled>true</enabled>
-            </snapshots>
-        </repository>
-        <repository>
-            <id>tomcat-snapshots</id>
-            <url>https://repository.apache.org/content/repositories/snapshots</url>
-            <snapshots><enabled>true</enabled></snapshots>
-            <releases><enabled>false</enabled></releases>
-        </repository>
-        <repository>
-            <id>java-net-snapshots</id>
-            <url>https://maven.java.net/content/repositories/snapshots</url>
-            <snapshots><enabled>true</enabled></snapshots>
-            <releases><enabled>false</enabled></releases>
-        </repository>
-    </repositories>
+    <properties>
+        <start-class>hello.Application</start-class>
+    </properties>
 
     <build>
-        <finalName>${project.artifactId}</finalName>
         <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>2.3.2</version>
-                <configuration>
-                    <source>1.7</source>
-                    <target>1.7</target>
-                </configuration>
+            <plugin> 
+                <artifactId>maven-compiler-plugin</artifactId> 
+                <version>2.3.2</version> 
             </plugin>
             <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-war-plugin</artifactId>
-                <version>2.2</version>
-                <configuration>
-                    <failOnMissingWebXml>false</failOnMissingWebXml>
-                </configuration>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
             </plugin>
         </plugins>
     </build>
+
+    <repositories>
+        <repository>
+            <id>spring-snapshots</id>
+            <url>http://repo.spring.io/libs-snapshot</url>
+            <snapshots><enabled>true</enabled></snapshots>
+        </repository>
+    </repositories>
+    <pluginRepositories>
+        <pluginRepository>
+            <id>spring-snapshots</id>
+            <url>http://repo.spring.io/libs-snapshot</url>
+            <snapshots><enabled>true</enabled></snapshots>
+        </pluginRepository>
+    </pluginRepositories>
 </project>