- 安装maven与配置
- 配置maven
- 安装插件
已经装好了idea与jdk
安装maven与配置
下载地址: https://maven.apache.org/download.cgi
下载合适的版本
配置maven
打开设置:
 直接搜索 :maven
 直接搜索 :maven
配置变量:
此电脑->属性->高级系统设置->环境变量
 
 
  
 
 新建系统变量 MAVEN_HOME,变量值:你是安装路径
path:添加变量值:;%MAVEN_HOME%\bin
然后配置你安装的路径
 
 
 安装插件
插件搜索spring->安装相关插件
 
 
 然后就可以新建项目了:
 
 
 选择spring的项目其他消息自己按需求填
配置application.yml文件:
  server:
    tomcat:
      uri-encoding: UTF-8
      threads:
        max: 200
        min-spare: 30
      connection-timeout: 5000ms
    port: 8080
写一个hello world运行一下
package app.helloworld3;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.beans.factory.annotation.Autowired;
@SpringBootApplication
public class Helloworld3Application {
    public static void main(String[] args) {
        SpringApplication.run(Helloworld3Application.class, args);
    }
    @RestController
    public class helloworld {
        @GetMapping("/index")
        public String index() {
            return "Hello World";
        }
    }
  }
记得配置一下pom.xml文件
然后run一下:
 
 
 没有问题
本文由 mdnice 多平台发布


















