Skip to content

Commit

Permalink
INTSAMPLES-131: Fix README.md for Gradle
Browse files Browse the repository at this point in the history
JIRA: https://jira.spring.io/browse/INTSAMPLES-131

INTSAMPLES-131: PR comments
  • Loading branch information
Artem Bilan authored and garyrussell committed Jun 23, 2014
1 parent 53dfc49 commit 95ec35c
Show file tree
Hide file tree
Showing 26 changed files with 95 additions and 84 deletions.
8 changes: 3 additions & 5 deletions applications/cafe-scripted/README.md
Expand Up @@ -5,19 +5,17 @@ This is the scripted implementation of the classic **cafe** sample application.

# Instructions for running the CafeDemo sample

The script language is passed as a command line argument. This may be run directly from maven:
The script language is passed as a command line argument. This may be run directly from Gradle:

$ mvn clean compile

$ mvn exec:exec -Dlang=[language]
$ gradlew :cafe-scripted:runCafeDemoApp -Plang=[language]

## Groovy Control Bus

This sample also demonstrates the use of Spring Integration's **groovy control bus** which accepts Groovy scripts as control messages. These scripts may invoke lifecycle operations on adapters or operations on managed beans.

To demonstrate the control bus, while the CafeDemoApp is running, execute in a separate window:

$ mvn exec:exec -Pcontrol-bus
$ gradlew :cafe-scripted:runControlBus

This will use groovy scripts to

Expand Down
8 changes: 4 additions & 4 deletions applications/loan-broker/README.md
@@ -1,11 +1,11 @@
Loan Broker Application
=======================

The Loan Broker sample is distributed as a Maven project, so you can run it in two ways.
The Loan Broker sample is distributed as a Gradle project, so you can run it in two ways.

### Maven (command line):
### Gradle (command line):

Execute **mvn install**. You should see output that looks similar to this:
Execute **gradlew :loan-broker:run**. You should see output that looks similar to this:

. . . . .
INFO : org.springframework.integration.loanbroker.demo.LoanBrokerDemo -
Expand All @@ -30,7 +30,7 @@ Execute **mvn install**. You should see output that looks similar to this:

This extension to the loan broker sample shows how to exchange messages between Spring Integration applications (and other technologies) using UDP. Any loan quotes over 5.2% will be sent to the loanshark application.

* Deploy the **loanshark** sample to a web container (e.g. **mvn tomcat:run**); or
* Deploy the **loanshark** sample to a web container (e.g. **gradlew :loan-broker:jettyRun**); or
* run the perl (**udps.pl**) or groovy (**udps.groovy**) scripts from the command line.

Run the **LoanBrokerSharkDetectorDemo** test case. You can see the banks that were detected as loan sharks in the **loanshark web UI**.
Expand Down
7 changes: 3 additions & 4 deletions basic/amqp/README.md
Expand Up @@ -15,14 +15,13 @@ If you imported the example into your IDE, you can just run class **org.springfr

* Right-click on Main class --> Run As --> Java Application

