Re-generating POM files, installing a patch and creating a custom script
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.
- Checkout your Git projects. Read the Git documentation about the git checkout command.
- Download the patch manually as described in this documentation.
- Re-generate all the POM files of the project(s) workspace and install the patch(es)
you want to to test. Information noteNote: 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
Information noteTip: 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
Information noteTip: 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
-
- 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/
- 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 Qlik Support.