SpringBoot项目离线环境手动构建的过程
内容来自黑马程序员-JavaWeb开发教程
1. 创建maven项目
在idea中创建一个maven项目,正常填写项目的坐标信息。如下图所示:

输入项目的基本信息之后,点击finish,就可以创建一个maven项目。

但是这个maven项目目前并不是springboot项目,我们还需要做如下两步操作。
2. pom.xml配置
1). 在pom.xml中指定springboot的父工程
<!-- springboot父工程-->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>2). 添加springboot项目的起步依赖以及maven插件
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>3. 基本结构
1). 创建基本的包结构 com.itheima,并创建启动类 SpringBootDemoApplication
2). 并在resources目录下准备一份配置文件,application.properties (创建一个新的file文件,命名为application.properties)

到此呢,我们就手动创建好了这样一个springboot项目
到此这篇关于SpringBoot项目离线环境手动构建的文章就介绍到这了,更多相关SpringBoot离线环境内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
相关文章
ArrayList foreach循环增添删除导致ConcurrentModificationException解决分
这篇文章主要为大家介绍了ArrayList foreach循环增添删除导致ConcurrentModificationException解决分析,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪<BR>2023-12-12
SpringBoot读取自定义配置文件方式(properties,yaml)
这篇文章主要介绍了SpringBoot读取自定义配置文件方式(properties,yaml),具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教2022-07-07
Spring BeanPostProcessor接口使用详解
本篇文章主要介绍了Spring BeanPostProcessor接口使用详解,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧2018-01-01


最新评论