azure - 将属性传递给 ANT build.xml 文件
问题描述
我是 Stack Overflow 和 Azure 的新手。
我想要一个项目中的多个存储库。许多存储库将具有经常更改的源代码(repoX),一个具有很少更改的大型 jar 文件(repo2)。Repo2 将用于不同 repoX 中的 ANT 构建。在 Azure Pipeline for repoX 中,我想将 repo2 的路径传递给 build.xml 的类路径,但似乎找不到正确的语法。我熟悉 ANT,只需要语法。Azure 帮助显示了几种设置构建属性的方法,例如变量、环境等。
谢谢你的帮助。
解决方案
非常感谢您的帮助。我能够将参数传递给我的构建文件。我无法让替换令牌任务工作(我认为它已被弃用),但由于 ANT 属性是不可变的,所以当我在 ANT 任务 OPTIONS 中设置我的类路径变量时,它会在构建文件中被拾取。这是我的管道:
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
resources:
repositories:
- repository: THE_JDK
type: git
name: FOLDER/THE_JDK
steps:
- checkout: self
- checkout: THE_JDK
- script: |
echo $(Build.SourcesDirectory)
ls $(Build.SourcesDirectory) *
- powershell: Write-Host "##vso[task.setvariable variable=jdk.home;]$(Build.SourcesDirectory)/THE_JDK"
- task: Ant@1
inputs:
buildFile: 'trunk/TheApp/build/build.xml'
options: -Djdk.home=$(jdk.home)
targets: 'dist-trunk'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/TEST-*.xml'
推荐阅读
- java - 配置 OpenJFX 11 以将其 DLL 提取到不同的用户指定目录?
- c++ - 在头文件中使用 lambda 定义 priority_queue
- javascript - JavaScript 对象数组和打印
- google-cloud-filestore - 通过 IP 地址或互联网访问 Google Cloud Filestore
- android - Android Project Import to Eclipse 不在 Import Projects 窗口中显示项目名称,而是在“PTPlayer”中显示 - 项目未正确导入
- python - Python Bin、排序、Recusion 和索引号
- html - 围绕浮动到右侧的图像对齐文本
- events - 使用事件驱动微服务时,向用户返回数据的最佳方式是什么?
- c# - Newtonsoft json将复杂对象反序列化为具有不同名称的类
- javascript - 在 NetSuite 中打印 PDF 并选择多条交易记录