use of org.talend.camel.designer.build.CreateMavenBundlePom in project tesb-studio-se by Talend.
the class BundleJavaProcessor method createMavenPomCreator.
/*
* (non-Javadoc)
*
* @see org.talend.designer.runprocess.maven.MavenJavaProcessor#createMavenPomCreator()
*/
@Override
protected IMavenPomCreator createMavenPomCreator() {
final Property itemProperty = this.getProperty();
String buildTypeName = null;
// FIXME, better use the arguments directly for run/export/build/..., and remove this flag later.
if (ProcessorUtilities.isExportConfig()) {
// final Object exportType = itemProperty.getAdditionalProperties().get(MavenConstants.NAME_EXPORT_TYPE);
final Object exportType = getArguments().get(TalendProcessArgumentConstant.ARG_BUILD_TYPE);
buildTypeName = exportType != null ? exportType.toString() : null;
}
// else { //if run job, will be null (use Standalone by default)
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put(IBuildParametes.ITEM, itemProperty.getItem());
parameters.put(IBuildPomCreatorParameters.PROCESSOR, this);
parameters.put(IBuildPomCreatorParameters.FILE_POM, getPomFile());
parameters.put(IBuildPomCreatorParameters.FILE_ASSEMBLY, getAssemblyFile());
parameters.put(IBuildPomCreatorParameters.CP_LINUX, this.unixClasspath);
parameters.put(IBuildPomCreatorParameters.CP_WIN, this.windowsClasspath);
parameters.put(IBuildPomCreatorParameters.ARGUMENTS_MAP, getArguments());
parameters.put(IBuildPomCreatorParameters.OVERWRITE_POM, Boolean.TRUE);
AbstractBuildProvider foundBuildProvider = BuildExportManager.getInstance().getBuildProvider(buildTypeName, parameters);
if (foundBuildProvider != null) {
final IMavenPomCreator creator = foundBuildProvider.createPomCreator(parameters);
if (creator != null) {
return creator;
}
}
// normally, won't be here, should return creator in font.
CreateMavenBundlePom createTemplatePom = new CreateMavenBundlePom(this, getPomFile());
createTemplatePom.setUnixClasspath(this.unixClasspath);
createTemplatePom.setWindowsClasspath(this.windowsClasspath);
createTemplatePom.setAssemblyFile(getAssemblyFile());
IPath itemLocationPath = ItemResourceUtil.getItemLocationPath(this.getProperty());
IFolder objectTypeFolder = ItemResourceUtil.getObjectTypeFolder(this.getProperty());
if (itemLocationPath != null && objectTypeFolder != null) {
IPath itemRelativePath = itemLocationPath.removeLastSegments(1).makeRelativeTo(objectTypeFolder.getLocation());
createTemplatePom.setObjectTypeFolder(objectTypeFolder);
createTemplatePom.setItemRelativePath(itemRelativePath);
}
return createTemplatePom;
}
Aggregations