Alternatively, you can start the sample from the command line ([Maven](http://maven.apache.org/) required):
Alternatively, you can start the sample from the command line ([Gradle](http://www.gradle.org) required):

* mvn package
* mvn exec:java
* gradlew :amqp:run

# Used Spring Integration components

### Spring Integration Modules (Maven dependencies)
### Spring Integration Modules (Maven/Gradle dependencies)

* spring-integration-core
* spring-integration-amqp
Expand Down
4 changes: 2 additions & 2 deletions basic/enricher/README.md
Expand Up @@ -11,8 +11,8 @@ You can run the sample application by either

* running the "Main" class from within STS (Right-click on Main class --> Run As --> Java Application)
* or from the command line execute:
- mvn package
- mvn exec:java

$ gradlew :enricher:run

This example illustrates the usage of the Content Enricher.

Expand Down
2 changes: 1 addition & 1 deletion basic/ftp/README.md
Expand Up @@ -13,7 +13,7 @@ This example demonstrates the following aspects of the FTP support available wit

The samples work out of the box using an embedded Apache FTP Server. Simply execute:

$ mvn clean package
$ gradlew :ftp:run

and the samples are build as well as executed. The samples are part of a JUnit test suite:

Expand Down
10 changes: 6 additions & 4 deletions basic/helloworld/README.md
Expand Up @@ -12,9 +12,10 @@ The Hello World application demonstrates a simple message flow represented by th

Message -> Channel -> ServiceActivator -> QueueChannel

To run the sample simply execute **HelloWorldApp** in package **org.springframework.integration.samples.helloworld**. You can also execute that class using the [Exec Maven Plugin](http://mojo.codehaus.org/exec-maven-plugin/):
To run the sample simply execute **HelloWorldApp** in package **org.springframework.integration.samples.helloworld**.
You can also execute that class using the [Gralde](http://www.gradle.org):

$ mvn clean package exec:java -P hello
$ gradlew :helloworld:runHelloWorldApp

You should see the following output:

Expand All @@ -26,9 +27,10 @@ This simple application will print out the current system time twice every 20 se

More specifically, an **Inbound Channel Adapter** polls for the current system time 2 times every 20 seconds (20000 milliseconds). The resulting message contains as payload the time in milliseconds and the message is sent to a **Logging Channel Adapter**, which will print the time to the command prompt.

To run the sample simply execute **PollerApp** in package **org.springframework.integration.samples.helloworld**. You can also execute that class using the [Exec Maven Plugin](http://mojo.codehaus.org/exec-maven-plugin/):
To run the sample simply execute **PollerApp** in package **org.springframework.integration.samples.helloworld**.
You can also execute that class using the [Gralde](http://www.gradle.org):

$ mvn clean package exec:java -P poller
$ gradlew :helloworld:runPollerApp

You should see output like the following:

Expand Down
20 changes: 11 additions & 9 deletions basic/http/README.md
Expand Up @@ -12,15 +12,17 @@ The sample consists of two parts:

### Server

#### Command Line Using Maven
#### Command Line Using Gradle

The easiest way to run the **server** is to use the [Maven Jetty Plugin](http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin). Simply execute:
The easiest way to run the **server** is to use the [Gralde Jetty Plugin](http://www.gradle.org/docs/current/userguide/jetty_plugin.html).
Simply execute:

$ mvn jetty:run
$ gradlew :http:jettyRun

This command starts a Jetty servlet container running on port 8080 serving the application. Alternatively you can also package the war-file and deploy it manually to a servlet container of your choosing. For that to happen execute:
This command starts a Jetty servlet container running on port 8080 serving the application.
Alternatively you can also package the war-file and deploy it manually to a servlet container of your choosing. For that to happen execute:

$ mvn clean package
$ gradlew :http:build

The resulting war-file will be located in the **target** folder.

Expand All @@ -30,13 +32,13 @@ If you are using [STS](http://www.springsource.com/developer/sts) and the projec

### Client

#### Command Line Using Maven
#### Command Line Using Gradle

In order to run the **client** using Maven, execute:
In order to run the **client** using Gradle, execute:

$ mvn clean package exec:java
$ gradlew :http:run

This will package the application and run it using the [Exec Maven Plugin](http://mojo.codehaus.org/exec-maven-plugin/)
This will package the application and run it using the [Gradle Application Plugin](http://www.gradle.org/docs/current/userguide/application_plugin.html)

#### Using an IDE such as SpringSource Tool Suite™ (STS)

Expand Down
6 changes: 3 additions & 3 deletions basic/jdbc/README.md
Expand Up @@ -19,9 +19,9 @@ You can run the application by either

* running the "Main" class from within STS (Right-click on Main class --> Run As --> Java Application)
* or from the command line:
- mvn package
- mvn exec:java


$ gradlew :jdbc:run
Make an appropriate choice for searching a Person or creating a Person.

For creating the person record, select the appropriate steps as prompted by the application.
Expand Down
7 changes: 4 additions & 3 deletions basic/jms/README.md
Expand Up @@ -17,9 +17,10 @@ It also shows an example of using Spring profiles to modify the configuration fo

The Stdout and Stdin Channel Adapters will allow you to interact with JMS via the console. It uses an embedded ActiveMQ broker.

To run the sample, simply execute the **Main** class located in the the *org.springframework.integration.samples.jms* package either from your favorite IDE or by using Maven. When using Maven you can start the sample by executing:
To run the sample, simply execute the **Main** class located in the the *org.springframework.integration.samples.jms*
package either from your favorite IDE or by using Gradle. When using Gradle you can start the sample by executing:

$ mvn clean package exec:java
$ gradlew :jms:run

You will then be prompted to run one of two demos:

Expand Down Expand Up @@ -51,4 +52,4 @@ When running either one of the demos you will see the following prompt:
* **ChannelAdapterDemo** will simply echo the response


There are also test cases that exercise both demos; utilizing Spring 3.0 profiles to route the output to a QueueChannel instead of stdout.
There are also test cases that exercise both demos; utilizing Spring 3.0 profiles to route the output to a QueueChannel instead of stdout.
7 changes: 4 additions & 3 deletions basic/jpa/README.md
Expand Up @@ -22,10 +22,11 @@ Hibernate works out of the box and there are 2 options on how to execute the sam

* running the "Main" class from within STS (Right-click on Main class --> Run As --> Java Application)
* or from the command line:
- mvn clean package
- mvn exec:exec
$ gradlew :jpa:run

For **OpenJPA** and **EclipseLink** to work, you must provide a [Java Agent](http://docs.oracle.com/javase/6/docs/api/java/lang/instrument/package-summary.html). When using the Maven Exec Plugin, this is taken care of for you behind the scenes automatically. However, when running the sample from within STS start the Main class with the following JVM flags:
For **OpenJPA** and **EclipseLink** to work, you must provide a [Java Agent](http://docs.oracle.com/javase/6/docs/api/java/lang/instrument/package-summary.html).
When using the Gradle Application Plugin, this is taken care of for you behind the scenes automatically. However,
when running the sample from within STS start the Main class with the following JVM flags:

-javaagent:/path/to/.m2/repository/org/springframework/spring-instrument/3.1.1.RELEASE/spring-instrument-3.1.1.RELEASE.jar
-javaagent:/path/to/.m2/repository/org/apache/openjpa/openjpa/2.2.0/openjpa-2.2.0.jar
Expand Down
7 changes: 4 additions & 3 deletions basic/oddeven/README.md
Expand Up @@ -36,13 +36,14 @@ The following Spring Integration components are being used:

## Running the Samples

To run the two samples, simply execute either **CronOddEvenDemo** or **IntervalOddEvenDemoTestApp** in package **org.springframework.integration.samples.oddeven**. You can also execute those two samples using the [Exec Maven Plugin](http://mojo.codehaus.org/exec-maven-plugin/):
To run the two samples, simply execute either **CronOddEvenDemo** or **IntervalOddEvenDemoTestApp** in package **org.springframework.integration.samples.oddeven**.
You can also execute those two samples using the [Gradle Application Plugin](http://www.gradle.org/docs/current/userguide/application_plugin.html):

$ mvn clean package exec:java -P cron
$ gradlew :oddeven:runCronOddEvenDemo

which will execute **CronOddEvenDemo**. In order to run **IntervalOddEvenDemoTestApp**, execute:

$ mvn clean package exec:java -P interval
$ gradlew :oddeven:runIntervalOddEvenDemoTestApp

For both samples you should see the output similar to this:

Expand Down
7 changes: 4 additions & 3 deletions basic/tcp-amqp/README.md
Expand Up @@ -28,9 +28,10 @@ If you imported the example into your IDE, you can just run class **org.springfr

* Right-click on Main class --> Run As --> Java Application

Alternatively, you can start the sample from the command line ([Maven](http://maven.apache.org/) required):
Alternatively, you can start the sample from the command line
([Gradle Application Plugin](http://www.gradle.org/docs/current/userguide/application_plugin.html)):

* mvn exec:java
$ gradlew :tcp-amqp:run

## Run Telnet

Expand Down Expand Up @@ -59,4 +60,4 @@ Some further resources:
* RabbitMQ - [http://www.rabbitmq.com/](http://www.rabbitmq.com/)
* Spring AMQP - [http://www.springsource.org/spring-amqp](http://www.springsource.org/spring-amqp)

[netcat]: http://en.wikipedia.org/wiki/Netcat
[netcat]: http://en.wikipedia.org/wiki/Netcat
8 changes: 4 additions & 4 deletions basic/tcp-client-server/README.md
Expand Up @@ -19,9 +19,9 @@ Several variations of the sample are provided:

The Client-Server Demo illustrates the use of a *Gateway* as an entry point into the integration flow. The message generated by the *Gateway* is sent over *TCP* by the *Outbound Gateway* to the *Inbound Gateway*. In turn the *Inbound Gateway* sends the message to an echo service (Class *EchoService*) and the echoed response comes back over *TCP*. The demo uses explicit *Transformer*s to convert the *byte array* payloads to *Strings*.

You can execute this sample simply via Maven:
You can execute this sample simply via Gradle:

$ mvn clean package exec:java
$ gradlew :tcp-client-server:run

Alternatively, you can also execute the **Main** method in class *org.springframework.integration.samples.tcpclientserver.Main*. In both cases you should see the following console output:

Expand Down Expand Up @@ -54,7 +54,7 @@ Alternatively, you can also execute the **Main** method in class *org.springfram

The respective open server socket it dynamically selected. Alternatively, you can also customize the port by providing an additional system property at startup e.g.

$ mvn clean package exec:java -DavailableServerSocket=7777
$ gradlew :tcp-client-server:run -DavailableServerSocket=7777

#### Connect via Telnet

Expand Down Expand Up @@ -143,4 +143,4 @@ You can run the example by executing JUnit test **TcpServerCustomSerializerTest*
[Deserializer]: http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/core/serializer/Deserializer.html
[Serializer]: http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/core/serializer/Serializer.html
[Telnet]: http://en.wikipedia.org/wiki/Telnet
[Transmission Control Protocol]: http://en.wikipedia.org/wiki/Transmission_Control_Protocol
[Transmission Control Protocol]: http://en.wikipedia.org/wiki/Transmission_Control_Protocol
7 changes: 4 additions & 3 deletions basic/ws-outbound-gateway/README.md
Expand Up @@ -19,8 +19,9 @@ Fahrenheit (90F) to Celsius (32.2C) and the result is printed to the console:

## Running the Sample

To run the sample simply execute **WebServiceDemoTestApp** in package *org.springframework.integration.samples.ws*. You can also execute that class using the [Exec Maven Plugin](http://mojo.codehaus.org/exec-maven-plugin/):
To run the sample simply execute **WebServiceDemoTestApp** in package *org.springframework.integration.samples.ws*.
You can also execute that class using the [Gradle Application Plugin](http://www.gradle.org/docs/current/userguide/application_plugin.html):

$ mvn clean package exec:java
$ gradlew :ws-outbound-gateway:run

[Simple Object Access Protocol]: http://en.wikipedia.org/wiki/SOAP
[Simple Object Access Protocol]: http://en.wikipedia.org/wiki/SOAP
6 changes: 3 additions & 3 deletions basic/xml/README.md
Expand Up @@ -10,9 +10,10 @@ This example demonstrates the following aspects of the [Extensible Markup Langua

## Running the Sample

To run the sample, execute the class **org.springframework.integration.samples.xml.BookOrderProcessingTestApp**. Alternatively, you can run the sample using [Maven][] by executing:
To run the sample, execute the class **org.springframework.integration.samples.xml.BookOrderProcessingTestApp**.
Alternatively, you can run the sample using [Gradle Application Plugin](http://www.gradle.org/docs/current/userguide/application_plugin.html) by executing:

$ mvn clean package exec:java
$ gradlew :xml:run

You should see the following output:

Expand All @@ -35,6 +36,5 @@ You should see the following output:
</bb:bigBooksOrder>

[Extensible Markup Language]: http://en.wikipedia.org/wiki/XML
[Maven]: http://maven.apache.org/
[XPath]: http://en.wikipedia.org/wiki/XPath
[XSLT]: http://en.wikipedia.org/wiki/XSLT
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -960,7 +960,7 @@ project('stored-procedures-oracle') {
mainClassName = 'org.springframework.integration.samples.storedprocedure.Main'

repositories {
maven { url 'https://code.lds.org/nexus/content/groups/main-repo' } //Oracle JDBC Driver
mavenLocal() //Oracle JDBC Driver
}

dependencies {
Expand Down
5 changes: 3 additions & 2 deletions intermediate/dynamic-poller/README.md
Expand Up @@ -12,8 +12,9 @@ When changing the polling period, the change to the trigger will occur after the
You can run the application by either:

* running the "Main" class from within STS (Right-click on Main class --> Run As --> Java Application)
* or from the command line using the [Exec Maven Plugin](http://mojo.codehaus.org/exec-maven-plugin/):
- mvn package exec:java
* or from the command line using the [Gralde](http://www.gradle.org):

$ gradlew :dynamic-poller:runHelloWorldApp

You should see output like the following:

Expand Down
4 changes: 2 additions & 2 deletions intermediate/mail-attachments/README.md
Expand Up @@ -28,8 +28,8 @@ You can run this sample by either.

* running the "Main" class from within STS (Right-click on Main class --> Run As --> Java Application)
* or from the command line:
- mvn package
- mvn exec:java

$ gradlew :mail-attachments:run

Once started, the configured mail server will be polled for new email messages every 5 seconds.

Expand Down
3 changes: 2 additions & 1 deletion intermediate/multipart-http/README.md
Expand Up @@ -19,7 +19,8 @@ To run this sample:

1. Deploy project
* If you are using STS and project is imported as Eclipse project in your workspace you can just execute **Run on Server**
* You can also run **mvn clean install** and generate the WAR file that you can deploy the conventional way
* You can also run **gradlew :multipart-http:build** and generate the WAR file that you can deploy the conventional
way
2. run the simple test client program: **org.springframework.integration.samples.multipart.MultipartClient**

You should see the following output from the server:
Expand Down
10 changes: 6 additions & 4 deletions intermediate/rest-http/readme.md
Expand Up @@ -11,15 +11,17 @@ The *Client* program is provided as a [JUnit][] test:

* RestHttpClientTest

This test-case can be used to test the HTTP Path usage. It uses Spring's [RestTemplate][] to assemble and send HTTP requests. The *Server*, on the other hand, is using Spring Integration's HTTP Endpoint configuration. The provided project itself is a web project and you can build the project using [Maven][] and deploy the resulting war under `target/rest-http-*.war` to Servlet Containers such as [Jetty][] or [Apache Tomcat][]:
This test-case can be used to test the HTTP Path usage. It uses Spring's [RestTemplate][] to assemble and send HTTP requests. The *Server*, on the other hand, is using Spring Integration's HTTP Endpoint configuration.
The provided project itself is a web project and you can build the project using [Gradle][] and deploy the resulting
war under `target/rest-http-*.war` to Servlet Containers such as [Jetty][] or [Apache Tomcat][]:

$ mvn clean verify
$ gradlew :rest-http:build

# To run this sample

1. Deploy the project
- If you are using [Spring Tool Suite][] (STS) and project is imported as Eclipse project in your workspace you can just execute 'Run on Server'
- You can also run 'mvn clean verify' and generate the WAR file that you can deploy to Servlet Containers
- You can also run **gradlew :rest-http:build** and generate the WAR file that you can deploy to Servlet Containers
2. Run the simple JUnit Test: **org.springframework.integration.samples.rest.RestHttpClientTest**
- You may change the URI Variable value in the test to see different results.

Expand Down Expand Up @@ -79,7 +81,7 @@ They are stored in `src/main/resources/users.properties`.
[cURL]: http://en.wikipedia.org/wiki/CURL
[Jetty]: http://www.eclipse.org/jetty/
[JUnit]: http://junit.org/
[Maven]: http://maven.apache.org/
[Gradle]: http://www.gradle.org
[RestTemplate]: http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/client/RestTemplate.html
[Spring Security]: http://www.springsource.org/spring-security
[Spring Tool Suite]: http://www.springsource.org/sts

0 comments on commit 95ec35c

Please sign in to comment.