helloworld(springboot maven)

helloworld(springboot maven),第1张

文章目录
  • 环境准备
  • 开始
    • 项目初始目录结构
  • 运行
    • 遇到的问题

环境准备

windows环境

  1. intellij idea ultimate 2018.1
  2. jdk1.8
  3. springboot 2.6.7
开始



默认,不选择任何依赖,springboot版本为2.6.7


点击finish

项目初始目录结构


1.main\java\com\fqcheng220\helloworldspringboot\HelloworldSpringbootApplication.java

package com.fqcheng220.helloworldspringboot;

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

@SpringBootApplication
public class HelloworldSpringbootApplication {

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

}

2.main/resources/application.properties文件内容初始为空

3.pom.xml



    4.0.0
    
        org.springframework.boot
        spring-boot-starter-parent
        2.6.7
         
    
    com.fqcheng220
    helloworld-springboot
    0.0.1-SNAPSHOT
    helloworld-springboot
    Demo project for Spring Boot
    
        1.8
    
    
        
            org.springframework.boot
            spring-boot-starter
        

        
            org.springframework.boot
            spring-boot-starter-test
            test
        
    

    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
            
        
    


运行

maven自动导入pom配置的依赖,完成后,点击绿色三角run,运行ok

遇到的问题

本机pom嵌套依赖下载失败

解决方案:m2缓存里删除对应包,重新在maven project侧边窗口点击refresh下载依赖

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/877040.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-13
下一篇2022-05-13

发表评论

登录后才能评论

评论列表(0条)

    保存