Skip to main content Skip to complementary content

Editing user routine libraries

You can edit the library of a user routine by importing external libraries (usually .jar files) for it.

You can import external libraries for an inner routine by editing the library of the custom routine jar in which the inner routine is packaged.

These external library files will be listed, like modules, in the Modules view in Talend Studio. For more information on the Modules view, see Installing external modules to Talend Studio.

The imported library will be also listed in the library file of Talend Studio.

About this task

To edit the library for a user routine or a custom routine jar, complete the following:

Procedure

  1. If the library to be imported is not available on your machine, either download and install it using the Modules view or download and store it in a local directory.
  2. In the Repository tree view, right-click the user routine or the custom routine jar and then select Edit Routine Libraries or Edit Routine Jar libraries.
    The Import External Library dialog box displays.
    Import External Library dialog box.
  3. Click New... to open the Module dialog box where you can import the external library.
    Module dialog box.
  4. Specify the library via one of the following ways:
    • Select the Platform option and then select the library from the list.
    • Select the Install a new module option and then click [...] to browse to the library in a local directory.

      You can import direct dependencies of a POM file by selecting the Install a new module option and then clicking [...] to browse to a POM file.

      If the MVN URI of the selected library exists in the file <TalendStudio>\configuration\MavenUriIndex.xml, it is automatically filled in the Default MVN URI field.

      If the MVN URI of the selected library is within the jar file, it is automatically detected and filled in the Custom MVN URI field if it is different from the default MVN URI. Select the Custom MVN URI check box if you want to change the custom Maven URI or use the custom Maven URI to install the library. If neither the default MVN URI nor the custom MVN URI exists, the Default MVN URI field is filled with mvn:org.talend.libraries/<jarname>/6.0.0-SNAPSHOT/jar.

    • Select the Artifact repository (local m2/nexus) option, enter the search keyword in the Module Name field, click Search Local to search in the local repository <TalendStudio>\configuration\.m2 or click Search Remote to search in the remote artifact repository, then select the library from the list below. The search keyword can be the partial or full name of the library.

      The Search Remote button is available only when the user libraries is set up in Talend Administration Center or Talend Management Console.

  5. If you want to import direct dependencies of the selected library, select the Add direct dependencies check box.
    The Add direct dependencies check box is selected and appears dimmed when you select the Install a new module option and browse to a POM file.

    The provided, test, and system scope dependencies cannot be imported. For more information about the dependency scope, see POM Reference.

    Information noteNote: The direct dependencies are imported based on the dependencies in the POM file within the selected library or the dependencies in the selected POM file. The direct dependencies can only be discovered if a POM file is present in the selected library and the POM file contains the groupId, artifactId, and version information for the dependencies.
  6. If you want to import transitive dependencies of the selected library, select the Add transitive dependencies check box, which is available when the Add direct dependencies check box is selected.
    Downloading the dependencies files may take a long time.
  7. Click OK to confirm your changes.
    The selected library file is listed in the Library File list in the Import External Library dialog box.

    If the Add direct dependencies check box is selected, the direct dependencies of the selected library or POM file are also listed in the Library File list.

    You can remove any of the already imported files by selecting the file in the Library File list and clicking Remove.

  8. To include the external libraries when building your Job as a standalone Job to be executed out of Talend Studio, select the corresponding Required check box. Otherwise, you will get the "class not found" error when the Job is executed.
    By default, the Required check box is selected for each imported library.
    If you have imported Camel or CXF libraries and you need to build your Job as an OSGI bundle to be deployed on Talend Runtime, it is recommended that you clear the Required check box to avoid issues caused by duplicate class paths, as those libraries are already provided with Talend Runtime bundles.
  9. Click Finish to close the dialog box.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!