SpringBoot构建、部署及启动

 

Spring Boot 是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程。 该框架使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置。

构建

https://start.spring.io/

依赖

DEVELOPER TOOLS

Spring Boot DevTools Lombok Spring Configuration Processor

WEB

Spring Web Spring Reactive Web Rest Respositories Spring Session Rest Repositories HAL Explorer Spring HATEOAS Jersey Vaadin

TEMPLATE ENGINES

Thymeleaf Apache Freemarker Mustache Groovy Templates

SECURITY

Spring Security OAuth2 Resource Server Spring LDAP Okta

SQL

JDBC API Spring Data JPA Spring Data JDBC Spring Data R2DBC MyBatis Framework Flyway Migration JOOQ Access Layer IBM DB2 Driver Apache Derby Database H2 Database HyperSQL Database MariaDB Driver MS SQL Server Driver MySQL Driver Oracle Driver PostgreSQL Driver

NOSQL

Spring Data Redis Spring Data Reactive Redis Spring Data MongoDB Spring Data Elasticsearch Spring Data for Apache Cassandra Spring Data Reactive for Apache Cassandra Spring for Apache Geode Spring Data Couchbase Spring Data Reactive Couchbase Spring Data Neo4j

MESSAGING

Spring Integration Spring for RabbitMQ Spring for Apache Kafka Spring for Apache Kafka Streams Spring for Apache ActiveMQ 5 Spring for Apache ActiveMQ Artemis

```RSocket```
```Apache Camel```
```Solace PubSub+```

###### I/O

```Spring Batch```
```Validation```
```Java Mail Sender```
```Quartz Scheduler```
```Spring cache abstraction```

###### OPS

```Spring Boot Actuator```
```Codecentric's Spring Boot Admin(Client)```
```Codecentric's Spring Boot Admin(Server)```

###### OBSERVABILITY

```Datadog```
```Influx```
```Graphite```
```New Relic```
```Prometheus```
```Sleuth```
```Wavefront```
```Zipkin Client```

#### 项目目录

项目名称/
README.md
.git/
pom.xml src/
main/ java/ // java源代码 包名/ controller/ dao/ entity/ service/ utils/ MainConfiguration.java MainApplication.java resources/ // 资源,比如说property文件,springmvc.xml application.properties webapp/WEB-INF/ // web应用文件目录,比如存放web.xml、本地图片、jsp视图页面 test/ // 测试类 target/ // 打包输出目录


## 部署

#### jar

// 修改application.properties server.port = tomcat监听的端口

// Terminal中输入 mvn clean package


在```项目路径/target/```下可找到内置```tomcat```的```jar包```。把它上传到服务器。  

#### war

## 启动

###### Linux & jar

nohup java -jar jar包 & ```