maven - 替换 Azure Devops 任务组中的 settings.xml
问题描述
我在 Azure devops 代理的 .m2 目录中有一个旧的 settings.xml。我想通过任务组用新的 settings.xml 覆盖它,但不应该对旧的 settings.xml 文件进行任何更改。因为如果它有效,那么我们将更新旧的 xml 文件。
我们如何使用 Azure Devops 任务组实现相同的目标?
解决方案
How could we achieve the same using Azure Devops task group?
I suggest that you could save the settings.xml file in Pipelines -> Library -> Secure files.
In Task Group, you could add Download secure file task and Maven task.
Download secure file task: Set the Reference Name and select the file
Maven task: Set the reference Settings.xml path: -s $(mvnSettings.secureFilePath)
Then you could create a task group.
Note: You need to set the paramter for the task group:
Default value: $(Agent.TempDirectory)/settings.xml
In this case, the old settings.xml will not be changed. When you reference this task group, it will download the new settings.xml in the secure file and reference the new settings.xml file in the maven task.
If you do not reference this task group, it can still use the old settings.xml file.
推荐阅读
- php - 尝试使用 PHP 保存 csv 文件需要很长时间
- flutter - 当使用flutter web部署的页面没有打开文件上传时
- azure-functions - 如何使用 Azure 数据工厂生成动态批处理文件并执行它
- css - 意外
垂直滚动条时出现线条(当高度超过 100% 时) - reactjs - 为什么反应重新渲染另一个变量?
- dataframe - 在一列中重新组织数据集
- node.js - AWS Lambda 能否从位于 lambda 函数源代码中的 /tmp 文件夹向前端 UI 提供静态 .png 图标
- javascript - 将值传递给多个函数
- api - 什么是最好的还提供 REST API 的 POS 服务
- asp.net-mvc - 一个类的一个属性是另一个类。问题 - 将一个类写入数据库时,另一个类也尝试写入,但它已经存在