1.3使用marven Spring项目快速搭建
2023-09-14 09:07:36 时间
自己开发了一个股票智能分析软件,功能很强大,需要的点击下面的链接获取:
https://www.cnblogs.com/bclshuai/p/11380657.html
1.3 Spring项目快速搭建
(1)marven介绍
marven是软件项目管理工具,可以方便的创建项目,管理依赖关系,自动从远程仓库下载依赖包到本地仓库m2文件夹中。
(2)dependency三要素
通过pom.xml文件配置依赖的jar包,会自动根据配置文件下载。依赖三要素
1) groupId:组织标识
2) artifactId:项目标识;
3) version版本号;
<dependency>
<groupId>com.hikvision.pbg.jc.ishelf</groupId>
<artifactId>ishelf-web-business</artifactId>
<version>${ishelf-web-business-version}</version>
</dependency>
(2)<properities>定义属性
例如定义一个版本号,然后在version中使用${proname}来引用属性。
<properties>
<ishelf-web-business-version>2.0.0-SNAPSHOT</ishelf-web-business-version>
</properties>
pom.xml实例
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.hikvision.pbg.jc.ishelf</groupId>
<artifactId>modules</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<artifactId>ishelf-web-provider</artifactId>
<packaging>jar</packaging>
<properties>
<ishelf-web-business-version>2.0.0-SNAPSHOT</ishelf-web-business-version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- 本服务的api接口包 -->
<dependency>
<groupId>com.hikvision.pbg.jc.ishelf</groupId>
<artifactId>ishelf-web-external-api</artifactId>
<version>2.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.hikvision.pbg.jc.ishelf</groupId>
<artifactId>ishelf-web-business</artifactId>
<version>${ishelf-web-business-version}</version>
</dependency>
<dependency>
<groupId>com.hikvision.ga.common</groupId>
<artifactId>hik-ga-boot-resteasy</artifactId>
</dependency>
</dependencies>
</project>
相关文章
- spring的@Transactional注解详细用法
- spring mvc: 页面重定向调整
- spring boot: 线程池ThreadPoolTaskExecutor, 多线程
- Spring 官网下载zip jar
- spring boot:多模块项目生成jar包(spring boot 2.3.3)
- Spring Cloud Alibaba | Dubbo 与 Spring Cloud 完美结合
- 使用spring 4.0 + maven 构建超简单的web项目
- Spring MVC interceptor拦截指定后缀请求
- intellij idea 2021.2 打包并上传运行一个spring boot项目(spring boot 2.5.4)
- spring boot配置dubbo(XML)
- spring mvc工作原理及组件说明
- spring boot新建非web项目(无需依赖)
- 【收藏】Spring Boot项目中使用最新版HBase Java API操作HBase 2.x详解
- Spring 视图和视图解析器简介
- Atitit.mybatis的测试 以及spring与mybatis在本项目中的集成配置说明
- MongoDB最简单的入门教程之四:使用Spring Boot操作MongoDB
- 【项目实战】Spring Boot集成JavaMailSender发送邮件
- 004-Spring boot 快速入门-项目搭建与启动、SpringBootApplication、启动图标
- Http请求中Content-Type讲解以及在Spring MVC中的应用