Search in sources :

Example 1 with ProjectPomManager

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

the class MavenJavaProcessor method updateProjectPom.

/**
     * update the project pom, and make sure the standard or fake(Preview/Data view) job can be compiled still.
     */
protected void updateProjectPom(IProgressMonitor monitor) {
    try {
        if (monitor == null) {
            monitor = new NullProgressMonitor();
        }
        JavaProcessorUtilities.checkJavaProjectLib(getNeededModules());
        ProjectPomManager pomManager = new ProjectPomManager(getTalendJavaProject().getProject()) {

            @Override
            protected boolean isStandardJob() {
                return MavenJavaProcessor.this.isStandardJob();
            }

            @Override
            protected IFile getBasePomFile() {
                return MavenJavaProcessor.this.getPomFile();
            }
        };
        // won't update module for fake job.
        pomManager.setUpdateModules(isStandardJob());
        if (getArguments() != null) {
            pomManager.setArgumentsMap(getArguments());
        }
        pomManager.update(monitor, this);
    } catch (Exception e) {
        ExceptionHandler.process(e);
    }
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ProjectPomManager(org.talend.designer.maven.tools.ProjectPomManager) ProcessorException(org.talend.designer.runprocess.ProcessorException)

Example 2 with ProjectPomManager

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

the class DefaultRunProcessService method updateProjectPomWithTemplate.

@Override
public void updateProjectPomWithTemplate() {
    try {
        ProjectPomManager manager = new ProjectPomManager(getTalendProcessJavaProject().getProject());
        manager.updateFromTemplate(null);
    } catch (Exception e) {
        ExceptionHandler.process(e);
    }
}
Also used : ProjectPomManager(org.talend.designer.maven.tools.ProjectPomManager) CoreException(org.eclipse.core.runtime.CoreException) FileNotFoundException(java.io.FileNotFoundException) IOException(java.io.IOException)

Aggregations

ProjectPomManager (org.talend.designer.maven.tools.ProjectPomManager)2 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 CoreException (org.eclipse.core.runtime.CoreException)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 ProcessorException (org.talend.designer.runprocess.ProcessorException)1