Re-generating POM files, installing a patch and creating a custom script - Cloud - 7.3

Talend Software Development Life Cycle Best Practices Guide

Version
Cloud
7.3
Language
English
Product
Talend Big Data
Talend Big Data Platform
Talend Cloud
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Administration Center
Talend Artifact Repository
Talend CommandLine
Talend JobServer
Talend Management Console
Talend Remote Engine
Talend Studio
Content
Administration and Monitoring
Deployment
Design and Development
Last publication date
2024-02-08

If you want to migrate your projects to a newer version, you may need to install patches (Talend Studio monthly release patch, manual patch, component patch, etc.) using the -Dpatch.path option at build time.

The option that allows you to regenerate all POM files is available from org.talend.ci:builder-maven-plugin version 7.3.3 onwards (available from R2020-08).

The main advantage of this option is that it allows you to upgrade versions or test the patch(es) on one or several existing projects using Continuous Integration before applying the patch to Talend Studio.

Before doing that it is recommended to do these steps first:
  1. Checkout your Git projects. Read the Git documentation about the git checkout command.
  2. Download the patch manually as described in this documentation.
  3. Re-generate all the POM files of the project(s) workspace and install the patch(es) you want to to test.
    Note: Run the commands under the directory where the Git project has been checked out and make sure the Talend CommandLine application is started.

    Example for 2 patches installed locally:

    # To re-generate all pom files and install a patch
    mvn org.talend.ci:builder-maven-plugin:7.3.4:generateAllPoms 
    -Dproduct.path=/home/talend/talend_studio
    -Dlicense.path=/home/talend/talend_studio/license 
    -Dupdatesite.path=/home/talend/talend_studio/Talend_Full_Studio_p2_repository-V7.x.x/
    -Dpatch.path=D:/patches/Patch_TPS-2222.zip,D:/patches/Patch_TPS-3333.zip
    Tip: In case of migration, you probably want to re-generate the POM files for all projects, but if you want to filter on specific artifacts, you can use the -DitemFilter command.

    Example: Use -DitemFilter="label=CI_Jobs" to filter on artifacts with a name that contains CI_Jobs

    Example for Talend Installer users who want to use different installation paths. This way a separate installation will be performed according to the path defined in the -Dproduct.path value:

    # To patch the product of your choice using different product paths 
    mvn org.talend.ci:builder-maven-plugin:7.3.x:generateAllPoms 
    -Dproduct.path=/home/installation/commandline_R202109
    -Dp2Installer.path=/home/.installation/.p2Installer
    -Dpatch.path=/home/patches/R202109.zip

    You also have the possibility to create a custom script that will regenerate all POM files:

    • Example of a script that regenerate all POM files in the projects with a name that starts with CI:
      # To create the custom script 
      cat /home/talend/talend_studio/script.txt
      regenerateAllPoms
      # To execute the custom script
      mvn org.talend.ci:builder-maven-plugin:<version>:executeScript 
      -Dproduct.path=/home/talend/talend_studio 
      -Dlicense.path=/home/talend/talend_studio/license 
      -Dupdatesite.path=/home/talend/talend_studio/Talend_Full_Studio_p2_repository-V7.x.x/
      -DscriptFile=/home/talend/talend_studio/script.txt
      Tip: In case of migration, you probably want to re-generate the POM files for all projects, but if you want to filter on specific projects, you can use the -DprojectFilter command.

      Example: Use -DprojectFilter="CI.*" to filter on projects with a name that starts with CI.

    • Example of a script that uses the changeMavenVersion command to change the Maven version and update the item and POM files at once:
      # The content of the script named upgrade_version.txt
      logonProject -pn gitProject -ul 'jobbuilder@talend.com' -gt
      changeMavenVersion 1.0.5 --item-filter 'label%*test5_pere*' --subjobs --snapshot
      regenerateAllPoms
      # To execute the custom script
      mvn org.talend.ci:builder-maven-plugin:<version>:executeScript -s ./maven_settings.xml 
      -Dgeneration.type=local 
      -Dproduct.path=/opt/Talend/studio 
      -Dlicense.path=/opt/Talend/studio/license 
      -DscriptFile=/home/talend/upgrade_version.txt
  4. Test the generation of existing projects and Jobs.
    Example of generation with the package Maven phase:
    # To test projects/Jobs generation
    mvn clean package 
    -Dproduct.path=/home/talend/talend_studio/ 
    -Dlicense.path=/home/talend/talend_studio/license 
    -Dupdatesite.path=/home/talend/talend_studio/Talend_Full_Studio_p2_repository-V7.x.x/
  5. Provided that the project generation is successful, apply the tested patches to Talend Studio as described in this documentation. If the test is not successful, please contact Talend Support.