Export job scripts as single autonomous JAR?

One Star

Export job scripts as single autonomous JAR?

I don't know if anyone else would find this useful, but it's worth mentioning...
Sometimes when I "Export job scripts" as an autonomous job from TOS I prefer to compress it all down into a single jar file that contains everything needed to run. In other words, I extract all the jars from /lib, add the context info, etc. and put them all into a single jar file. This is a sort of tedious process by hand, but it seems like it would be an easy job for TOS to do the export in this format. (I don't know how much it would differ from the web services WAR or ESB exports, since I haven't used them.)
Since TOS is Open Source, I guess I could fork the code and do it myself... but I figured I'd mention it here because it may be a long time before I have the "free time" to do that!
Community Manager

Re: Export job scripts as single autonomous JAR?

If you want to export the job and run it out of talend for the following need, you should export the job script as autonomous type.
1)Execute the job directly by double clicking on the batch file.
2)Execute the job in command line.
3)Integrate the talend job into Eclipse/, see
If you want to deploy the job on JBOSS ESB, you should export the job as ESB type.
Hope it is helpful and useful to you!!!
Best regards
Talend | Data Agility for Modern Business
Four Stars

Re: Export job scripts as single autonomous JAR?

Hi Ewall,
We are also running into the same issue as we cannot deploy the Talend jars required by the job directly to JBoss lib. So we created an ant script to archive the main talend job jar, context, and lib into a self-contained deploy-able jar. Because of Talend limitation in dealing with complex java object / XSDs (using choices & abstraction), we have to deploy the talend job jars to be consumed by web services (wrappers) instead of deploying them as web services themselves. Too bad Talend is doing only half the job in both cases - however it is up to us (the community) to make it so.
One Star

Re: Export job scripts as single autonomous JAR?

I ended up simply making an NT shell script that would take Talend's exported job zip and squeeze all of the relevant data into a single jar. It's not pretty, but for now it satisfies my needs.
One Star

Re: Export job scripts as single autonomous JAR?

Hi, can you share how did you do the exporting thing that includes all the dependency jars. I'm kinda new in Talend and I wasn't able to export my whole project in to .jar file which includes all the dependency jars from Talend library. And also, how would I build a job design? so it can generate the .java file. Hope you might guys help
One Star

Re: Export job scripts as single autonomous JAR?

Packaging everything in just one jar is complicated. I have used a couple off Maven plugins in the past and one way or the other it was madness every time a new release was needed. Talend relies on open source libraries built by different providers like any other project out there. OneJar project http://one-jar.sourceforge.net/ could be used for this should Talend team decide it is worth it.
Personally I would love to see an "export to one jar" option but in the meanwhile I will stick to extracting the zip file and calling the wrapper script.
Shon, do you think it makes sense to add the "export to one jar" feature request?
One Star

Re: Export job scripts as single autonomous JAR?

BTW I have documented in http://thinkinginsoftware.blogspot.com/2011/09/reusing-talend-etl-jobs.html how to invoke Talend jobs from other talend jobs using nodeJS as a shell script wrapper server.
This avoids possible huge memory consumption when invoking a shell script from Talend which will need to rely on Runtime.exec() for that matter. As many already know this uses a fork() which basically makes an in memory copy of the whole parent fingerprint. If Talend JVM is using 2GB a single external command request could push memory usage to 4GB which clearly cannot scale.

Re: Export job scripts as single autonomous JAR?

Hello Nestor,
Very nice blog post. Thanks!
One Star

Re: Export job scripts as single autonomous JAR?

Thank you pcoffre.

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey


Talend named a Leader.

Get your copy


Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables


How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration


Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.