zoukankan      html  css  js  c++  java
  • 一份真实可用的SpringBoot的pom.xml文件+Application启动类

    <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.xxxx</groupId>
      <!--项目名-->
      <artifactId>xxxx</artifactId>
      <version>0.0.1-SNAPSHOT</version>
    
      <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.6.RELEASE</version>
        <relativePath></relativePath>
      </parent>
    
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
      </properties>
    
      <dependencies>
        <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-test</artifactId>
        </dependency>
        <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
              <fork>true</fork>
            </configuration>
          </plugin>
        </plugins>
      </build>
    
    </project>

    依赖版本报红换个版本就行,另附启动类

    
    


    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
    import org.springframework.boot.builder.SpringApplicationBuilder;
    import org.springframework.scheduling.annotation.EnableScheduling;


    @SpringBootApplication
    @EnableAutoConfiguration(exclude = HibernateJpaAutoConfiguration.class)
    @EnableScheduling
    public class Application {

    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
    return application.sources(Application.class);
    }

    public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
    }


    }
    
    
    学习时的痛苦是暂时的 未学到的痛苦是终生的
    本文版权归作者和博客园共有,欢迎转载,但必须给出原文链接,并保留此段声明,否则保留追究法律责任的权利。
  • 相关阅读:
    编写高质量代码建议17代码错误调试
    同步和异步的不同场景的概念理解
    kafka版本0.8.2.0-Producer Configs之request.required.acks
    linux的grep命令
    jetty服务器访问系统的域名
    linux工具问题,tail -f 失效
    memcached并发处理
    python爬虫scrapy的Selectors参考文档
    访问nginx提示gateway timeout 504 ,发现总是当调用时间超过30s时提示504错误
    重构再次理解
  • 原文地址:https://www.cnblogs.com/juanxincai/p/12851085.html
Copyright © 2011-2022 走看看