04_1-微服务cloud整体聚合工程之创建父工程步骤

1、New Project

2、聚合总父工程名字

3、 Maven选版本

4、工程名字

5、字符编码

6、注解生效激活

7、java编译版本选8

8、File Type过滤

9、配置父工程 pom 文件

  • pom.xml 内容
<packaging>pom</packaging>

<!-- 统一管理 jar 版本 -->
<properties>  

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>  
    <maven.compiler.target>1.8</maven.compiler.target>
    <junit.version>4.12</junit.version>  
    <log4j.version>1.2.17</log4j.version>  
    <lombok.version>1.16.18</lombok.version>  
    <mysql.version>5.1.47</mysql.version>  
    <druid.version>1.1.16</druid.version>  
    <mybatis.spring.boot.version>1.3.0</mybatis.spring.boot.version>

</properties>

<!-- 子模块继承之后, 提供作用: 锁定版本 + 子 module 不用写 groupId 和 
version -->
<dependencyManagement>

    <dependecies>
        
        <!--spring boot 2.2.2-->
        <dependency>  
        
            <groupId>org.springframework.boot</groupId>  
            <artifactId>spring-boot-dependencies</artifactId> 
            <version>2.2.2.RELEASE</version>  
            <type>pom</type>  
            <scope>import</scope>
        
        </dependency>
        
        <!--spring cloud Hoxton.SR1-->
        <dependency>  
        
            <groupId>org.springframework.cloud</groupId> 
            <artifactId>spring-cloud-dependencies</artifactId>  
            <version>Hoxton.SR1</version>  
            <type>pom</type>  
            <scope>import</scope>
        
        </dependency>
        
        <!--spring cloud alibaba 2.1.0.RELEASE-->
        <dependency>  

            <groupId>com.alibaba.cloud</groupId>  
            <artifactId>spring-cloud-alibaba-dependencies</artifactId> 
            <version>2.1.0.RELEASE</version>  
            <type>pom</type>  
            <scope>import</scope>
        
        </dependency>
        
        <dependency>
        
            <groupId>mysql</groupId> 
            <artifactId>mysql-connector-java</artifactId>
            <version>${mysql.version}</version>
        
        </dependency>
        
        <dependency>  
        
            <groupId>com.alibaba</groupId>
            <artifactId>druid</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>junit</groupId>  
            <artifactId>junit</artifactId> 
            <version>${junit.version}</version>
        
        </dependency>
        
        <dependency> 
        
            <groupId>log4j</groupId> 
            <artifactId>log4j</artifactId> 
            <version>${log4j.version}</version>
        
        </dependency>
        
        <dependency> 
        
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>  
            <version>${lombok.version}</version>
            <optional>true</optional>

        </dependency>
        
    </dependecies>

</dependencyManagement>

<!-- 用于开启热部署devtools -->
<build>  

    <plugins>    

        <plugin>      

            <groupId>org.springframework.boot</groupId>

            <artifactId>spring-boot-maven-plugin</artifactId>  

            <configuration>       

                <fork>true</fork>        

                <addResources>true</addResources>    

            </configuration>   

        </plugin>  

    </plugins>

</build>
posted @ 2020-08-12 08:48  hellozwx  阅读(245)  评论(0编辑  收藏  举报