How to troubleshoot the error 'Job was not built successfully'

Question

Sometimes, building Jobs from Studio fails with the following error:

java.lang.Exception: Job was not built successfully, please check the logs for more details
at org.talend.repository.ui.wizards.exportjob.scriptsmanager.BuildJobManager.buildJob(BuildJobManager.java:252)
at org.talend.repository.ui.wizards.exportjob.scriptsmanager.BuildJobManager.buildJob(BuildJobManager.java:162)
at org.talend.repository.ui.wizards.exportjob.scriptsmanager.BuildJobManager.buildJobs(BuildJobManager.java:104)
at org.talend.repository.ui.wizards.exportjob.JobScriptsExportWizardPage.buildJobWithMaven(JobScriptsExportWizardPage.java:1483)
at org.talend.repository.ui.wizards.exportjob.JobScriptsExportWizardPage$8.run(JobScriptsExportWizardPage.java:1388)

The Studio .log file doesn't provide any further details about the root cause.

How do you identify the root cause in this situation?

Answer

From a DOS cmd console, launch Studio in debug mode with the following command:

Talend-Studio-win-x86_64 --talendDebug > studio_debug.log

Once Studio is started, go to Window > Show view > General > Console.

Build the Job again, and once the error is thrown, check the Console view, which should provide further details on why the build failed.