【maven】maven使用中遇到的问题记录

依赖冲突
如下图

解决,去除该依赖下冲突的包

<dependency>
    <groupId>org.flowable</groupId>
    <artifactId>flowable-spring-boot-starter-process</artifactId>
    <version>${flowable.version}</version>
    <exclusions>
        <exclusion>
            <groupId>org.flowable</groupId>
            <artifactId>flowable-dmn-api</artifactId>
        </exclusion>
    </exclusions>
</dependency>

子模块的引入

<modules>
    <module>ssm-service</module>
    <module>ssm-web</module>
</modules>

子模块有父模块定义的依赖,无需重复导入
依赖版本管理

<properties>
    <springframework.version>5.1.9.RELEASE</springframework.version>
</properties>
<dependencies>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${springframework.version}</version>
    </dependency>
</dependencies>

使用变量统一管理多个依赖

可以使用一个子模块依赖另一个子模块

<dependencies>
    <dependency>
        <groupId>xff</groupId>
        <artifactId>ssm-service</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
</dependencies>

如若项目运行报错,找不到依赖的子模块的bean,需要做下图操作