首页 > 解决方案 > Spring Boot 项目中排除依赖项出错:exclusion.artifactId 值为“*”与有效的 id 模式不匹配

问题描述

如果我想用 maven 包构建我的项目,我会收到来自 Maven 的警告:在构建有效模型时遇到了一些问题

ch.mobi.ama:logcollector:jar:1.0.0-SNAPSHOT [WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.quartz-scheduler:quartz:jar 与值'*' 不匹配有效的 id 模式。@ org.springframework.boot:spring-boot-dependencies:2.1.6.RELEASE, c:\ieu.m2\repository\org\springframework\boot\spring-boot-dependencies\2.1.6.RELEASE\spring-boot- dependencies-2.1.6.RELEASE.pom,第 2619 行,第 25 列

我尝试过较旧的 Spring Boot 版本。2.1.5 版也有同样的问题。2.1.4 没有警告。在指定文件的第 2619 行spring-boot-dependencies-2.1.6.RELEASE.pom实际上有以下代码:

<dependency>
    <groupId>org.quartz-scheduler</groupId>
    <artifactId>quartz</artifactId>
    <version>${quartz.version}</version>
    <exclusions>
        <exclusion>
            <artifactId>c3p0</artifactId>
            <groupId>com.mchange</groupId>
        </exclusion>
        <exclusion>
            <artifactId>*</artifactId>
            <groupId>com.zaxxer</groupId>
        </exclusion>
    </exclusions>
</dependency>

由于给定的代码来自Spring Boot,我无法影响它并有一种不好的感觉。我的项目会正确构建吗?我必须回到版本 2.1.4 吗?我必须向 Spring Boot 报告问题吗?我能做些什么?

标签: quartz-schedulerdependency-managementparent-pomspring-boot-starter

解决方案


这是一个 Maven 新功能。将您的 Maven 升级到某个版本 > 3.2.1。

https://maven.apache.org/docs/3.2.1/release-notes.html


推荐阅读