转载

1、撸一撸Spring-Cloud---创建Spring-Cloud父项目

本文需要对IDEA有一定的了解,清楚IDEA中项目与文件的创建,后续迭代补充基础知识

前期准备

  • 通过IDEA创建空的project
  • 通过maven创建Spring Cloud 父项目dsz-root

Spring Cloud版本选型

  • Greenwich SR2
  • Spring Boot 2.1.6.RELEASE
  • Spring 5.1.8.RELEASE
  • jdk 1.8.0_172

最终展示pom.xml和项目结构

项目结构

1、撸一撸Spring-Cloud---创建Spring-Cloud父项目

pom.xml 配置详情

<?xml version="1.0" encoding="UTF-8"?>
<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>com.dsz.platform</groupId>
    <artifactId>dsz-root</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <properties>
        <java.version>1.8</java.version>
        <spring-cloud.version>Greenwich.SR2</spring-cloud.version>
        <spring-boot.version>2.1.6.RELEASE</spring-boot.version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

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

            <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>
复制代码

下期预告《撸一撸Spring Cloud - 创建Eureka注册中心》

原文  https://juejin.im/post/5e89c4e06fb9a03c786f00b0
正文到此结束
Loading...