The installation instructions as well as a comprehensive HTML, EPUB formats.
Here is a quick teaser of a complete Spring Boot application in Java:
import org.springframework.boot.*; import org.springframework.boot.autoconfigure.*; import org.springframework.web.bind.annotation.*; @RestController @EnableAutoConfiguration public class Example { @RequestMapping("/") String home() { return "Hello World!"; } public static void main(String[] args) throws Exception { SpringApplication.run(Example.class, args); } }
Having trouble with Spring Boot, We’d like to help!
Check the How-to’s — they provide solutions to the most common questions.
Learn the Spring basics — Spring Boot is builds on many other Spring projects, check the guides.
Ask a questions - we monitor spring-boot.
Report bugs with Spring Boot at Building from Source
You don’t need to build from source to use Spring Boot (binaries in built with maven v3.0.5 or above. You also need JDK 1.7 (although Boot applications can run on Java 1.6).
$ mvn clean install
MAVEN_OPTS environment variable with the value -Xmx512m -XX:MaxPermSize=128m
Also see CONTRIBUTING.adoc if you wish to submit pull requests,
and in particular please fill out the
Modules
There are a number of modules in Spring Boot, here is a quick overview: The main library providing features that support the other parts of Spring Boot,
these include: The Embedded web applications with a choice of container (Tomcat or Jetty for now) First class externalized configuration support Convenience Spring Boot can configure large parts of common applications based on the content
of their classpath. A single Auto-configuration attempts to deduce which beans a user might need. For example, If
Starters are a set of convenient dependency descriptors that you can include in
your application. You get a one-stop-shop for all the Spring and related technology
that you need without having to hunt through sample code and copy paste loads of
dependency descriptors. For example, if you want to get started using Spring and JPA for
database access just include the The Spring command line application compiles and runs Groovy source, making it super
easy to write the absolute minimum of code to get an application running. Spring CLI
can also watch files, automatically recompiling and restarting when they change. Spring Boot Actuator provides additional auto-configuration to decorate your application
with features that make it instantly deployable and supportable in production. For
instance if you are writing a JSON web service then it will provide a server, security,
logging, externalized configuration, management endpoints, an audit abstraction, and
more. If you want to switch off the built in features, or extend or replace them, it
makes that really easy as well.
spring-boot
SpringApplication class, providing static convenience methods that make it easy
to write a stand-alone Spring Application. Its sole job is to create and refresh an
appropriate Spring ApplicationContextApplicationContext initializers, including support for sensible logging
defaults
spring-boot-autoconfigure
@EnableAutoConfiguration annotation triggers
auto-configuration of the Spring context.HSQLDB is on the classpath, and the user has not configured any database connections,
then they probably want an in-memory database to be defined. Auto-configuration will
always back away as the user starts to define their own beans.
spring-boot-starters
spring-boot-starter-data-jpa dependency in your
project, and you are good to go.
spring-boot-cli
spring-boot-actuator
Groovy samples for use with the command line application are available in
spring-boot-cli/samples. To run the CLI samples type
spring run <sample>.groovy from samples directory.
Java samples are available in spring-boot-samples and should
be built with maven and run by invoking java -jar target/<sample>.jar. The following
java samples are provided:
spring-boot-sample-simple — A simple command line application
spring-boot-sample-tomcat — Embedded Tomcat
spring-boot-sample-jetty — Embedded Jetty
spring-boot-sample-actuator — Simple REST service with production features
spring-boot-sample-actuator-ui — A web UI example with production features
spring-boot-sample-web-ui — A thymeleaf web application
spring-boot-sample-web-static — A web application service static files
spring-boot-sample-batch — Define and run a Batch job in a few lines of code
spring-boot-sample-data-jpa — Spring Data JPA + Hibernate + HSQLDB
spring-boot-sample-integration — A spring integration application
spring-boot-sample-profile — example showing Spring’s @profile support
spring-boot-sample-traditional — shows more traditional WAR packaging (but also executable using java -jar)
spring-boot-sample-xml — Example show how Spring Boot can be mixed with traditional XML configuration (we
generally recommend using Java @Configuration whenever possible)
The Building an Application with Spring Boot is a very basic guide that shows you how to create a simple application, run it and add some management services.
Converting a Spring Boot JAR Application to a WAR shows you how to run applications in a web server as a WAR file.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。