简体   繁体   English

如何在 Azure Devops 中为多模块 maven 创建构建管道

[英]How to create a build pipeline for multi-module maven in Azure Devops

I have a multi-module maven project in azure repo:我在 azure repo 中有一个多模块 maven 项目:

Parent
  ----App
        --POM.xml
  ----Core
        --POM.xml
  ----API
        --POM.xml
  ----ParentPOM.xml

When I tried to build App project in Azure, I am getting the following error: [ERROR] Failed to execute goal on the project: Could not resolve dependencies for project com.core:jar:1.0: Could not find artifact com.core:jar:1.0 in central ( https://repo.maven.apache.org/maven2 ).当我尝试在 Azure 中构建App项目时,出现以下错误:[错误] 无法在项目上执行目标:无法解析项目 com.core:jar:1.0 的依赖项:找不到工件 com.core: jar:1.0 在中央 ( https://repo.maven.apache.org/maven2 )。

So I tried to create multiple tasks in the same azure build to package for each module (App, Core, API) , which also gives the same result.所以我尝试在同一个 azure build 中创建多个任务来打包每个模块(App, Core, API) ,这也给出了相同的结果。 Could someone please help me on how to build the multi-module project and get the App jar file.有人可以帮助我了解如何构建多模块项目并获取App jar文件。

The way I've done it:我这样做的方式:

with this command: install -pl (module name) -am使用此命令: install -pl(模块名称)-am

where the module name should be one of the submodules.其中模块名称应该是子模块之一。 If you want to build all of them then only go with install如果你想构建所有这些,那么只需要安装

I have found the solution for the multi-module maven dependency issue, First We need to build the parent pom.xml, then build the submodules as per hierarchical order.我找到了maven多模块依赖问题的解决方案,首先我们需要构建父pom.xml,然后按照层次顺序构建子模块。 In between each module, add a task to copy and move the jar files to the staging directory.在每个模块之间,添加一个任务来复制 jar 文件并将其移动到暂存目录。 Here shared the image of my build steps.这里分享了我的构建步骤的图像。 Please take a look and comment on any questions.请查看并评论任何问题。

Please look into the DevOps configuration for reference请查看 DevOps 配置以供参考

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Azure 构建管道时,从 JaCoCo 中排除多模块 maven 项目中的测试目录 - Exclude test directories in multi-module maven projecty from JaCoCo when using Azure build pipeline Azure DevOps Pipeline 中的 Maven 构建错误 - Maven build error in Azure DevOps Pipeline Azure DevOps Maven 构建管道 - 将构建 ID 添加到清单文件 - Azure DevOps Maven Build PIpeline - Add build id to the Manifest File 如何在 Azure DevOps 管道中管理构建工件? - How build artifacts are managed in Azure DevOps pipeline? 是否可以在 Azure 数据工厂的 Azure DevOps 中创建构建管道 - Is it possible to create build pipeline in Azure DevOps for Azure Data factory 如何在 azure Devops 中的 2 个构建管道之间创建依赖关系并将工作项链接到构建管道? - How to create dependencies between 2 build pipelines in azure Devops and link a work item to build pipeline? Pipeline for a java based web app on azure devops.Apache maven to create build. 下面 yaml 代码和 output 错误我得到 - Pipeline for a java based web app on azure devops.Apache maven to create build . Below yaml code and the output error i'm getting flutter 使用 azure devops 构建管道 - flutter build pipeline with azure devops Azure Devops 管道构建参数 - Azure Devops Pipeline Build Parameters 如何触发构建管道取决于在 Azure DevOps 中创建 PR 请求源分支 - How to Trigger a build pipeline depends on create PR request source branch in Azure DevOps
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM