简体   繁体   English

如何通过调用ant来配置jenkins并建立工作?

[英]how to configure jenkins by invoking ant and build a job?

In the jenkins configure project, i have the build step "Invoke Ant". 在jenkins configure项目中,我具有构建步骤“ Invoke Ant”。

I have a build.xml file in a specific path and this xml file has import tags which imports two other xml files which are in the same path. 我在特定路径中有一个build.xml文件,并且该xml文件具有导入标签,该标签导入了同一路径中的其他两个xml文件。

My job is getting failed because it is unable to find the files to be imported. 我的工作失败了,因为找不到要导入的文件。 I'm getting the error like "cannot find abc/def/xyz.xml" 我收到类似“找不到abc / def / xyz.xml”的错误

I have given the build.xml file path in the "build file" column. 我在“构建文件”列中给出了build.xml文件路径。

  1. What should I type in the properties column and java options column? 我应该在属性列和Java选项列中键入什么?
  2. How to give path for the other two files which needs to be imported by build.xml file? 如何为需要通过build.xml文件导入的其他两个文件提供路径?

Option 1. Make sure all files are relative to Jenkins workspace 选项1.确保所有文件都相对于Jenkins工作区

Option 2. Hard-code the files' path in your build.xml 选项2。build.xml对文件的路径进行硬编码

Option 3. Setup a property for the path of those files in your build.xml . 选项3.build.xml为这些文件的路径设置属性。 Give that property a default value of whatever the path is right now (to make sure it still works without Jenkins). 给该属性一个默认值,无论该路径当前是什么(以确保它在没有Jenkins的情况下仍然可以使用)。 When invoking from Jenkins, in the properties field, enter the property name with a value for the absolute path that should be reachable. 从詹金斯(Jenkins)调用时,在属性字段中,输入属性名称以及应该可到达的绝对路径的值。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM