pom.xml文件需要作如下设置

1.引入环境变量

<properties>
          <xmlFileName>${env.xmlFileName}</xmlFileName>
</properties>

2.文件名以变量代替

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <configuration>
  <skip>false</skip>
  <argLine>-Dfile.encoding=UTF-8</argLine>
  <suiteXmlFiles>
   <suiteXmlFile>src\test\java\autotest\res\${xmlFileName}</suiteXmlFile>
   </suiteXmlFiles>
   </configuration>
</plugin>

3.jenkins设置变量

maven项目在jenkins上以配置文件及Git分支作为参数执行构建

 git分支相关配置(先配置相关插件Git Parameter Plug-In)

maven项目在jenkins上以配置文件及Git分支作为参数执行构建

 

maven项目在jenkins上以配置文件及Git分支作为参数执行构建

 

相关文章:

  • 2021-08-21
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-06
  • 2022-01-06
  • 2021-09-13
  • 2022-01-04
猜你喜欢
  • 2021-07-31
  • 2021-09-13
  • 2021-07-23
  • 2021-05-31
  • 2022-12-23
  • 2021-05-17
相关资源
相似解决方案