jenkins中的传递依赖管理

时间:2019-05-15 12:46:14

标签: java jenkins dependency-management

我有一个project专家,其中有很多数据流处理器和Drop-wizard服务。

其中db-source-容纳所有DAO,而Entitiesclient-source-容纳外部服务端点,所有project中的> apps
到目前为止,每个子应用程序都在其自己的pom中分别添加了对它们的依赖关系,现在我认为应该使用<dependencyManagement>的POM上的project将其依赖关系转换为通用版本。

这是表面上的项目结构

+ project
    + db-source - pom.xml => picks version from build.properties
    + client-source  - pom.xml => picks version from build.properties
    + fabric - pom.xml => has db and client and there versions are picked from project_POM
    + the_pain_repo - pom.xml => uses fabric and picks its version from project_POM
+ project_POM

project_POM包含<dependencyManagement>和其他存储库中使用的db-sourceclient-source版本的fabricthe_pain_repo是一个所提到的示例存储库)

因此,如果您观察到,<dependencyManagement>如下所示

   ==> fabric -> project_POM
   ==> the_pain_repo -> fabric -> project_POM   

现在,从project_POM选择版本后,fabric可以很好地构建,但是the_pain_repo抛出无法选择db-source(来自fabric)版本的错误。

错误:

[ERROR] Failed to execute goal on project inventory-processor: Could not resolve dependencies for project x.y.z:the_pain_repo:jar:1.7.4-SNAPSHOT: The following artifacts could not be resolved: x.y.z:db-source:jar:${db.source.version}, 
 x.y.z:client-source:jar:${client.source.version}: Could not find artifact x.y.z:client-source:jar:${client.source.version} in systems-artifactory (http://artifactory.systems.com/content/groups/public) -> [Help 1]
[ERROR] 

像詹金斯一样的值:

Root POM :  the_pain_repo/pom.xml
Properties File Path : the_pain_repo/build.properties

1 个答案:

答案 0 :(得分:1)

将父pom部署到您的Maven存储库(或工件)。您可以通过执行mvn clean installmvn -N clean install(仅适用于父模块)将其部署到本地.m2

来进行尝试。