1. Open the idea, new project
Delete src folder
2, a jar of the new module
We created a common project of the module
we talk pom files in the project to see the system automatically join the common this module
we enter the common module pom file, the introduction of the root item pom
2, a new module of war
We check on the create form archetype options
We found more than a webapp talk to modules pom file project
We file into the webapp's pom, pom root project introduction and war
New java folder and the resources folder
But these two documents did not change color, not the real sources and resources folders, we continue to operate
Observe the color and logo java and resources folders
java webapp in the new file folders, a subsequent operation to
3, dependent on the introduction springboot
1), with the pom file
by adding the following dependence on outside dependencies
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
</parent>
Join in what dependencies dependent
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
2), in the webapp pom file
by adding the following dependencies in the dependency
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
Here we import the common module
3), the new file application.yml resources, set the start port 8080 Tomcat
4), a new java file at start
@SpringBootApplication
public class WebApplication {
public static void main(String[] args) {
SpringApplication.run(WebApplication.class, args);
}
}
5), right on the start springboot WebApplication files
we have started up, and in the log we can see the start port 8080