Maven 构建失败,错误无法找到工件

问题描述

我有一个项目 demo-parent,其中包含 2 个子项目 child1 和 child2。
demo-parent 正在构建一个 pom。
child1 和 child2 各构建一个罐子。所有这些都被上传到了神器。
demo-parent(也使用 flatten 插件

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.demos</groupId>
  <artifactId>demo-parent</artifactId>
  <packaging>pom</packaging>
  <version>${revision}</version>
  <properties>
   <revision>1.0-SNAPSHOT</revision>
  </properties>
...
</project>

child1 和 child2

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.demos</groupId>
  <artifactId>child1</artifactId>
  <packaging>jar</packaging>
  <parent>
      <groupId>com.demos</groupId>
      <artifactId>demo-parent</artifactId>
      <version>${revision}</version>
  </parent>
  <properties>
   <revision>1.0-SNAPSHOT</revision>
  </properties>
...
</project>

这个项目正在构建和上传。现在,当我在其他项目中使用这个 child1 或 child2 作为依赖项时,它失败并显示错误
Failed to execute goal on project maven-webapp: Could not resolve dependencies for the project com.demos:maven-webapp:war:1.01: Failed to collect dependencies at com.demos:child1:jar:1.0-SNAPSHOT: Failed to read artifact descriptor for com.demos:child1:jar:1.0-SNAPSHOT: Could not find artifact com.demos:demp-parent:pom:{revision} in artifactory .

我不明白为什么要搜索 com.demos:demo-parent:pom:{revision},即使搜索为什么修订版没有被 1.0-SNAPSHOT 替换,因为我在 child1 中使用了 <revision>1.0-SNAPSHOT</revision>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)