gpt4 book ai didi

maven - 我的共享(Gradle)库没有被正确读取...Artifactory Maven Pom 文件未发布排除项可能是原因

转载 作者:行者123 更新时间:2023-12-03 05:13:54 26 4
gpt4 key购买 nike

我有许多共享库,我使用 Gradle(与 Jenkins)发布到 Artifactory 并引用其他项目。当一个依赖项目从 Artifactory 下拉库时,它会失败与该库相关的测试(找不到类等)。如果我在我的 Maven 存储库中本地安装该库,一切正常,所以我只能假设 Artifactory 包和 Gradle“安装”任务包之间存在关键区别。

我比较了这两个包,pom似乎是导致问题的原因(当我手动粘贴时,Artifactory pom 文件导致我的 Maven 存储库构建失败)。我可以看到它们之间的主要区别是 Artifactory pom不包括依赖项排除:

使用“安装”Gradle 任务的本地 Maven 仓库 pom:

<groupId>blah</groupId>
<artifactId>some-library</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter</artifactId>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId> ......etc

神器发布pom:
<groupId>blah</groupId>
<artifactId>some-library</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.next.dependency</groupId>

我尝试添加一个脚本来引入这些排除项(如建议的 here ),但无法使脚本工作。

有没有人对如何让这些排除项出现有任何其他建议?还是我走错了路,可能完全是另一回事吗?

我已经玩了好几天了,所以任何建议都将不胜感激!

谢谢大家!

最佳答案

我现在进一步推进了这个问题,发现问题不在我想象的地方——所以我有一半的答案!

事实证明,缺乏排除是一条红鲱鱼。我没有提到的另一部分设置是,我已将常见的 gradle 配置提取到一个单独的模块中。这具有每个模块共有的一些依赖关系。上面问题中提到的库模块有一些额外的依赖关系,这些并没有在生成的 pom.xml 中捕获。

这似乎是 Artifactory 插件的一个突出问题,我已经追上了 here

关于maven - 我的共享(Gradle)库没有被正确读取...Artifactory Maven Pom 文件未发布排除项可能是原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37070883/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com