From Talend 7.x, the cConfig components, used to add external libraries dependencies in Routes, was enhanced to synchronize the libraries to a Nexus repository, which enables sharing libraries with all other project users.
However, after migration to 7.x, Routes with cConfig components require some additional efforts to run successfully in Talend Studio.
A new Version field in the cConfig dependencies table needs to be set manually to 6.0.0 to upload/retrieve the artifacts in the talend-custom-libs-release repository. Thus, all of the Routes in your project using a cConfig component needs to be updated manually.
The solution shows you how to reduce some of these manual efforts and how to update the Routes automatically. It leverages a Talend Route, an XSLT file to transform all the Route item files and stores the transformed item files to a new directory maintaining the folder structure.
The xsl_updatecConfig_settings.zip file, attached to this article, does the following:
Reads all the Route *item files from a source directory (routes_before_transform)
Transforms the files by setting all occurrences of the cConfig, JAR_NEXUS_VERSION to 6.0.0
Stores all the Route *item files to a target directory (routes_after_transform)
Executing the transformation
Create a directory and two subfolders, as shown below:
Download the xsl_updatecConfig_settings.zip file, unzip and copy the .xslt file to the parent directory, as shown above.
Open File Explorer, and navigate to the workspace folder of Talend Studio.
Select the .repositories folder, select your project from the local Git repository, and open the routes folder.
Copy all the folders and files under this directory to a new folder, in this case, routes_before_transform.
Import the Cconfig_TransformationRoute.zip file, attached to this article, into Studio.
Update the two context parameters with the location of your local directory, as shown below:
Search for the total number of *item files in the routes_before_tansform folder.
Note: The total number of *item files might be different in your project.
Run the Route in Studio. Notice that all of the *item files are read and saved to the target folder.
Copy all the transformed Route *item files from the routes_after_transform directory back to your Studio local repository, as shown below:
In Talend Studio, open any one of the Routes and verify that the Version field is set to 6.0.0.
Verifying the version manually (optional)
This section shows you how to manually verify the changes made to your Route item files after the transformation.
In File Explorer confirm that the *item files are correctly set with the version 6.0.0, by performing the following steps:
Recollect a Route that is using cConfig component.
Open the *item file of the same Route.
Search for the JAR_NEXUS_VERSION.
Confirm that the Value field is set to 6.0.0.
<elementValue elementRef="JAR_NEXUS_VERSION" value="6.0.0" xmi:id="_ACDYy0hEEeqT8caEVLLygg"/>