Springboot project to build (1)

(1) create a MavenProject

(2) modify the pom file, add the following

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.18.RELEASE</version>
    </parent> 
        <!--web应用基本环境配置 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
    <build>
        <plugins>
            <!-- spring-boot-maven-plugin插件就是打包spring boot应用的 -->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

(3) Add Profile application.properties

  1) Create a resource folder under src / main path

  2) Create a application.properties  

  

  3) The resource folder to the source folder

  

 

 (4) add a startup class

package com.songyan.share;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
* @author songyan
* @Date 2020 Nian 3 Yue 19 Ri 9:49:19 AM
* @Desc startup class
*/
@SpringBootApplication
public class Application 
{
    public static void main( String[] args )
    {
        SpringApplication.run(Application.class, args);
    }
}

 

Guess you like

Origin www.cnblogs.com/excellencesy/p/12522248.html