Compare commits
17 Commits
maintenanc
...
azure_patc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf7ffb0288 | ||
|
|
72f9b4032c | ||
|
|
4e3bf8631d | ||
|
|
fec8fd0c06 | ||
|
|
0b0e004491 | ||
|
|
235f8b08d1 | ||
|
|
bbf5b5e859 | ||
|
|
70dddca938 | ||
|
|
958e5d7b1b | ||
|
|
ac4d92a777 | ||
|
|
e35804e5ca | ||
|
|
8d64e1e5cf | ||
|
|
6ffe253c1c | ||
|
|
e5b7ab490c | ||
|
|
07efecb906 | ||
|
|
cee139ef8d | ||
|
|
ea00bfcad0 |
@@ -131,4 +131,22 @@ public class ProjectHelper {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* define the different value for the project types the string value in the licence files Matcht the java enum name
|
||||
* this is a copy of org.talend.commons.model.KeyConstants.ProjectType to avoid adding the all library
|
||||
*
|
||||
*/
|
||||
public static enum ProjectType {
|
||||
DI,
|
||||
DQ,
|
||||
MDM;
|
||||
}
|
||||
|
||||
public static int getProjectTypeOrdinal(org.talend.core.model.properties.Project project) {
|
||||
if (project != null && project.getType() != null) {
|
||||
return ProjectType.valueOf(project.getType()).ordinal();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -153,7 +153,7 @@ public class MetadataTable implements IMetadataTable, Cloneable {
|
||||
List<IMetadataColumn> temp = new ArrayList<IMetadataColumn>();
|
||||
temp.addAll(this.listColumns);
|
||||
temp.addAll(this.unusedColumns);
|
||||
if (originalColumns != null) {
|
||||
if (originalColumns != null && isRepository) {
|
||||
Collections.sort(temp, new Comparator<IMetadataColumn>() {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,6 +19,7 @@ import java.util.Set;
|
||||
|
||||
import org.talend.core.model.general.ModuleNeeded;
|
||||
import org.talend.core.model.process.JobInfo;
|
||||
import org.talend.core.model.process.ProcessUtils;
|
||||
|
||||
/**
|
||||
* DOC nrousseau class global comment. Detailled comment
|
||||
@@ -78,7 +79,7 @@ public class LastGenerationInfo {
|
||||
* @return the modulesNeededPerJob
|
||||
*/
|
||||
public Set<ModuleNeeded> getModulesNeededWithSubjobPerJob(String jobId, String jobVersion) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
if (!modulesNeededWithSubjobPerJob.containsKey(key)) {
|
||||
modulesNeededWithSubjobPerJob.put(key, new HashSet<ModuleNeeded>());
|
||||
}
|
||||
@@ -90,7 +91,7 @@ public class LastGenerationInfo {
|
||||
* @return the modulesNeededPerJob
|
||||
*/
|
||||
public Set<ModuleNeeded> getModulesNeededPerJob(String jobId, String jobVersion) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
if (!modulesNeededPerJob.containsKey(key)) {
|
||||
modulesNeededPerJob.put(key, new HashSet<ModuleNeeded>());
|
||||
}
|
||||
@@ -103,7 +104,7 @@ public class LastGenerationInfo {
|
||||
* @return the contextPerJob
|
||||
*/
|
||||
public Set<String> getContextPerJob(String jobId, String jobVersion) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
if (!contextPerJob.containsKey(key)) {
|
||||
contextPerJob.put(key, new HashSet<String>());
|
||||
}
|
||||
@@ -116,7 +117,7 @@ public class LastGenerationInfo {
|
||||
* @param modulesNeededPerJob the modulesNeededPerJob to set
|
||||
*/
|
||||
public void setModulesNeededPerJob(String jobId, String jobVersion, Set<ModuleNeeded> modulesNeeded) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
modulesNeededPerJob.put(key, new HashSet<ModuleNeeded>(modulesNeeded));
|
||||
}
|
||||
|
||||
@@ -125,8 +126,8 @@ public class LastGenerationInfo {
|
||||
*
|
||||
* @param modulesNeededWithSubjobPerJob the modulesNeededWithSubjobPerJob to set
|
||||
*/
|
||||
public void setModulesNeededWithSubjobPerJob(String jobId, String jobVersion, Set<ModuleNeeded> modulesNeeded) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
public void setModulesNeededWithSubjobPerJob(String jobId, String jobVersion, Set<ModuleNeeded> modulesNeeded) {
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
if (modulesNeeded == null) {
|
||||
modulesNeededWithSubjobPerJob.put(key, null);
|
||||
} else {
|
||||
@@ -140,17 +141,17 @@ public class LastGenerationInfo {
|
||||
* @param contextPerJob the contextPerJob to set
|
||||
*/
|
||||
public void setContextPerJob(String jobId, String jobVersion, Set<String> contexts) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
contextPerJob.put(key, new HashSet<String>(contexts));
|
||||
}
|
||||
|
||||
public void setUseDynamic(String jobId, String jobVersion, boolean dynamic) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
useDynamic.put(key, dynamic);
|
||||
}
|
||||
|
||||
public boolean isUseDynamic(String jobId, String jobVersion) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
if (!useDynamic.containsKey(key)) {
|
||||
return false;
|
||||
}
|
||||
@@ -162,12 +163,12 @@ public class LastGenerationInfo {
|
||||
}
|
||||
|
||||
public void setUseRules(String jobId, String jobVersion, boolean useRules) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
this.useRules.put(key, useRules);
|
||||
}
|
||||
|
||||
public boolean isUseRules(String jobId, String jobVersion) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
if (!useRules.containsKey(key)) {
|
||||
return false;
|
||||
}
|
||||
@@ -179,12 +180,12 @@ public class LastGenerationInfo {
|
||||
}
|
||||
|
||||
public void setUsePigUDFs(String jobId, String jobVersion, boolean useRules) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
this.usedPigUDFs.put(key, useRules);
|
||||
}
|
||||
|
||||
public boolean isUsePigUDFs(String jobId, String jobVersion) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
if (!usedPigUDFs.containsKey(key)) {
|
||||
return false;
|
||||
}
|
||||
@@ -251,7 +252,7 @@ public class LastGenerationInfo {
|
||||
* @return the modulesNeededPerJob
|
||||
*/
|
||||
public Set<String> getRoutinesNeededPerJob(String jobId, String jobVersion) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
if (!routinesNeededPerJob.containsKey(key)) {
|
||||
routinesNeededPerJob.put(key, new HashSet<String>());
|
||||
}
|
||||
@@ -279,7 +280,8 @@ public class LastGenerationInfo {
|
||||
}
|
||||
|
||||
private String getProcessKey(String jobId, String jobVersion) {
|
||||
return jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String pureJobId = ProcessUtils.getPureItemId(jobId);
|
||||
return pureJobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -288,7 +290,7 @@ public class LastGenerationInfo {
|
||||
* @return the pigudfNeededPerJob
|
||||
*/
|
||||
public Set<String> getPigudfNeededPerJob(String jobId, String jobVersion) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
if (!pigudfNeededPerJob.containsKey(key)) {
|
||||
pigudfNeededPerJob.put(key, new HashSet<String>());
|
||||
}
|
||||
@@ -302,7 +304,7 @@ public class LastGenerationInfo {
|
||||
* @param modulesNeededPerJob the modulesNeededPerJob to set
|
||||
*/
|
||||
public void setRoutinesNeededPerJob(String jobId, String jobVersion, Set<String> modulesNeeded) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
routinesNeededPerJob.put(key, new HashSet<String>(modulesNeeded));
|
||||
}
|
||||
|
||||
@@ -312,7 +314,7 @@ public class LastGenerationInfo {
|
||||
* @param pigudfNeededPerJob the pigudfNeededPerJob to set
|
||||
*/
|
||||
public void setPigudfNeededPerJob(String jobId, String jobVersion, Set<String> modulesNeeded) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
pigudfNeededPerJob.put(key, new HashSet<String>(modulesNeeded));
|
||||
}
|
||||
|
||||
@@ -321,7 +323,7 @@ public class LastGenerationInfo {
|
||||
* @return the modulesNeededPerJob
|
||||
*/
|
||||
public Set<String> getRoutinesNeededWithSubjobPerJob(String jobId, String jobVersion) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
if (!routinesNeededWithSubjobPerJob.containsKey(key)) {
|
||||
routinesNeededWithSubjobPerJob.put(key, new HashSet<String>());
|
||||
}
|
||||
@@ -334,7 +336,7 @@ public class LastGenerationInfo {
|
||||
* @return the pigudfNeededWithSubjobPerJob
|
||||
*/
|
||||
public Set<String> getPigudfNeededWithSubjobPerJob(String jobId, String jobVersion) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
if (!pigudfNeededWithSubjobPerJob.containsKey(key)) {
|
||||
pigudfNeededWithSubjobPerJob.put(key, new HashSet<String>());
|
||||
}
|
||||
@@ -348,7 +350,7 @@ public class LastGenerationInfo {
|
||||
* @param modulesNeededPerJob the modulesNeededPerJob to set
|
||||
*/
|
||||
public void setRoutinesNeededWithSubjobPerJob(String jobId, String jobVersion, Set<String> modulesNeeded) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
routinesNeededWithSubjobPerJob.put(key, new HashSet<String>(modulesNeeded));
|
||||
}
|
||||
|
||||
@@ -358,7 +360,7 @@ public class LastGenerationInfo {
|
||||
* @param pigudfNeededWithSubjobPerJob the pigudfNeededWithSubjobPerJob to set
|
||||
*/
|
||||
public void setPigudfNeededWithSubjobPerJob(String jobId, String jobVersion, Set<String> modulesNeeded) {
|
||||
String key = jobId + "_" + jobVersion; //$NON-NLS-1$
|
||||
String key = this.getProcessKey(jobId, jobVersion);
|
||||
pigudfNeededWithSubjobPerJob.put(key, new HashSet<String>(modulesNeeded));
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,12 @@ public class ItemCacheManager {
|
||||
processItem = getRefProcessItem(ProjectManager.getInstance().getCurrentProject(), parsedArray[1]);
|
||||
} else {
|
||||
Project project = ProjectManager.getInstance().getProjectFromProjectTechLabel(parsedArray[0]);
|
||||
processItem = getProcessItem(project, parsedArray[1]);
|
||||
if (project != null) {
|
||||
processItem = getProcessItem(project, parsedArray[1]);
|
||||
}
|
||||
if (processItem == null) {
|
||||
processItem = getRefProcessItem(ProjectManager.getInstance().getCurrentProject(), parsedArray[1]);
|
||||
}
|
||||
}
|
||||
return processItem;
|
||||
}
|
||||
@@ -112,7 +117,12 @@ public class ItemCacheManager {
|
||||
refProcessItem = getRefProcessItem(ProjectManager.getInstance().getCurrentProject(), parsedArray[1], version);
|
||||
} else {
|
||||
Project project = ProjectManager.getInstance().getProjectFromProjectTechLabel(parsedArray[0]);
|
||||
refProcessItem = getProcessItem(project, parsedArray[1], version);
|
||||
if (project != null) {
|
||||
refProcessItem = getProcessItem(project, parsedArray[1], version);
|
||||
}
|
||||
if (refProcessItem == null) {
|
||||
refProcessItem = getRefProcessItem(ProjectManager.getInstance().getCurrentProject(), parsedArray[1], version);
|
||||
}
|
||||
}
|
||||
return refProcessItem;
|
||||
}
|
||||
|
||||
@@ -98,6 +98,8 @@ public class RepositoryConstants {
|
||||
|
||||
public static final String REPOSITORY_CLOUD_APAC_ID = "cloud_apac"; //$NON-NLS-1$
|
||||
|
||||
public static final String REPOSITORY_CLOUD_US_WEST_ID = "cloud_us_west"; //$NON-NLS-1$
|
||||
|
||||
public static final String REPOSITORY_CLOUD_CUSTOM_ID = "cloud_custom"; //$NON-NLS-1$
|
||||
|
||||
public static final String REPOSITORY_URL = "url"; //$NON-NLS-1$
|
||||
|
||||
@@ -2589,7 +2589,21 @@ public class ProcessorUtilities {
|
||||
}
|
||||
|
||||
public static boolean isEsbJob(String processId, String version) {
|
||||
return esbJobs.contains(esbJobKey(processId, version));
|
||||
ProcessItem processItem = ItemCacheManager.getProcessItem(processId, version);
|
||||
if (processItem != null && processItem.getProperty() != null && processItem.getProperty().getItem() != null) {
|
||||
Set<JobInfo> infos = ProcessorUtilities.getChildrenJobInfo(processItem.getProperty().getItem(), false);
|
||||
for (JobInfo jobInfo : infos) {
|
||||
ProcessType processType = jobInfo.getProcessItem().getProcess();
|
||||
EList<NodeType> nodes = processType.getNode();
|
||||
for (NodeType nodeType : nodes) {
|
||||
if (isEsbComponentName(nodeType.getComponentName())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void addEsbJob(JobInfo jobInfo) {
|
||||
@@ -2628,5 +2642,4 @@ public class ProcessorUtilities {
|
||||
public static boolean isNeedProjectProcessId(String componentName) {
|
||||
return "tRunJob".equalsIgnoreCase(componentName) || "cTalendJob".equalsIgnoreCase(componentName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ import org.talend.core.model.utils.JavaResourcesHelper;
|
||||
import org.talend.core.runtime.maven.MavenArtifact;
|
||||
import org.talend.core.runtime.maven.MavenConstants;
|
||||
import org.talend.core.runtime.maven.MavenUrlHelper;
|
||||
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
|
||||
import org.talend.core.runtime.projectsetting.IProjectSettingTemplateConstants;
|
||||
import org.talend.core.runtime.repository.build.IMavenPomCreator;
|
||||
import org.talend.core.ui.ITestContainerProviderService;
|
||||
@@ -269,6 +270,7 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
|
||||
|
||||
protected void addChildrenDependencies(final List<Dependency> dependencies) {
|
||||
String parentId = getJobProcessor().getProperty().getId();
|
||||
|
||||
final Set<JobInfo> clonedChildrenJobInfors = getJobProcessor().getBuildFirstChildrenJobs();
|
||||
for (JobInfo jobInfo : clonedChildrenJobInfors) {
|
||||
if (jobInfo.getFatherJobInfo() != null && jobInfo.getFatherJobInfo().getJobId().equals(parentId)) {
|
||||
@@ -284,6 +286,10 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
|
||||
property = jobInfo.getProcessItem().getProperty();
|
||||
groupId = PomIdsHelper.getJobGroupId(property);
|
||||
artifactId = PomIdsHelper.getJobArtifactId(jobInfo);
|
||||
if ("OSGI".equals(property.getAdditionalProperties().get(TalendProcessArgumentConstant.ARG_BUILD_TYPE))) {
|
||||
artifactId = artifactId + "-bundle";
|
||||
}
|
||||
|
||||
version = PomIdsHelper.getJobVersion(property);
|
||||
// try to get the pom version of children job and load from the pom file.
|
||||
String childPomFileName = PomUtil.getPomFileName(jobInfo.getJobName(), jobInfo.getJobVersion());
|
||||
|
||||
@@ -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;
|
||||
@@ -745,12 +748,12 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
Document document = PomUtil.loadAssemblyFile(null, assemblyFile);
|
||||
// add talend libs & codes
|
||||
setupDependencySetNode(document, talendLibCoordinateMap, "lib", "${artifact.artifactId}.${artifact.extension}",
|
||||
false);
|
||||
false, false);
|
||||
// add 3rd party libs <dependencySet>
|
||||
setupDependencySetNode(document, _3rdDepLibMap, "lib", null, false);
|
||||
setupDependencySetNode(document, _3rdDepLibMap, "lib", null, false, false);
|
||||
// add jobs
|
||||
setupDependencySetNode(document, jobCoordinateMap, "${talend.job.name}",
|
||||
"${artifact.build.finalName}.${artifact.extension}", true);
|
||||
"${artifact.build.finalName}.${artifact.extension}", true, false);
|
||||
// add duplicate dependencies if exists
|
||||
setupFileNode(document, duplicateLibs);
|
||||
|
||||
@@ -819,7 +822,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
}
|
||||
|
||||
protected void setupDependencySetNode(Document document, Map<String, Dependency> libIncludes, String outputDir,
|
||||
String fileNameMapping, boolean useProjectArtifact) {
|
||||
String fileNameMapping, boolean useProjectArtifact, boolean unpack) {
|
||||
if (libIncludes.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
@@ -830,9 +833,11 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
Node dependencySetNode = document.createElement("dependencySet");
|
||||
dependencySetsNode.appendChild(dependencySetNode);
|
||||
|
||||
Node outputDirNode = document.createElement("outputDirectory");
|
||||
outputDirNode.setTextContent(outputDir);
|
||||
dependencySetNode.appendChild(outputDirNode);
|
||||
if (StringUtils.isNotBlank(outputDir)) {
|
||||
Node outputDirNode = document.createElement("outputDirectory");
|
||||
outputDirNode.setTextContent(outputDir);
|
||||
dependencySetNode.appendChild(outputDirNode);
|
||||
}
|
||||
|
||||
Node includesNode = document.createElement("includes");
|
||||
dependencySetNode.appendChild(includesNode);
|
||||
@@ -853,6 +858,12 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
|
||||
useProjectArtifactNode.setTextContent(Boolean.toString(useProjectArtifact));
|
||||
dependencySetNode.appendChild(useProjectArtifactNode);
|
||||
|
||||
if (unpack) {
|
||||
Node unpackNode = document.createElement("unpack");
|
||||
unpackNode.setTextContent(Boolean.TRUE.toString());
|
||||
dependencySetNode.appendChild(unpackNode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void setupFileNode(Document document, Map<String, Set<Dependency>> duplicateDependencies) {
|
||||
@@ -893,4 +904,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,18 @@ 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 +57,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 +116,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 +150,23 @@ 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())
|
||||
|| isRouteOperation(getJobProcessor().getProperty())) {
|
||||
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")) {
|
||||
@@ -227,8 +247,8 @@ public class CreateMavenStandardJobOSGiPom extends CreateMavenJobPom {
|
||||
try {
|
||||
Document document = PomUtil.loadAssemblyFile(null, assemblyFile);
|
||||
// add jobs
|
||||
setupDependencySetNode(document, jobCoordinateMap, "${talend.job.name}",
|
||||
"${artifact.build.finalName}.${artifact.extension}", true);
|
||||
setupDependencySetNode(document, jobCoordinateMap, null, "${artifact.build.finalName}.${artifact.extension}", true,
|
||||
true);
|
||||
PomUtil.saveAssemblyFile(assemblyFile, document);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
@@ -260,14 +280,63 @@ 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;
|
||||
}
|
||||
|
||||
public boolean isRouteOperation(Property property) {
|
||||
List<IRepositoryViewObject> routeRepoList = null;
|
||||
|
||||
boolean isRouteOperation = false;
|
||||
|
||||
IESBService service = (IESBService) GlobalServiceRegister.getDefault().getService(IESBService.class);
|
||||
|
||||
try {
|
||||
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
|
||||
routeRepoList = factory.getAll(ERepositoryObjectType.valueOf(ERepositoryObjectType.class, "ROUTE"));
|
||||
|
||||
for (IRepositoryViewObject routeItem : routeRepoList) {
|
||||
if (service != null) {
|
||||
|
||||
List<Relation> relations = RelationshipItemBuilder.getInstance().getItemsRelatedTo(routeItem.getId(),
|
||||
routeItem.getVersion(), RelationshipItemBuilder.JOB_RELATION);
|
||||
for (Relation relation : relations) {
|
||||
if (relation.getType() == RelationshipItemBuilder.JOB_RELATION) {
|
||||
if (relation.getId().equals(property.getId())) {
|
||||
isRouteOperation = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
return isRouteOperation;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1042,6 +1042,9 @@ public class ExtractMetaDataUtils {
|
||||
}
|
||||
}else{
|
||||
String jarName = librairesManagerService.getJarNameFromMavenuri(driverJarPathArg);
|
||||
if (jarName == null) {
|
||||
jarName = driverJarPathArg.split("/")[1] + ".jar";
|
||||
}
|
||||
if (!new File(getJavaLibPath() + jarName).exists()) {
|
||||
librairesManagerService.retrieve(jarName, getJavaLibPath(), new NullProgressMonitor());
|
||||
}
|
||||
|
||||
@@ -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