Search in sources :

Example 1 with MavenPomSynchronizer

use of org.talend.designer.maven.tools.MavenPomSynchronizer in project tdi-studio-se by Talend.

the class JavaProcessorUtilities method getTalendJavaProject.

/**
     * A java project under folder .Java will be created if there is no existed.
     * 
     * DOC ggu Comment method "getTalendJavaProject".
     * 
     * @return
     * @throws CoreException
     */
public static ITalendProcessJavaProject getTalendJavaProject() {
    if (talendJavaProject == null) {
        synchronized (JavaProcessorUtilities.class) {
            if (talendJavaProject == null) {
                try {
                    IProject project = TalendCodeProjectUtil.initCodeProject(new NullProgressMonitor());
                    if (project != null) {
                        IJavaProject javaProject = JavaCore.create(project);
                        talendJavaProject = new TalendProcessJavaProject(javaProject);
                        // synchronize templates
                        if (talendJavaProject != null) {
                            MavenPomSynchronizer pomSynchronizer = new MavenPomSynchronizer(talendJavaProject);
                            pomSynchronizer.syncTemplates(false);
                        }
                    }
                } catch (Exception e) {
                    // create failure, only log it?
                    ExceptionHandler.process(e);
                }
            }
        }
    }
    return talendJavaProject;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IJavaProject(org.eclipse.jdt.core.IJavaProject) MavenPomSynchronizer(org.talend.designer.maven.tools.MavenPomSynchronizer) ITalendProcessJavaProject(org.talend.core.runtime.process.ITalendProcessJavaProject) IProject(org.eclipse.core.resources.IProject) CoreException(org.eclipse.core.runtime.CoreException) ProcessorException(org.talend.designer.runprocess.ProcessorException) BusinessException(org.talend.commons.exception.BusinessException) PersistenceException(org.talend.commons.exception.PersistenceException)

Aggregations

IProject (org.eclipse.core.resources.IProject)1 CoreException (org.eclipse.core.runtime.CoreException)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 IJavaProject (org.eclipse.jdt.core.IJavaProject)1 BusinessException (org.talend.commons.exception.BusinessException)1 PersistenceException (org.talend.commons.exception.PersistenceException)1 ITalendProcessJavaProject (org.talend.core.runtime.process.ITalendProcessJavaProject)1 MavenPomSynchronizer (org.talend.designer.maven.tools.MavenPomSynchronizer)1 ProcessorException (org.talend.designer.runprocess.ProcessorException)1