我使用Maven作为CI,使用JFrog Artifactory作为我自己的工件的存储库和缓存。一切都很好。我正在使用Jenkins中的Artifactory插件来触发工件下载和上传。我不知道如何处理下面的用例。我有一个多模块的项目。在我的Settings.xml中,我定义了一些快照、插件和发布存储库。在我的本地工作区中,我升级了父项目及其子项目的pom版本。然后我做了一个本地的干净安装。它失败了,因为Maven试图从Artifactory下载我的项目的工件,而这些工件当然不存在,因为我正在尝试创建项目的新版本。如何处理这种用例?如何配置我的pom或设置呢?如何在Jenkins的Artifactory插件中以一种自由的方式做到这一点?
我收到的错误消息如下:
10:23:28传输失败无法在xxx中找到元数据com.xxx.xxxx.xxx:my-parent-project:3.0.0-SNAPSHOT/maven-metadata.xml 10:23:50 com.xxx.xxx.xxx:subpoject1:未知-版本:无法在错误的本地POM @第7行,第10列找到工件.....and 'parent.relativePath‘点
=====================================
父pom的pom配置
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxx.xxx.xxx</groupId>
<artifactId>my-parent-project</artifactId>
<version>3.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>../subproject-1</module>
<module>../subproject-2</module>
</modules>==================================
subproject1的pom配置
<artifactId>subproject-1</artifactId>
<parent>
<groupId>com.xxx.xxx.xxx</groupId>
<artifactId>my-parent-project</artifactId>
<version>3.0.0-SNAPSHOT</version>
</parent>======================================
这是我的settings.xml配置
<profile>
<id>artifactory_profile</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://xxxxxxxxxxxx:8081/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://xxxxxxxxxxxx:8081/artifactory/libs-snapshot</url>
</repository>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>sing</id>
<name>sing-virtual-repo</name>
<url>http://xxxxxxxxxxxx:8081/artifactory/virtual-repo</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://xxxxxxxxxxxx:8081/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-release</name>
<url>http://xxxxxxxxxxxx:8081/artifactory/plugins-release</url>
</pluginRepository>
</pluginRepositories>
</profile>发布于 2021-02-15 19:17:30
如果您在父POM上运行clean install,那么一切都将被正确创建。
https://stackoverflow.com/questions/66206539
复制相似问题