springboot(29) : 无数据库web服务

参考 : spring boot无数据库连接启动_Mr__Miss的博客-CSDN博客

pom.xml



    4.0.0

    org.example
    img_see
    1.0-SNAPSHOT

    jar

    
        org.springframework.boot
        spring-boot-starter-parent
        2.0.3.RELEASE
    

    
        1.8
        1.3.1
        2.9.8
    

    
        
            org.springframework.boot
            spring-boot-starter-web
        
        
            com.fasterxml.jackson.core
            jackson-databind
            ${jackson.version}
        
        
            com.fasterxml.jackson.core
            jackson-core
            ${jackson.version}
        
    

    
        springboot-start
        
            
                src/main/java
                
                    **/*.yml
                    **/*.properties
                    **/*.xml
                
                false
            
            
                src/main/resources
                
                    **/*.yml
                    **/*.properties
                    **/*.xml
                
                false
            
        
        
            
                org.apache.maven.plugins
                maven-compiler-plugin
                
                    1.8
                    1.8
                    UTF-8
                
            
            
                org.springframework.boot
                spring-boot-maven-plugin
                
                    
                    cn.nordrassil.img.see.Application
                    ZIP
                    true
                
                
                    
                        
                            repackage
                        
                    
                
            
            
                org.apache.maven.plugins
                maven-surefire-plugin
                
                    true
                
            
        
    


application.properties

server.port=10001

Application.java

package cn.nordrassil.img.see;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;

@SpringBootApplication(exclude={DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
public class Application {
 
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

SystemController.java

package cn.nordrassil.img.see.controller;
 
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * @Auther: liyue
 * @Date: 2020/4/27 15:13
 * @Description:
 */
@RestController
public class SystemController {
 
    public final static String SUCCESS = "SUCCESS";
 
    @RequestMapping("/live")
    public String live() {
        return SUCCESS;
    }
}

logback-spring.xml



    
    
    

    

    
    
    
    

    
    

    
    
        
            
            DEBUG
        
        
            ${CONSOLE_LOG_PATTERN}
            utf8
        
    

    
    
        ${LOG_FILE_DIR}/${appName}.log
        true
        
        
            
            30
            
            500MB
            
            20GB
            ${HIS_LOG_FILE_DIR}/${appName}.%d{yyyy-MM-dd}.log.%i.gz
        
        
            %d{yyyy-MM-dd HH:mm:ss.SSS}|%level|%logger{36}:%line|%thread|%X{traceId}|%msg%n
        
    

    
        
        
        
        0
        1024
        true
        
    

    
        
            
        
    

    
        
            
        
    

你可能感兴趣的:(#,springboot,spring,boot,数据库,前端,快速,web服务)