Sping和springBoot框架技术栈

Sping技术栈所包含的技术框架图:

Springææ¯æ 

 

Spring Boot框架图

Spring Boot是Spring框架的一部分,关于Spring的核心技术请参考Spring core technologies - spring.io

Spring Bootçç¥è¯ç¹

 

Maven项目构建创建pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>myproject</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.1.BUILD-SNAPSHOT</version>
    </parent>

    <repositories>
        <repository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/snapshot</url>
            <snapshots><enabled>true</enabled></snapshots>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <url>http://repo.spring.io/milestone</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/snapshot</url>
        </pluginRepository>
        <pluginRepository>
            <id>spring-milestones</id>
            <url>http://repo.spring.io/milestone</url>
        </pluginRepository>
    </pluginRepositories>
    <!-- 添加classpath依赖 -->
    <dependencies>
    	<dependency>
   	 	    <groupId>org.springframework.boot</groupId>
   		    <artifactId>spring-boot-starter-web</artifactId>
	    </dependency>
        <!-- 开发者工具,当classpath下有文件更新自动触发应用重启 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
	</dependencies>
    <!-- maven编译插件,用于创建可执行jar包 -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

执行mvn dependency:tree可以看到项目中的依赖关系

com.example:myproject:jar:0.0.1-SNAPSHOT
\- org.springframework.boot:spring-boot-starter-web:jar:1.4.1.BUILD-SNAPSHOT:compile
   +- org.springframework.boot:spring-boot-starter:jar:1.4.1.BUILD-SNAPSHOT:compile
   |  +- org.springframework.boot:spring-boot:jar:1.4.1.BUILD-SNAPSHOT:compile
   |  +- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.1.BUILD-SNAPSHOT:compile
   |  +- org.springframework.boot:spring-boot-starter-logging:jar:1.4.1.BUILD-SNAPSHOT:compile
   |  |  +- ch.qos.logback:logback-classic:jar:1.1.7:compile
   |  |  |  +- ch.qos.logback:logback-core:jar:1.1.7:compile
   |  |  |  \- org.slf4j:slf4j-api:jar:1.7.21:compile
   |  |  +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
   |  |  +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
   |  |  \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile
   |  +- org.springframework:spring-core:jar:4.3.3.RELEASE:compile
   |  \- org.yaml:snakeyaml:jar:1.17:runtime
   +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.4.1.BUILD-SNAPSHOT:compile
   |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.5:compile
   |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.5:compile
   |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.5:compile
   +- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile
   |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
   |  +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
   |  \- com.fasterxml:classmate:jar:1.3.1:compile
   +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.3:compile
   |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.3:compile
   |  \- com.fasterxml.jackson.core:jackson-core:jar:2.8.3:compile
   +- org.springframework:spring-web:jar:4.3.3.RELEASE:compile
   |  +- org.springframework:spring-aop:jar:4.3.3.RELEASE:compile
   |  +- org.springframework:spring-beans:jar:4.3.3.RELEASE:compile
   |  \- org.springframework:spring-context:jar:4.3.3.RELEASE:compile
   \- org.springframework:spring-webmvc:jar:4.3.3.RELEASE:compile
      \- org.springframework:spring-expression:jar:4.3.3.RELEASE:compile

 

Spring Boot 推荐的基础 POM 文件

名称说明
spring-boot-starter核心 POM,包含自动配置支持、日志库和对 YAML 配置文件的支持。
spring-boot-starter-amqp通过 spring-rabbit 支持 AMQP。
spring-boot-starter-aop包含 spring-aop 和 AspectJ 来支持面向切面编程(AOP)。
spring-boot-starter-batch支持 Spring Batch,包含 HSQLDB。
spring-boot-starter-data-jpa包含 spring-data-jpa、spring-orm 和 Hibernate 来支持 JPA。
spring-boot-starter-data-mongodb包含 spring-data-mongodb 来支持 MongoDB。
spring-boot-starter-data-rest通过 spring-data-rest-webmvc 支持以 REST 方式暴露 Spring Data 仓库。
spring-boot-starter-jdbc支持使用 JDBC 访问数据库。
spring-boot-starter-security包含 spring-security。
spring-boot-starter-test包含常用的测试所需的依赖,如 JUnit、Hamcrest、Mockito 和 spring-test 等。
spring-boot-starter-velocity支持使用 Velocity 作为模板引擎。
spring-boot-starter-web支持 Web 应用开发,包含 Tomcat 和 spring-mvc。
spring-boot-starter-websocket支持使用 Tomcat 开发 WebSocket 应用。
spring-boot-starter-ws支持 Spring Web Services。
spring-boot-starter-actuator添加适用于生产环境的功能,如性能指标和监测等功能。
spring-boot-starter-remote-shell添加远程 SSH 支持。
spring-boot-starter-jetty使用 Jetty 而不是默认的 Tomcat 作为应用服务器。
spring-boot-starter-log4j添加 Log4j 的支持。
spring-boot-starter-logging使用 Spring Boot 默认的日志框架 Logback。
spring-boot-starter-tomcat使用 Spring Boot 默认的 Tomcat 作为应用服务器。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Spring Boot 是一个基于 Spring 框架的开发框架,它是构建独立、可部署的、生产级的 Spring 应用程序的最佳选择。在使用 Spring Boot 开发应用程序时,常用的技术包括: 1. Spring Framework:Spring Boot 基于 Spring Framework,因此熟悉 Spring 框架是必备的。 2. Spring MVC:Spring MVC 是 Spring 框架中用于构建 Web 应用程序的模块,用于处理 HTTP 请求和响应。 3. Thymeleaf 或者 FreeMarker:这些是常用的模板引擎,用于在视图层渲染 HTML 页面。 4. Spring Data JPA:Spring Data JPA 是 Spring 提供的用于简化数据库访问的模块,它是 Java Persistence API(JPA)的实现。 5. Spring Security:如果你需要在应用程序中添加身份验证和授权功能,Spring Security 是一个非常好的选择。 6. Spring Boot Actuator:Actuator 是 Spring Boot 提供的监控和管理应用程序的模块,它可以帮助你暴露应用程序的健康状况、性能指标等信息。 7. 数据库:Spring Boot 支持多种数据库,包括 MySQL、PostgreSQL、Oracle、MongoDB 等。你可以根据项目需求选择合适的数据库。 8. 缓存:Spring Boot 集成了多种缓存框架,如 Ehcache、Redis 等,可以提高应用程序的性能。 9. 日志:Spring Boot 使用 Logback 或者 Log4j2 作为默认的日志框架,你可以根据需求进行配置。 10. 测试:Spring Boot 提供了方便的测试支持,包括单元测试、集成测试等。 以上是 Spring Boot 常用的技术,根据项目需求和个人喜好可以进行选择和组合。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值