|
|
|
|
|
|
25
|
----------------
|
25
|
----------------
|
|
26
|
|
26
|
|
|
27
|
- About 15 minutes
|
27
|
- About 15 minutes
|
|
28
|
- - - A favorite text editor or IDE
|
|
|
|
|
|
28
|
+ - A favorite text editor or IDE
|
|
29
|
- [JDK 6][jdk] or later
|
29
|
- [JDK 6][jdk] or later
|
|
30
|
- [Maven 3.0][mvn] or later
|
30
|
- [Maven 3.0][mvn] or later
|
|
31
|
|
31
|
|
|
|
|
|
|
|
33
|
[mvn]: http://maven.apache.org/download.cgi
|
33
|
[mvn]: http://maven.apache.org/download.cgi
|
|
34
|
|
34
|
|
|
35
|
|
35
|
|
|
36
|
-
|
|
|
|
37
|
-## How to complete this guide
|
|
|
|
|
|
36
|
+How to complete this guide
|
|
38
|
--------------------------
|
37
|
--------------------------
|
|
39
|
|
38
|
|
|
40
|
Like all Spring's [Getting Started guides](/getting-started), you can start from scratch and complete each step, or you can bypass basic setup steps that are already familiar to you. Either way, you end up with working code.
|
39
|
Like all Spring's [Getting Started guides](/getting-started), you can start from scratch and complete each step, or you can bypass basic setup steps that are already familiar to you. Either way, you end up with working code.
|
|
|
|
|
|
|
51
|
**When you're finished**, you can check your results against the code in `gs-rest-service/complete`.
|
50
|
**When you're finished**, you can check your results against the code in `gs-rest-service/complete`.
|
|
52
|
|
51
|
|
|
53
|
|
52
|
|
|
54
|
-
|
|
|
|
55
|
<a name="scratch"></a>
|
53
|
<a name="scratch"></a>
|
|
56
|
Set up the project
|
54
|
Set up the project
|
|
57
|
------------------
|
55
|
------------------
|
|
|
|
|
|
|
246
|
|
244
|
|
|
247
|
The [`@EnableAutoConfiguration`][] annotation switches on reasonable default behaviors based on the content of your classpath. For example, because the application depends on the embeddable version of Tomcat (tomcat-embed-core.jar), a Tomcat server is set up and configured with reasonable defaults on your behalf. And because the application also depends on Spring MVC (spring-webmvc.jar), a Spring MVC [`DispatcherServlet`][] is configured and registered for you — no `web.xml` necessary! Auto-configuration is a powerful, flexible mechanism. See the [API documentation][`@EnableAutoConfiguration`] for further details.
|
245
|
The [`@EnableAutoConfiguration`][] annotation switches on reasonable default behaviors based on the content of your classpath. For example, because the application depends on the embeddable version of Tomcat (tomcat-embed-core.jar), a Tomcat server is set up and configured with reasonable defaults on your behalf. And because the application also depends on Spring MVC (spring-webmvc.jar), a Spring MVC [`DispatcherServlet`][] is configured and registered for you — no `web.xml` necessary! Auto-configuration is a powerful, flexible mechanism. See the [API documentation][`@EnableAutoConfiguration`] for further details.
|
|
248
|
|
246
|
|
|
249
|
-### ### Build an executable JAR
|
|
|
|
|
|
247
|
+### Build an executable JAR
|
|
250
|
|
248
|
|
|
251
|
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.
|
249
|
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.
|
|
252
|
|
250
|
|
|
|
|
|
|
|
279
|
[maven-shade-plugin]: https://maven.apache.org/plugins/maven-shade-plugin
|
277
|
[maven-shade-plugin]: https://maven.apache.org/plugins/maven-shade-plugin
|
|
280
|
|
278
|
|
|
281
|
|
279
|
|
|
282
|
-
|
|
|
|
283
|
Run the service
|
280
|
Run the service
|
|
284
|
---------------
|
281
|
---------------
|
|
285
|
|
282
|
|