com.projects.proj1 com.projects.proj2
我们有两个单独的多模块 maven 项目。
-------------proj1-------------------
<project xmlns="http://maven.apache.org/POM/4.0.0"...>
<modelVersion>4.0.0</modelVersion>
<groupId>com.proj1</groupId>
<artifactId>proj1</artifactId>
<packaging>pom</packaging>
<version>0.11.0</version>
<description>proj1</description>
<modules>
<module>all</module>
<module>core</module>
<module>ui.frontend</module>
<module>ui.apps</module>
<module>ui.apps.structure</module>
<module>ui.content</module>
</modules>
-------------proj2-----------
<project xmlns="http://maven.apache.org/POM/4.0.0"...>
<modelVersion>4.0.0</modelVersion>
<groupId>com.proj2</groupId>
<artifactId>proj2</artifactId>
<packaging>pom</packaging>
<version>0.1.0</version>
<description>proj2</description>
<modules>
<module>all</module>
<module>core</module>
<module>ui.frontend</module>
<module>ui.apps</module>
<module>ui.apps.structure</module>
<module>ui.content</module>
</modules>
<!-- proj1 Dependencies -->
<dependency>
<groupId>com.proj1</groupId>
<artifactId>proj1.ui.apps</artifactId>
<type>zip</type>
<version>0.11.0</version>
</dependency>
<dependency>
<groupId>com.proj1</groupId>
<artifactId>proj1.core</artifactId>
<version>0.11.0</version>
<classifier>classic</classifier>
</dependency>
</dependencies>
</dependencyManagement>
当我运行 mvn clean install proj1 和 proj2 时,它在我的本地运行正常。 proj2 正确选择依赖项。 如果我们在 Azure Devops 管道中运行,那么 proj2 将失败并显示以下错误消息。
[ERROR] Failed to execute goal on project proj2.ui.apps: Could not resolve dependencies for project com.proj2:proj2.ui.apps:content-package:0.1.0-SNAPSHOT: Failure to find com.proj1:proj1.ui.apps:zip:0.11.0 in https://repo.adobe.com/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of adobe-public-releases has elapsed or updates are forced -> [Help 1]