栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

helloworld(springboot maven)

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

helloworld(springboot maven)

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

环境准备

windows环境

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



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


点击finish

项目初始目录结构


1.mainjavacomfqcheng220helloworldspringbootHelloworldSpringbootApplication.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下载依赖

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/867876.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号