Maven’s father and son dependence management and SpringBoot startup

2023-03-18  

If it is a sub -bag, it will inherit all the contents of the parent bag.
but the content that is selectively inherited, it is just a version of management tools. The so -called selectivity means that if you do n’t write, you do n’t inherit. If you write all and include the version number, you can also follow the subcubble. If you write a group and project, the version number will be inherited from the parent class.
Note: Both inheritance methods need to make an interactive statement in POM in the father -in -law.
5 pom is as follows:

<parent>
        <artifactId>msb-dongbao-service</artifactId>
        <groupId>com.msb</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>

Father pom as follows:

 <modules>
        <module>msb-dongbao-oms</module>
    </modules>

PR: So SpringBoot’s starter is the Parent dependencies that introduce Spring in the project. In this way, all the SpringBoot -related jar packages came in in one breath.

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

Note: Import is only used, indicating that all dependencies in this project are introduced. In general, the introduction of all the dependencies of a project can only be inherited in China, but Parent can only write one, so it is written here.

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

source

Random Posts

Seven minutes Learn to make HTML webpage production

Raspberry Pi 3B Set MJPG-Streame

nginx proxy mysql (under Window)

mysql manual 07 storage engine

vector, linked list, stack and queue