标签:IV jdk8 target 4.0 idt err 复制 sch splay
必需学会SpringBoot基础知识
Takes an opinionated view of building production-ready Spring applications. Spring Boot favors convention over configuration and is designed to get you up and running as quickly as possible.
JDK8
apache-maven-3.5.2
IntelliJ IDEA 2018.1.3 x64
准备工作
通过之前章节进行改造,更符合企业需求。
先做一个简单 Web Flux 项目
理论分析
模型层: model
持久层: persostence
表示层: web
web 依赖 persostence
persostence 依赖 model
first-app-demo
<?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.lwc</groupId> <artifactId>first-app-demo</artifactId> <version>0.0.1-SNAPSHOT</version> <modules> <module>web</module> <module>persostence</module> <module>model</module> </modules> <!--修改成 pom--> <packaging>pom</packaging> <!-- 模型层: model 持久层: persostence 表示层: web web 依赖 persostence persostence 依赖 model web UserController -> UserRepository -> User --> <name>first-app-demo</name> <description>Demo project for Spring Boot</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.2.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>io.projectreactor</groupId> <artifactId>reactor-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project>
web.pom
<?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.0http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>first-app-demo</artifactId> <groupId>com.lwc</groupId> <version>0.0.1-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>web</artifactId> <dependencies> <!-- 添加对persostence依赖 --> <dependency> <groupId>com.lwc</groupId> <artifactId>persostence</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> </dependencies> </project>
persostence.pom
<?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.0http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>first-app-demo</artifactId> <groupId>com.lwc</groupId> <version>0.0.1-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>persostence</artifactId> <dependencies> <!-- 添加对model依赖 --> <dependency> <groupId>com.lwc</groupId> <artifactId>model</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> </dependencies> </project>
model.pom
<?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.0http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>first-app-demo</artifactId> <groupId>com.lwc</groupId> <version>0.0.1-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>model</artifactId> </project>
源码下载
https://github.com/eddie-code/SpringBootDemo/tree/master/first-app-demo
标签:IV jdk8 target 4.0 idt err 复制 sch splay
原文地址:https://www.cnblogs.com/EddieBlog/p/9158931.html