1. 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>org.example</groupId>
       <artifactId>A5_zk_springboot_thymeleaf</artifactId>
       <version>1.0-SNAPSHOT</version>
    
       <properties>
           <maven.compiler.source>17</maven.compiler.source>
           <maven.compiler.target>17</maven.compiler.target>
           <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
       </properties>
    
       <!--导入springboot父工程-->
       <parent>
           <artifactId>spring-boot-starter-parent</artifactId>
           <groupId>org.springframework.boot</groupId>
           <version>2.5.3</version>
       </parent>
    
       <dependencies>
           <!--导入web项目场景启动器:自动导入和web开发相关的所有依赖【库/jar】,类似打包刷入-->
           <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-web</artifactId>
           </dependency>
    
           <!--引入springboot测试类所需依赖-->
           <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-test</artifactId>
           </dependency>
    
           <!--处理一些提示类问题,比如不必要的警告或者yml文件编写时的提示-->
           <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-configuration-processor</artifactId>
               <!--防止将此依赖传递到其他模块-->
               <optional>true</optional>
           </dependency>
    
       </dependencies>
    
    </project>
  2. 创建启动类Application.java,比如包结构com.zuke.fakawang.controller,那么,启动类放在com.zuke.fakawang.Application.java

    import org.mybatis.spring.annotation.MapperScan;
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    import org.springframework.boot.web.servlet.ServletComponentScan;
    
    @SpringBootApplication
    public class Application {
    
       public static void main(String[] args) {
           SpringApplication.run(Application.class, args);
       }
    }
分类: windows 标签: idea SpringBoot

评论

全部评论

暂无目录