|
|
|
|
|
|
47
|
To **skip the basics**, do the following:
|
47
|
To **skip the basics**, do the following:
|
|
48
|
|
48
|
|
|
49
|
- [Download][zip] and unzip the source repository for this guide, or clone it using [Git][u-git]:
|
49
|
- [Download][zip] and unzip the source repository for this guide, or clone it using [Git][u-git]:
|
|
50
|
-`git clone https://github.com/springframework-meta/gs-rest-service.git`
|
|
|
|
|
|
50
|
+`git clone https://github.com/spring-guides/gs-rest-service.git`
|
|
51
|
- cd into `gs-rest-service/initial`.
|
51
|
- cd into `gs-rest-service/initial`.
|
|
52
|
- Jump ahead to [Create a resource representation class](#initial).
|
52
|
- Jump ahead to [Create a resource representation class](#initial).
|
|
53
|
|
53
|
|
|
54
|
**When you're finished**, you can check your results against the code in `gs-rest-service/complete`.
|
54
|
**When you're finished**, you can check your results against the code in `gs-rest-service/complete`.
|
|
55
|
-[zip]: https://github.com/springframework-meta/gs-rest-service/archive/master.zip
|
|
|
|
|
|
55
|
+[zip]: https://github.com/spring-guides/gs-rest-service/archive/master.zip
|
|
56
|
[u-git]: /understanding/Git
|
56
|
[u-git]: /understanding/Git
|
|
57
|
|
57
|
|
|
58
|
|
58
|
|
|
|
|
|
|
|
73
|
|
73
|
|
|
74
|
|
74
|
|
|
75
|
### Create a Gradle build file
|
75
|
### Create a Gradle build file
|
|
76
|
-Below is the [initial Gradle build file](https://github.com/springframework-meta/gs-rest-service/blob/master/initial/build.gradle). But you can also use Maven. The pom.xml file is included [right here](https://github.com/springframework-meta/gs-rest-service/blob/master/initial/pom.xml).
|
|
|
|
|
|
76
|
+Below is the [initial Gradle build file](https://github.com/spring-guides/gs-rest-service/blob/master/initial/build.gradle). But you can also use Maven. The pom.xml file is included [right here](https://github.com/spring-guides/gs-rest-service/blob/master/initial/pom.xml).
|
|
77
|
|
77
|
|
|
78
|
`build.gradle`
|
78
|
`build.gradle`
|
|
79
|
```gradle
|
79
|
```gradle
|
|
|
|
|
|
|
246
|
|
246
|
|
|
247
|
Now that your `Application` class is ready, you simply instruct the build system to create a single, executable jar containing everything. This makes it easy to ship, version, and deploy the service as an application throughout the development lifecycle, across different environments, and so forth.
|
247
|
Now that your `Application` class is ready, you simply instruct the build system to create a single, executable jar containing everything. This makes it easy to ship, version, and deploy the service as an application throughout the development lifecycle, across different environments, and so forth.
|
|
248
|
|
248
|
|
|
249
|
-Below are the Gradle steps, but if you are using Maven, you can find the updated pom.xml [right here](https://github.com/springframework-meta/gs-rest-service/blob/master/complete/pom.xml) and build it by typing `mvn clean package`.
|
|
|
|
|
|
249
|
+Below are the Gradle steps, but if you are using Maven, you can find the updated pom.xml [right here](https://github.com/spring-guides/gs-rest-service/blob/master/complete/pom.xml) and build it by typing `mvn clean package`.
|
|
250
|
|
250
|
|
|
251
|
Update your Gradle `build.gradle` file's `buildscript` section, so that it looks like this:
|
251
|
Update your Gradle `build.gradle` file's `buildscript` section, so that it looks like this:
|
|
252
|
|
252
|
|
|
|
|
|
|
|
267
|
```groovy
|
267
|
```groovy
|
|
268
|
apply plugin: 'spring-boot'
|
268
|
apply plugin: 'spring-boot'
|
|
269
|
```
|
269
|
```
|
|
270
|
-You can see the final version of `build.gradle` [right here]((https://github.com/springframework-meta/gs-rest-service/blob/master/complete/build.gradle).
|
|
|
|
|
|
270
|
+You can see the final version of `build.gradle` [right here]((https://github.com/spring-guides/gs-rest-service/blob/master/complete/build.gradle).
|
|
271
|
|
271
|
|
|
272
|
The [Spring Boot gradle plugin][spring-boot-gradle-plugin] collects all the jars on the classpath and builds a single "über-jar", which makes it more convenient to execute and transport your service.
|
272
|
The [Spring Boot gradle plugin][spring-boot-gradle-plugin] collects all the jars on the classpath and builds a single "über-jar", which makes it more convenient to execute and transport your service.
|
|
273
|
It also searches for the `public static void main()` method to flag as a runnable class.
|
273
|
It also searches for the `public static void main()` method to flag as a runnable class.
|