Jenkins 2.32.3 parameterized build maven project-java project

illustrate

Use org.testng to receive the parameters passed by Jenkins, execute the java class in the test method to retrieve the commit log, and copy the commit file to the upgrade package.

pom.xml

  1. Add the parameters required for the package in properties, which must be consistent with the parameter names in Jenkins
  2. Use maven-surefire-plugin to pass parameters from Jenkins to the java test class:

java code

  1. Add the package-related code to the test package, and use the @Parameters annotation to receive the parameters passed by maven




Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324755808&siteId=291194637