首页 > 其他分享 >Spring boot —— 创建parent工程

Spring boot —— 创建parent工程

时间:2022-12-19 11:38:41浏览次数:46  
标签:parent Spring boot springframework maven spring org cloud


方式一

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.9.RELEASE</version>
    </parent>

<dependencyManagement>
        <dependencies>

       <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cc.chco</groupId>
<artifactId>chco-parent</artifactId>
<version>0.1.0</version>
<packaging>pom</packaging>

<name>chco</name>
<url>http://www.chco.cc</url>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent>


<modules>
<module>chco-portal</module>
<module>chco-eureka</module>
</modules>

<properties>
<spring-cloud.version>Edgware.SR1</spring-cloud.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<druid.version>1.1.10</druid.version>
<mybatisplus.version>2.1.9</mybatisplus.version>
<mybatisplus.spring.boot.version>1.0.5</mybatisplus.spring.boot.version>
<mssql.version>4.0</mssql.version>
<oracle.version>11.2.0.3</oracle.version>
<commons.lang.version>2.6</commons.lang.version>
<mybatis.spring.boot.version>1.3.0</mybatis.spring.boot.version>
<commons.fileupload.version>1.3.1</commons.fileupload.version>
<fastjson.version>1.2.45</fastjson.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!-- mysql驱动 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- mssql驱动 -->
<!-- postgresql驱动 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis.spring.boot.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>

方式二

引入依赖:

        <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>2.0.6.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Finchley.SR2</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.silucaihong</groupId>
<artifactId>silkroad</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<name>silkroad</name>
<description>父项目,用于统一执行package等Maven命令</description>
<modules>
<module>silkroad-scheduling-api</module>
<module>silkroad-scheduling-feign</module>
<module>silkroad-scheduling-service</module>

</modules>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<fastjson.version>1.2.45</fastjson.version>
<commons-beanutils.version>1.9.3</commons-beanutils.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>

<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${commons-beanutils.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.0.6.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Finchley.SR2</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>cn.silucaihong</groupId>
<artifactId>silkroad-pbmodel</artifactId>
<version>1.0.0</version>
</dependency>

</dependencies>
</dependencyManagement>

<repositories>
<repository>
<id>aliyun</id>
<name>aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</repository>
</repositories>
</project>

 

标签:parent,Spring,boot,springframework,maven,spring,org,cloud
From: https://blog.51cto.com/u_10176086/5951806

相关文章

  • springboot实现AOP切面编程
    概述AOP(AspectOrientedProgramming)即面向切面编程。面向切面是面向对象中的一种方式而已。在代码执行过程中,动态嵌入其他代码,叫做面向切面编程(将交叉业务逻辑封装成成......
  • Spring boot 入门 ---(一)
    环境JavaSDKv1.6或更高版本。这里使用maven作为构建工具下面是一个典型的pom.xml文件:配置pom.xml文件<?xmlversion="1.0"encoding="utf-8"?><projectxmlns="http://mav......
  • spring boot 整合 FastDFS_Client
    FastDFS-Client使用方式1.在项目Pom当中加入依赖Maven依赖为<dependency><groupId>com.github.tobato</groupId><artifactId>fastdfs-client</artifactId><vers......
  • Spring boot整合 Swagger2 以及遇到的坑
    一、引入依赖:<dependency><groupId>io.springfox</groupId><artifactId>springfox-swagger2</artifactId><version>2.5.0</version></dependency><dependency><gro......
  • spring boot踩坑日记——idea找不到配置文件
    报错:  原因springboot启动时找不到配置文件可以看出配置文件图标显示不对: 解决:标注配置文件......
  • 亲手实现一个springboot默认配置&起步加载
    实现一、默认配置1、创建springboot项目引入spring-boot-dependencies依赖<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-......
  • 【java】(二) SpringBoot 源码解析——run启动加载过程——准备环境
    1.前言深入学习springboot笔记系列,可能会有错误还请指正,互相勉励,互相学习。上一章讲了SpringApplicaiton是如何初始化的,本章讲解后续的run方法的启动过程。本章涉及......
  • spring boot 环境下使用logback
    一、logback的介绍    Logback是由log4j创始人设计的又一个开源日志组件。logback当前分成三个模块:logback-core,logback-classic和logback-access。logback-core是其......
  • spring boot —— 整合Scheduling定时任务
    Spring3.0后提供SpringTask实现任务调度,支持按日历调度,相比Quartz功能稍简单,但是在开发基本够用,支持注解编程方式。使用启用在springboot启动类上添加注解:@EnableSch......
  • SpringMVC核心技术
    入门程序Web.xml(前端控制器)配置:        在web.xml中添加DispatcherServlet的配置。         <servlet><servlet-name>springmvc</servlet......