Before you begin
- You have created the build project on your Continuous Integration server, Jenkins for example. See Creating the Jenkins project.
- You know the path to the pom files of the Jobs you want to execute. These files are available in the Studio workspace, in the workspace/<my_project>/poms directory.
- Open the configuration page of the build project.
In the Goals and options field of the
Build area (plugin execution information as well as
parameters needed to generate the sources), enter the Maven commands that allow
you to filter the Jobs according to your needs:
-plto generate Jobs and related Tests that are located in a specific project (if you have more than one projects in your repository).
-pl CI_PROJECTto generate all Jobs and Tests located in the project named CI_PROJECT.
\jobs\process\job_feature400_0.1 -pl CI_PROJECTto generate the Job named job_feature400_0.1 located in the project named CI_PROJECT.
-am(if the project has been specified with
-pl) to generate the child dependencies of a specific Job.
\jobs\process\parent_job_feature334_0.1 -pl CI_PROJECT -amto generate the parent Job named parent_job_feature334_0.1 as well as its child Job (child_job_feature334_0.1) and sub-child Job (subchild_job_feature334_0.1).
-amd(if the project has been specified with
-pl) to generate the parent dependencies of a specific Job.
\jobs\process\subchild_job_feature334_0.1 -pl CI_PROJECT -amdto generate the sub-child Job subchild_job_feature334_0.1 that has been modified and re-generate the Jobs that depend on this one, child_job_feature334_0.1) and parent_job_feature334_0.1).Note: As the
-amdcommand builds all modules that depend on the specified Job, all the dependencies needed to generate this Job, such as routines, need to be pre-generated.
Example of Maven command used to clean the project build directory (deleting old files), launch the generation of all Jobs and Tests in the CI_PROJECT project and package the Java code in an output file (.jar, .war, .zip, etc).
mvn clean package -pl CI_PROJECT -am
Example of Maven command used to clean the project build directory (deleting old files), launch the generation of all existing Jobs and Tests and deploy the packages on the snapshots Nexus repository :
mvn clean deploy -DaltDeploymentRepository=snapshots::default::http://localhost:8081/repository/snapshots
- Save your changes and close the configuration page.
When you will execute your project on your Continuous Integration server, the filter will be applied and only the Jobs you have filtered will be generated and executed.