Set a maven URL for external Library dependency for job/routine

Five Stars

Set a maven URL for external Library dependency for job/routine

From docs, forum and blogs the only ways to add a dependency to an external jar are:

  • edit routine libraries, by adding a local jar
  • use tLibraryLoad on a job, to load a local jar
  • someone talks about editing project pom, but there are no details about it.

My question regards both open and enterprise versions.

Methods 1 and 2 would be fine only if you work alone. With many users with different workspaces sharing a git project both approaches won't work since the libraries are referenced by their local path which won't exists for other users.
So each user must download by itself the jars and put them manually into the right path. This is awful: possible mistakes in jar version, lot of manual work.. and even worse: by definying dependencies on a single routine/job if you develop new objects with same dependencies you must repeat the process of definying the dependencies.
I would like new users to open project, discovering needed jars automatically through a well-built maven pom file and installing only needed jars with the exact versions specified on poms.
Can you explain how to modify project or job pom files (or even routine pom which is hidden in studio) to edit maven dependencies and add jars as maven urls?
No clue on official docs to explain how to do It. What are the differencies in editing these two files?
Also, can you explain how to add additional maven repositories to user_settings xml?
I have many customers using Talend both with subscription and Open. I would like to find a solution for both situations.


Re: Set a maven URL for external Library dependency for job/routine


Talend 6 uses Apache Maven commands to build jobs and routes/service and uses Sonatype Nexus to share libraries for each Studio/command line and to store jobs for nexus jobs on TAC :Job Conductor and route/services for TAC: ESB Conductor.

To resolve library dependency issues on each Studio/CommandLine, Nexus repository should be configured on TAC > configuration > custom libraries. Local repositories are defined in studio\configuration\maven_user_settings.xml for Studio and cmdline\studio\configuration\maven_user_settings.xml for CommandLine. By default the local repository path is (cmdline) /studio/configuration/.m2/repository.


When Talend Studio build Jobs or routes/services, it uses maven commands specified in POM file (A POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details used by Maven to build the project).  The Talend products allow us to customize the pom files and store in SVN or Git repository to share with other Studio instances and command line process.

[Project Settings] Build > Maven > Default; These script templates apply to all Jobs in the root folder and all sub-folders except those with their own build script templates set up at [Project Settings] Build > Maven > Setup custom scripts by folder.

  1. Project – project POM

SVN : [repository]/trunk/.settings/org.talend.designer.maven.ui.prefs

GIT: [repository]/<git url id>/<git branch>/<current project>/.settings/org.talend.designer.maven.ui.prefs

  1. Standalone Job – POM_[jobname/route/service].xml

SVN : [repository]/trunk/.settings/org.talend.designer.maven.job.prefs

GIT : [repository]/<git url id>/<git branch>/<current project>/.settings/ org.talend.designer.maven.job.prefs

* Routes and services are built as standard job and use the same pom files.



Let us know if this online user guide helps.

Best regards


Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: Set a maven URL for external Library dependency for job/routine

I managed to install a dependency both in local maven and in Nexus custom libs but I still have problems on my job.
I created a simple job with a tJava inside which uses org.apache.camel.Exchange class . This is Just an example to see if an the dependency imported in maven works: I configured camel-core/2.22.1 both in project pom and in standalone job pom, and It is installed on local maven repo and in Nexus. But neither of them gets the job working. The job outputs the error "could not resolve org.apache.camel.Exchange". Is It possible that the dependency doesn't bind to the job? No clue or how to do It on docs and forums. Can you help me?
Five Stars

Re: Set a maven URL for external Library dependency for job/routine


I'm afraid that user guide doesn't work with v7.1 even though I've added the dependencies to the global and project-specific POM. I still get the same ClassNotFoundExceptions.

Four Stars

Re: Set a maven URL for external Library dependency for job/routine

Was there ever resolution on this?


Talend named a Leader.

Get your copy


Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables


Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables


Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema