Compare commits
7 Commits
master
...
csun/TESB-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2c159e063 | ||
|
|
fd4fbf52dd | ||
|
|
27afea0005 | ||
|
|
fc6f6f54d4 | ||
|
|
c7bb760929 | ||
|
|
eb627b8956 | ||
|
|
d8ea9b1fa8 |
@@ -12,11 +12,14 @@
|
||||
// ============================================================================
|
||||
package org.talend.core;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.ui.IEditorPart;
|
||||
import org.eclipse.ui.IWorkbenchPart;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.core.model.process.IProcess;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.utils.IXSDPopulationUtil;
|
||||
@@ -47,6 +50,8 @@ public interface IESBService extends IService {
|
||||
|
||||
public StringBuffer getAllTheJObNames(IRepositoryNode jobList);
|
||||
|
||||
public List<String> getSerivceRelatedJobIds(Item serviceItem);
|
||||
|
||||
public void deleteOldRelation(String jobID);
|
||||
|
||||
// public void setSelectedItem(Item, )
|
||||
@@ -59,6 +64,8 @@ public interface IESBService extends IService {
|
||||
|
||||
public void copyDataServiceRelateJob(Item newItem);
|
||||
|
||||
public boolean isRESTService(ProcessItem processItem);
|
||||
|
||||
public IXSDPopulationUtil getXSDPopulationUtil();
|
||||
|
||||
public boolean isWSDLEditor(IWorkbenchPart part);
|
||||
|
||||
@@ -2628,5 +2628,4 @@ public class ProcessorUtilities {
|
||||
public static boolean isNeedProjectProcessId(String componentName) {
|
||||
return "tRunJob".equalsIgnoreCase(componentName) || "cTalendJob".equalsIgnoreCase(componentName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,10 @@ import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.model.Activation;
|
||||
import org.apache.maven.model.Dependency;
|
||||
import org.apache.maven.model.Model;
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.model.PluginExecution;
|
||||
import org.apache.maven.model.Profile;
|
||||
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
@@ -898,4 +901,40 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
}
|
||||
}
|
||||
|
||||
protected Plugin addSkipDockerMavenPlugin() {
|
||||
Plugin plugin = new Plugin();
|
||||
|
||||
plugin.setGroupId("io.fabric8");
|
||||
plugin.setArtifactId("fabric8-maven-plugin");
|
||||
plugin.setVersion("4.0.0");
|
||||
|
||||
Xpp3Dom skip = new Xpp3Dom("skip");
|
||||
// skip.setValue("${docker.skip}");
|
||||
skip.setValue("true");
|
||||
|
||||
Xpp3Dom configuration = new Xpp3Dom("configuration");
|
||||
configuration.addChild(skip);
|
||||
|
||||
List<PluginExecution> pluginExecutions = new ArrayList<PluginExecution>();
|
||||
PluginExecution pluginExecutionStart = new PluginExecution();
|
||||
pluginExecutionStart.setId("start");
|
||||
pluginExecutionStart.setPhase("none");
|
||||
pluginExecutionStart.setConfiguration(configuration);
|
||||
|
||||
pluginExecutions.add(pluginExecutionStart);
|
||||
|
||||
PluginExecution pluginExecutionPushImage = new PluginExecution();
|
||||
pluginExecutionPushImage.setId("push-image");
|
||||
pluginExecutionPushImage.setPhase("none");
|
||||
pluginExecutionPushImage.setConfiguration(configuration);
|
||||
|
||||
pluginExecutions.add(pluginExecutionPushImage);
|
||||
|
||||
plugin.setExecutions(pluginExecutions);
|
||||
plugin.setConfiguration(configuration);
|
||||
|
||||
return plugin;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,11 +33,16 @@ import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IFolder;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IESBService;
|
||||
import org.talend.core.PluginChecker;
|
||||
import org.talend.core.model.process.JobInfo;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.model.relationship.Relation;
|
||||
import org.talend.core.model.relationship.RelationshipItemBuilder;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.runtime.maven.MavenConstants;
|
||||
import org.talend.core.runtime.process.ITalendProcessJavaProject;
|
||||
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
|
||||
@@ -50,6 +55,7 @@ import org.talend.designer.maven.tools.AggregatorPomsHelper;
|
||||
import org.talend.designer.maven.utils.PomIdsHelper;
|
||||
import org.talend.designer.maven.utils.PomUtil;
|
||||
import org.talend.designer.runprocess.IProcessor;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.utils.io.FilesUtils;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
@@ -108,8 +114,9 @@ public class CreateMavenStandardJobOSGiPom extends CreateMavenJobPom {
|
||||
@Override
|
||||
protected Model createModel() {
|
||||
Model model = super.createModel();
|
||||
|
||||
|
||||
boolean isServiceOperation = isServiceOperation(getJobProcessor().getProperty());
|
||||
|
||||
List<Profile> profiles = model.getProfiles();
|
||||
|
||||
for (Profile profile : profiles) {
|
||||
@@ -141,12 +148,22 @@ public class CreateMavenStandardJobOSGiPom extends CreateMavenJobPom {
|
||||
}
|
||||
model.setName(model.getName() + " Bundle");
|
||||
model.addProperty("talend.job.finalName", "${talend.job.name}-bundle-${project.version}");
|
||||
Build build = model.getBuild();
|
||||
|
||||
IESBService service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
|
||||
|
||||
if (isServiceOperation || service.isRESTService((ProcessItem) getJobProcessor().getProperty().getItem())) {
|
||||
build.addPlugin(addSkipDockerMavenPlugin());
|
||||
}
|
||||
|
||||
if (isServiceOperation) {
|
||||
model.addProperty("cloud.publisher.skip", "true");
|
||||
Build build = model.getBuild();
|
||||
|
||||
build = model.getBuild();
|
||||
|
||||
List<Plugin> removePlugins = new ArrayList<Plugin>();
|
||||
if (build != null) {
|
||||
|
||||
List<Plugin> plugins = build.getPlugins();
|
||||
for (Plugin p : plugins) {
|
||||
if (p.getArtifactId().equals("maven-deploy-plugin")) {
|
||||
@@ -260,14 +277,30 @@ public class CreateMavenStandardJobOSGiPom extends CreateMavenJobPom {
|
||||
* @return
|
||||
*/
|
||||
public boolean isServiceOperation(Property property) {
|
||||
List<Relation> relations = RelationshipItemBuilder.getInstance().getItemsRelatedTo(property.getId(),
|
||||
property.getVersion(), RelationshipItemBuilder.JOB_RELATION);
|
||||
List<IRepositoryViewObject> serviceRepoList = null;
|
||||
|
||||
for (Relation relation : relations) {
|
||||
if (RelationshipItemBuilder.SERVICES_RELATION.equals(relation.getType())) {
|
||||
return true;
|
||||
boolean isDataServiceOperation = false;
|
||||
|
||||
IESBService service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
|
||||
|
||||
try {
|
||||
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
|
||||
serviceRepoList = factory.getAll(ERepositoryObjectType.valueOf(ERepositoryObjectType.class, "SERVICES"));
|
||||
|
||||
for (IRepositoryViewObject serviceItem : serviceRepoList) {
|
||||
if (service != null) {
|
||||
List<String> jobIds = service.getSerivceRelatedJobIds(serviceItem.getProperty().getItem());
|
||||
if (jobIds.contains(property.getId())) {
|
||||
isDataServiceOperation = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return false;
|
||||
|
||||
return isDataServiceOperation;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,7 +454,18 @@ public class ImportExportHandlersManager {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
Collections.sort(checkedItemRecords, new Comparator<ImportItem>() {
|
||||
|
||||
@Override
|
||||
public int compare(ImportItem o1, ImportItem o2) {
|
||||
if (o1.getRepositoryType().getType().equals("SERVICES")) {
|
||||
return -1;
|
||||
} else if (o2.getRepositoryType().getType().equals("SERVICES")) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
ImportCacheHelper importCacheHelper = ImportCacheHelper.getInstance();
|
||||
try {
|
||||
// cache
|
||||
|
||||
Reference in New Issue
Block a user