Compare commits

..

2 Commits

50 changed files with 103 additions and 1622 deletions

View File

@@ -872,38 +872,25 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
@Override
public IRepositoryViewObject getLastVersion(Project project, String id, String relativeFolder, ERepositoryObjectType type)
throws PersistenceException {
List<IRepositoryViewObject> serializableAllVersion = new ArrayList<>();
if (lastFolderForItemMap.containsKey(id)) {
ERepositoryObjectType itemType = lastRepositoryTypeForItemMap.get(id);
String currentPath = lastFolderForItemMap.get(id);
Object fullFolder = getFullFolder(project, itemType, currentPath);
try {
if (fullFolder != null && (fullFolder instanceof FolderItem || ((IFolder) fullFolder).exists())) {
serializableAllVersion.addAll(getSerializableFromFolder(project, fullFolder, id, itemType, false, false, true, true));
}
} catch (PersistenceException e) {
// do nothing.
// if any exception happen or can't find the item, just try to look for it everywhere.
}
}
List<IRepositoryViewObject> serializableAllVersion = null;
Object fullFolder = getFullFolder(project, type, relativeFolder);
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, false, true, true);
if (serializableAllVersion.isEmpty()) {
Object fullFolder = getFullFolder(project, type, relativeFolder);
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, false, true, true);
if (serializableAllVersion.isEmpty()) {
// look in all folders for this item type
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, true, true, true, true);
}
// look in all folders for this item type
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, true, true, true, true);
}
int size = serializableAllVersion.size();
if (size > 1) {
String message = getItemsMessages(serializableAllVersion, size);
throw new PersistenceException(Messages.getString(
"AbstractEMFRepositoryFactory.presistenceException.OnlyOneOccurenceMustbeFound", message)); //$NON-NLS-1$
}
if (size == 1) {
} else if (size == 1) {
return serializableAllVersion.get(0);
} else {
return null;
}
return null;
}
protected void computePropertyMaxInformationLevel(Property property) {

View File

@@ -2199,7 +2199,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IUpdateService.class)) {
IUpdateService updateService = GlobalServiceRegister.getDefault().getService(IUpdateService.class);
updateService.syncComponentM2Jars(currentMonitor);
updateService.installComponents(currentMonitor);
}
// init sdk component

View File

@@ -88,8 +88,8 @@ public enum EDatabaseVersion4Drivers {
"Microsoft", "MSSQL_PROP", //$NON-NLS-1$ //$NON-NLS-2$
new String[] { "mssql-jdbc.jar", "slf4j-api-1.7.25.jar", "slf4j-log4j12-1.7.25.jar", "adal4j-1.6.7.jar", //$NON-NLS-1$
"commons-lang3-3.10.jar", "commons-codec-1.14.jar", "gson-2.8.9.jar", "oauth2-oidc-sdk-9.7.jar",
"json-smart-2.4.11.jar", "nimbus-jose-jwt-9.22.jar", "javax.mail-1.6.2.jar", "reload4j-1.2.19.jar",
"accessors-smart-2.4.11.jar", "asm-9.5.jar", "content-type-2.1.jar" })),
"json-smart-2.4.7.jar", "nimbus-jose-jwt-9.22.jar", "javax.mail-1.6.2.jar", "reload4j-1.2.19.jar",
"accessors-smart-2.4.7.jar", "asm-9.1.jar", "content-type-2.1.jar" })),
VERTICA_9(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 9.X", "VERTICA_9_0", "vertica-jdbc-9.3.1-0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
VERTICA_7_1_X(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 7.1.X (Deprecated)", "VERTICA_7_1_X", "vertica-jdbc-7.1.2-0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

View File

@@ -495,16 +495,11 @@ public class ContextUtils {
}
return itemMap;
}
private static Set<String> missingContexts = new HashSet<>();
public static void clearMissingContextCache() {
missingContexts.clear();
}
/**
* get the repository context item, now contextId can be either joblet node or context node.
*/
*
* get the repository context item,now contextId can be either joblet node or context node.
*/
public static Item getRepositoryContextItemById(String contextId) {
if (IContextParameter.BUILT_IN.equals(contextId)) {
return null;
@@ -512,9 +507,6 @@ public class ContextUtils {
if (checkObject(contextId)) {
return null;
}
if (missingContexts.contains(contextId)) {
return null;
}
List<ERepositoryObjectType> possibleTypes = new ArrayList<ERepositoryObjectType>();
possibleTypes.add(ERepositoryObjectType.CONTEXT);
@@ -529,8 +521,6 @@ public class ContextUtils {
return item;
}
}
missingContexts.add(contextId);
ExceptionHandler.log("Can't find Context item[id=" + contextId + "].");
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
@@ -841,7 +831,6 @@ public class ContextUtils {
ItemContextLink itemContextLink) {
Map<String, String> renamedMap = new HashMap<String, String>();
Map<String, Item> tempItemMap = new HashMap<String, Item>();
clearMissingContextCache();
for (ContextType contextType : contextTypeList) {
for (Object obj : contextType.getContextParameter()) {
if (obj instanceof ContextParameterType) {
@@ -904,7 +893,6 @@ public class ContextUtils {
*/
public static Map<String, String> calculateRenamedMapFromLinkFile(String projectLabel, String itemId,
List<IContext> contextList) {
clearMissingContextCache();
Map<String, String> renamedMap = new HashMap<String, String>();
Map<String, Item> idToItemMap = new HashMap<String, Item>();
try {
@@ -963,14 +951,6 @@ public class ContextUtils {
params.add(param);
}
public boolean remove(Item item, String param) {
Set<String> params = map.get(item);
if (params != null && params.contains(param)) {
return params.remove(param);
}
return false;
}
@SuppressWarnings("unchecked")
public Set<String> get(Item item) {
Set<String> params = map.get(item);

View File

@@ -299,7 +299,6 @@ public class JobContextManager implements IContextManager {
}
List<ContextItem> contextItemList = ContextUtils.getAllContextItem();
boolean setDefault = false;
ContextUtils.clearMissingContextCache();
for (int i = 0; i < contextTypeList.size(); i++) {
contextType = (ContextType) contextTypeList.get(i);
String name = contextType.getName();
@@ -527,7 +526,6 @@ public class JobContextManager implements IContextManager {
EList newcontextTypeList = new BasicEList();
Map<String, Item> idToItemMap = new HashMap<String, Item>();
ContextUtils.clearMissingContextCache();
for (int i = 0; i < listContext.size(); i++) {
IContext context = listContext.get(i);
String contextGroupName = renameGroupContext.get(context);

View File

@@ -51,7 +51,6 @@ public abstract class AbstractItemContextLinkService implements IItemContextLink
itemContextLink.setItemId(itemId);
Map<String, Item> tempCache = new HashMap<String, Item>();
if (contextTypeList != null && contextTypeList.size() > 0) {
ContextUtils.clearMissingContextCache();
for (Object object : contextTypeList) {
if (object instanceof ContextType) {
ContextType jobContextType = (ContextType) object;

View File

@@ -206,7 +206,6 @@ public class ContextLinkService {
Map<String, Map<String, String>> changedContextParameterId) throws PersistenceException {
List<Relation> relationList = RelationshipItemBuilder.getInstance()
.getItemsHaveRelationWith(sourceId, RelationshipItemBuilder.LATEST_VERSION, false);
ContextUtils.clearMissingContextCache();
for (Relation relation : relationList) {
String id = relation.getId();
IFile linkFile = calContextLinkFile(ProjectManager.getInstance().getCurrentProject().getTechnicalLabel(), id);

View File

@@ -728,8 +728,8 @@ public final class ProcessUtils {
}
return null;
}
public static boolean isRoute(Property property) {
private static boolean isRoute(Property property) {
return property!= null && (ERepositoryObjectType.getType(property).equals(ERepositoryObjectType.PROCESS_ROUTE) ||
ERepositoryObjectType.getType(property).equals(ERepositoryObjectType.PROCESS_ROUTE_MICROSERVICE));
}
@@ -768,39 +768,6 @@ public final class ProcessUtils {
return false;
}
public static boolean isRouteWithRoutelets(Item item) {
if (item!= null && item instanceof ProcessItem) {
for (Object obj : ((ProcessItem) item).getProcess().getNode()) {
if (obj instanceof NodeType) {
if (isRouteletNode((NodeType) obj)) {
return true;
}
}
}
}
return false;
}
public static boolean isRouteletNode(NodeType node) {
String jobIds = getParameterValue(node.getElementParameter(), "PROCESS_TYPE:PROCESS_TYPE_PROCESS");
String jobVersion = getParameterValue(node.getElementParameter(), "PROCESS_TYPE:PROCESS_TYPE_VERSION"); //$NON-NLS-1$
ProcessItem processItem = ItemCacheManager.getProcessItem(jobIds, jobVersion);
if (processItem != null) {
return ERepositoryObjectType.getType(processItem.getProperty()).equals(
ERepositoryObjectType.PROCESS_ROUTELET);
}
return false;
}
public static String getParameterValue(EList<ElementParameterType> listParamType, String paramName) {
for (ElementParameterType pType : listParamType) {
if (pType != null && paramName.equals(pType.getName())) {
return pType.getValue();
}
}
return null;
}
public static int getAssertAmount(IProcess process) {
int count = 0;
@@ -1091,28 +1058,6 @@ public final class ProcessUtils {
}
return false;
}
public static boolean isChildRouteProcess(Item item) {
if (item!= null && item instanceof ProcessItem) {
for (Object obj : ((ProcessItem) item).getProcess().getNode()) {
if (obj instanceof NodeType) {
if (((NodeType) obj).getComponentName().equals("tRouteInput")) {
return true;
}
}
}
}
return false;
}
public static boolean isRoutelet(Property p) {
if (p != null) {
return ERepositoryObjectType.getType(p).equals(ERepositoryObjectType.PROCESS_ROUTELET);
}
return false;
}
public static String escapeJava(String input) {
return StringEscapeUtils.escapeJava(input);

View File

@@ -42,8 +42,6 @@ public class JobInfoProperties extends Properties {
public static final String PROJECT_NAME = "project"; //$NON-NLS-1$
public static final String JOB_ID = "jobId"; //$NON-NLS-1$
public static final String JOB_PARENT_ID = "jobParentId"; //$NON-NLS-1$
public static final String JOB_NAME = "job"; //$NON-NLS-1$
@@ -94,10 +92,6 @@ public class JobInfoProperties extends Properties {
setProperty(BRANCH, branchSelection);
}
if (processItem.getProperty() != null && processItem.getProperty().getParentItem() != null) {
setProperty(JOB_PARENT_ID, processItem.getProperty().getParentItem().getProperty().getId());
}
setProperty(JOB_ID, jobInfo.getJobId());
setProperty(JOB_NAME, jobInfo.getJobName());
String jobType = processItem.getProcess().getJobType();

View File

@@ -22,8 +22,6 @@ public interface IBuildParametes {
static final String SERVICE = "Service"; //$NON-NLS-1$
static final String ITEM = "Item"; //$NON-NLS-1$
static final String PARENT_ITEM = "ParentItem"; //$NON-NLS-1$
static final String VERSION = "Version"; //$NON-NLS-1$

View File

@@ -26,7 +26,5 @@ public interface IUpdateService extends IService {
public String getSharedStudioMissingPatchVersion();
public boolean updateArtifactsFileSha256Hex(IProgressMonitor monitor, String studioArtifactsFileShaCodeHex);
public void installComponents(IProgressMonitor monitor);
}

View File

@@ -648,7 +648,6 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
helper.initHelper(contextManager);
Map<String, Item> items = new HashMap<String, Item>();
boolean needRefresh = false;
ContextUtils.clearMissingContextCache();
for (IContextParameter param : contextManager.getDefaultContext().getContextParameterList()) {
if (!param.isBuiltIn()) {
String source = param.getSource();

View File

@@ -522,7 +522,6 @@ public class SelectRepositoryContextDialog extends SelectionDialog {
// remove the params which is unchecked
Set<String> jobletIds = new HashSet<String>();
Set<String> chekedIds = new HashSet<String>();
ContextUtils.clearMissingContextCache();
for (IContextParameter param : existParas) {
if (param.isBuiltIn()) {
continue;

View File

@@ -185,7 +185,6 @@ public class AddRepositoryContextGroupCommand extends Command {
// remove the params which is unchecked
Set<String> jobletIds = new HashSet<String>();
Set<String> chekedIds = new HashSet<String>();
ContextUtils.clearMissingContextCache();
for (IContextParameter param : existParas) {
if (param.isBuiltIn()) {
continue;

View File

@@ -92,7 +92,6 @@ public class ContextNatTableUtils {
List<ContextTableTabParentModel> output = new ArrayList<ContextTableTabParentModel>();
if (!contextDatas.isEmpty()) {
int i = 0;
ContextUtils.clearMissingContextCache();
for (IContextParameter para : contextDatas) {
String sourceId = para.getSource();
if (IContextParameter.BUILT_IN.equals(sourceId)) {

View File

@@ -21,7 +21,6 @@ import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
import org.talend.core.model.context.ContextUtils;
import org.talend.core.ui.branding.IBrandingConfiguration;
/**
@@ -52,7 +51,6 @@ public class Contexts {
public void run() {
if (cxtView != null) {
updateTitle(cxtView);
ContextUtils.clearMissingContextCache();
cxtView.refresh(part);
}
}

View File

@@ -134,7 +134,7 @@ public final class TokenInforUtil {
targetArray = new JSONArray();
Map<String,List<JSONObject>> objectMap = new HashMap<String,List<JSONObject>>();
for (Object obj : data) {
if((obj instanceof JSONObject) && ((JSONObject)obj).has("component_name") && ((JSONObject)obj).get("component_name")!=null){//$NON-NLS-1$
if((obj instanceof JSONObject) && ((JSONObject)obj).get("component_name")!=null){//$NON-NLS-1$
List<JSONObject> dataList = new ArrayList<JSONObject>();
String componentName = (String) ((JSONObject)obj).get("component_name");//$NON-NLS-1$
if(objectMap.containsKey(componentName)){

View File

@@ -54,9 +54,7 @@ Export-Package: org.talend.core,
org.talend.core.services.resource,
org.talend.core.views,
org.talend.designer.runprocess
Import-Package: org.apache.commons.collections4.map,
org.eclipse.m2e.core,
org.eclipse.m2e.core.embedder
Import-Package: org.apache.commons.collections4.map
Bundle-ClassPath: .,
lib/log4j-api-2.17.1.jar,
lib/log4j-core-2.17.1.jar

View File

@@ -1,255 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2023 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.model.utils;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.apache.log4j.spi.LoggerFactory;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.IMaven;
import org.osgi.framework.FrameworkUtil;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ILibraryManagerService;
import org.talend.core.i18n.Messages;
import org.talend.utils.io.FilesUtils;
abstract public class BaseComponentInstallerTask implements IComponentInstallerTask {
private static final String SYS_PROP_TCOMPV0 = "tcompv0.update";
private static final String SYS_PROP_OVERWRITE = "m2.overwrite";
private static final String SYS_PROP_OVERWRITE_DEFAULT = Boolean.FALSE.toString();
private static final String SYS_CUSTOM_MAVEN_REPO = "maven.local.repository";
private int order;
private int componentType = -1;
private Set<ComponentGAV> gavs = new HashSet<ComponentGAV>();
protected boolean overWriteM2() {
/**
* force to overwrite, since need to sync maven-metadata-local.xml
*/
String prop = System.getProperty(SYS_PROP_OVERWRITE, Boolean.TRUE.toString());
return Boolean.valueOf(prop);
}
protected boolean updateTcompv0() {
String prop = System.getProperty(SYS_PROP_TCOMPV0, SYS_PROP_OVERWRITE_DEFAULT);
return Boolean.valueOf(prop);
}
@Override
public int getComponentType() {
return componentType;
}
@Override
public void setComponentType(int componentType) {
this.componentType = componentType;
}
@Override
public int getOrder() {
return this.order;
}
@Override
public void setOrder(int order) {
this.order = order;
}
@Override
public Set<ComponentGAV> getComponentGAV() {
return gavs;
}
@Override
public void addComponentGAV(ComponentGAV gav) {
gavs.add(gav);
}
@Override
public Set<ComponentGAV> getComponentGAV(int componentType) {
return this.gavs.stream().filter(gav -> (gav.getComponentType() & componentType) > 0)
.collect(Collectors.toSet());
}
/**
* Get implementation class of installer
*
* @return implementation class of installer
*/
abstract protected Class<? extends BaseComponentInstallerTask> getInstallerClass();
/**
* Get jar file directory
*
* @return jar file directory
*/
protected File getJarFileDir() {
URL jarFolder = FileLocator.find(FrameworkUtil.getBundle(getInstallerClass()), new Path("repository"), null);
File jarFileDir = null;
if (jarFolder != null) {
try {
jarFileDir = new File(FileLocator.toFileURL(jarFolder).getPath());
if (jarFileDir.isDirectory()) {
return jarFileDir;
}
} catch (IOException e) {
ExceptionHandler.process(e);
}
}
return null;
}
/**
* <pre>
*Implementation of unzipping files into studio local m2 directory
*
* </pre>
*/
@Override
public boolean needInstall() {
if (this.updateTcompv0()) {
return true;
}
boolean toInstall = false;
Set<ComponentGAV> tcompv0Gavs = this.getComponentGAV(COMPONENT_TYPE_TCOMPV0);
ILibraryManagerService librairesManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault()
.getService(ILibraryManagerService.class);
if (librairesManagerService != null) {
for (ComponentGAV gav : tcompv0Gavs) {
File jarFile = librairesManagerService.resolveStatusLocally(gav.toMavenUri());
if (jarFile == null) {
toInstall = true;
break;
}
}
}
if (toInstall) {
}
return toInstall;
}
@Override
public boolean install(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
if (monitor == null) {
monitor = new NullProgressMonitor();
}
if (!this.needInstall()) {
return false;
}
File jarDir = getJarFileDir();
if (jarDir == null) {
return false;
}
File m2Dir = getM2RepositoryPath();
if (m2Dir == null) {
return false;
}
File[] files = jarDir.listFiles();
Set<File> zipFiles = Stream.of(files).filter(f -> f.getName().endsWith(".zip")).collect(Collectors.toSet());
boolean installed = true;
monitor.beginTask(Messages.getString("BaseComponentInstallerTask.installComponent", getMonitorText()),
zipFiles.size());
for (File zf : zipFiles) {
try {
FilesUtils.unzip(zf.getAbsolutePath(), m2Dir.getAbsolutePath(), this.overWriteM2());
} catch (Exception e) {
installed = false;
}
monitor.worked(1);
}
return installed;
}
/**
* Get studio local maven repository path
*
* @return local maven repository path
*/
protected File getM2RepositoryPath() {
String mavenRepo = System.getProperty(SYS_CUSTOM_MAVEN_REPO);
File m2Repo = null;
if (StringUtils.isEmpty(mavenRepo)) {
final IMaven maven = MavenPlugin.getMaven();
try {
maven.reloadSettings();
} catch (CoreException e) {
ExceptionHandler.process(e);
}
String localRepository = maven.getLocalRepositoryPath();
if (!StringUtils.isEmpty(localRepository)) {
m2Repo = new File(localRepository);
}
} else {
m2Repo = new File(mavenRepo);
}
if (m2Repo != null && !m2Repo.exists()) {
m2Repo.mkdirs();
}
return m2Repo;
}
protected String getMonitorText() {
Set<ComponentGAV> tcompv0Gavs = this.getComponentGAV(COMPONENT_TYPE_TCOMPV0);
final StringBuilder sb = new StringBuilder();
tcompv0Gavs.forEach(gav -> {
if (sb.length() > 0) {
sb.append(",");
}
sb.append(gav.getArtifactId());
});
return sb.toString();
}
}

View File

@@ -1,208 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2023 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.model.utils;
import org.apache.commons.lang.StringUtils;
public class ComponentGAV {
private String groupId;
private String artifactId;
private String version;
private String classifier;
private String type;
private int componentType;
/**
* @return the groupId
*/
public String getGroupId() {
return groupId;
}
/**
* @param groupId the groupId to set
*/
public void setGroupId(String groupId) {
this.groupId = groupId;
}
/**
* @return the artifactId
*/
public String getArtifactId() {
return artifactId;
}
/**
* @param artifactId the artifactId to set
*/
public void setArtifactId(String artifactId) {
this.artifactId = artifactId;
}
/**
* @return the version
*/
public String getVersion() {
return version;
}
/**
* @param version the version to set
*/
public void setVersion(String version) {
this.version = version;
}
/**
* @return the classifier
*/
public String getClassifier() {
return classifier;
}
/**
* @param classifier the classifier to set
*/
public void setClassifier(String classifier) {
this.classifier = classifier;
}
/**
* @return the type
*/
public String getType() {
return type;
}
/**
* @param type the type to set
*/
public void setType(String type) {
this.type = type;
}
/**
* @return the componentType
*/
public int getComponentType() {
return componentType;
}
/**
* @param componentType the componentType to set
*/
public void setComponentType(int componentType) {
this.componentType = componentType;
}
public String toMavenUri() {
StringBuffer sb = new StringBuffer();
sb.append("mvn:");
sb.append(toStr("/"));
sb.append("/");
if (!StringUtils.isEmpty(type)) {
sb.append(type);
}
return sb.toString();
}
public String toCoordinateStr() {
return toStr(":");
}
private String toStr(String sep) {
StringBuffer sb = new StringBuffer();
if (!StringUtils.isEmpty(groupId)) {
sb.append(this.groupId);
}
if (!StringUtils.isEmpty(artifactId)) {
if (sb.length() > 0) {
sb.append(sep);
}
sb.append(this.artifactId);
}
if (!StringUtils.isEmpty(version)) {
sb.append(sep);
sb.append(this.version);
}
if (!StringUtils.isEmpty(classifier)) {
sb.append(sep);
sb.append(this.classifier);
}
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ComponentGAV)) {
return false;
}
ComponentGAV thatObj = (ComponentGAV) obj;
if (!StringUtils.equals(this.getGroupId(), thatObj.getGroupId())) {
return false;
}
if (!StringUtils.equals(this.getArtifactId(), thatObj.getArtifactId())) {
return false;
}
if (!StringUtils.equals(this.getVersion(), thatObj.getVersion())) {
return false;
}
if (!StringUtils.equals(this.getType(), thatObj.getType())) {
return false;
}
if (!StringUtils.equals(this.getClassifier(), thatObj.getClassifier())) {
return false;
}
return this.getComponentType() == thatObj.getComponentType();
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (this.getGroupId() == null ? 0 : this.getGroupId().hashCode());
result = prime * result + (this.getArtifactId() == null ? 0 : this.getArtifactId().hashCode());
result = prime * result + (this.getVersion() == null ? 0 : this.getVersion().hashCode());
result = prime * result + (this.getType() == null ? 0 : this.getType().hashCode());
result = prime * result + (this.getClassifier() == null ? 0 : this.getClassifier().hashCode());
result = prime * result + this.getComponentType();
return result;
}
@Override
public String toString() {
return "GAV [groupId=" + this.groupId + ", artifactId=" + this.artifactId + ", version=" + this.version + ", classifier=" + this.classifier + ", type=" + this.type + ", componentType="
+ this.componentType + "]";
}
}

View File

@@ -1,88 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2023 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.model.utils;
import java.lang.reflect.InvocationTargetException;
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
public interface IComponentInstallerTask {
int COMPONENT_TYPE_TCOMPV0 = 1;
int COMPONENT_TYPE_TCOMPV1 = 2;
int COMPONENT_TYPE_MAVEN_REPO = 4;
/**
* Order of the task, smaller means higher priority
*
* @return Order of the task
*/
int getOrder();
/**
* Set order of the task
*
* @param order
*/
void setOrder(int order);
/**
* Get all component gavs
*
* @return Set<ComponentGAV>
*/
Set<ComponentGAV> getComponentGAV();
/**
* @param componentType 1 - tcompv0, 2 - tcompv1
* @return Set<ComponentGAV>
*/
Set<ComponentGAV> getComponentGAV(int componentType);
/**
* Add component gav
*
* @param gav
*/
void addComponentGAV(ComponentGAV gav);
/**
* Whether it is necessary to install the component
*
* @return
*/
boolean needInstall();
/**
* Install the component
*
* @param monitor
* @throws InvocationTargetException
* @throws InterruptedException
*/
boolean install(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException;
/**
* @return the componentType
*/
int getComponentType();
/**
* @param componentType the componentType to set
*/
void setComponentType(int componentType);
}

View File

@@ -1608,11 +1608,6 @@ public class ProcessorUtilities {
}
}
// if (isCIMode() && "Routelets".equals(node.getComponent().getOriginalFamilyName())) {
if ("Routelets".equals(node.getComponent().getOriginalFamilyName())) {
processItem.getProperty().setParentItem(ItemCacheManager.getProcessItem(currentProcess.getId(), currentProcess.getVersion()));
}
int subJobOption = GENERATE_ALL_CHILDS;
if (BitwiseOptionUtils.containOption(option, GENERATE_WITH_FIRST_CHILD)) {
subJobOption = GENERATE_MAIN_ONLY;
@@ -2552,7 +2547,7 @@ public class ProcessorUtilities {
return jobInfos;
}
public static boolean isRouteletNode(NodeType node) {
private static boolean isRouteletNode(NodeType node) {
String jobIds = getParameterValue(node.getElementParameter(), "PROCESS_TYPE:PROCESS_TYPE_PROCESS");
String jobVersion = getParameterValue(node.getElementParameter(), "PROCESS_TYPE:PROCESS_TYPE_VERSION"); //$NON-NLS-1$
ProcessItem processItem = ItemCacheManager.getProcessItem(jobIds, jobVersion);
@@ -2950,12 +2945,4 @@ public class ProcessorUtilities {
public static boolean isNeedExportItemsForDQ() {
return needExportItemsForDQ;
}
public static boolean isMicroservice(Item item) {
if (item == null || item.getProperty() == null || item.getProperty().getAdditionalProperties() == null) {
return false;
}
return "ROUTE_MICROSERVICE".equals(item.getProperty().getAdditionalProperties()
.get(TalendProcessArgumentConstant.ARG_BUILD_TYPE));
}
}

View File

@@ -44,11 +44,6 @@
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
</dependencies>
<build>
<plugins>

View File

@@ -39,22 +39,12 @@
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>3.8.1</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -98,35 +88,10 @@
<artifactId>commons-io</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.8.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-io</artifactId>
<version>3.2.0</version>
<exclusions><!-- fix CVE to plexus-io:3.2.0-->
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
@@ -139,11 +104,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>

View File

@@ -26,16 +26,12 @@
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.8.0</version>
<version>3.6.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
@@ -43,16 +39,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
<version>4.0.0</version>
</dependency>
</dependencies>
<build>

View File

@@ -19,17 +19,8 @@
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
@@ -57,7 +48,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.8.0</version>
<version>3.6.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
@@ -65,16 +56,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
<version>4.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>

View File

@@ -41,11 +41,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
@@ -103,7 +98,7 @@
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<version>3.0.0</version>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
@@ -112,23 +107,15 @@
<exclusion>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
</exclusion>
</exclusion>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</exclusion>
</exclusion>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</exclusion>
</exclusion>
</exclusions>
</dependency>
<dependency>
@@ -139,42 +126,7 @@
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-api</artifactId>
<version>2.22.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-booter</artifactId>
<version>2.22.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit4</artifactId>
<version>2.22.2</version>
<version>2.20</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
@@ -196,21 +148,6 @@
<artifactId>jboss-marshalling</artifactId>
<version>2.0.12.Final</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.8.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
<version>4.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>

View File

@@ -42,7 +42,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230227</version>
<version>20140107</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
@@ -221,11 +221,6 @@
<artifactId>commons-text</artifactId>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
</dependencies>
<build>
<plugins>

View File

@@ -10,7 +10,7 @@
<artifactId>studio-tacokit-dependencies</artifactId>
<packaging>pom</packaging>
<properties>
<tacokit.components.version>1.27.26</tacokit.components.version>
<tacokit.components.version>1.27.21</tacokit.components.version>
</properties>
<repositories>
<repository>

View File

@@ -11,7 +11,7 @@
<packaging>pom</packaging>
<properties>
<tcomp.version>1.38.11</tcomp.version>
<tcomp.version>1.38.8</tcomp.version>
<slf4j.version>1.7.32</slf4j.version>
<log4j2.version>2.17.1</log4j2.version>
<reload4j.version>1.2.19</reload4j.version>

View File

@@ -44,17 +44,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-io</artifactId>
<version>3.4.1</version>
<version>3.0.24</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
@@ -74,18 +64,13 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.8.0</version>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
</dependencies>
</plugin>
<plugin>
@@ -108,11 +93,6 @@
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
</dependencies>
</plugin>
<plugin>
@@ -123,14 +103,9 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>4.0.0</version>
<version>3.0.24</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.21</version>
@@ -143,12 +118,12 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.8.0</version>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-io</artifactId>
<version>3.4.1</version>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
@@ -160,11 +135,6 @@
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
</dependencies>
<configuration>
<archive>
@@ -175,7 +145,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<version>3.0.0</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
@@ -185,12 +155,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
<version>4.0.0</version>
<version>3.0.24</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
@@ -205,24 +170,19 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.8.0</version>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>2.12.4</version>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
@@ -230,35 +190,15 @@
<version>3.0.24</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
</dependencies>
</plugin>
<plugin>

View File

@@ -45,7 +45,6 @@ public enum ETalendMavenVariables {
JobletName,
JobId,
JobParentId,
JobName,
JobType,
JobFinalName,

View File

@@ -25,6 +25,7 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -34,6 +35,7 @@ import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
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.Profile;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
@@ -56,7 +58,6 @@ import org.eclipse.swt.widgets.Display;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.utils.MojoType;
import org.talend.commons.utils.VersionUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IESBService;
import org.talend.core.ILibraryManagerService;
@@ -66,7 +67,6 @@ import org.talend.core.model.general.ILibrariesService;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.ModuleNeeded.ELibraryInstallStatus;
import org.talend.core.model.general.Project;
import org.talend.core.model.process.JobInfo;
import org.talend.core.model.process.ProcessUtils;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ProjectReference;
@@ -99,7 +99,6 @@ import org.talend.designer.maven.utils.MavenProjectUtils;
import org.talend.designer.maven.utils.PomIdsHelper;
import org.talend.designer.maven.utils.PomUtil;
import org.talend.designer.runprocess.IRunProcessService;
import org.talend.designer.runprocess.ProcessorUtilities;
import org.talend.repository.ProjectManager;
import org.talend.repository.RepositoryWorkUnit;
import org.talend.repository.model.RepositoryConstants;
@@ -632,37 +631,9 @@ public class AggregatorPomsHelper {
public String getJobProjectName(Property property) {
return projectTechName + "_" + getJobProjectFolderName(property).toUpperCase(); //$NON-NLS-1$
}
public static String getJobLabel(Property property) {
if (property == null) {
return "";
}
if (property.getParentItem() != null) {
Property parentProperty = property.getParentItem().getProperty();
return parentProperty.getLabel() + "_" + parentProperty.getVersion().replace(".", "_") + "_" + property.getLabel();
}
return property.getLabel();
}
public static String getJobId(Property property) {
if (property == null) {
return "";
}
if (property.getParentItem() != null) {
Property parentProperty = property.getParentItem().getProperty();
return property.getId() + "_" + parentProperty.getId() + "_" + parentProperty.getVersion().replace(".", "_");
}
return property.getId();
}
public static String getJobProjectFolderName(Property property) {
return getJobProjectFolderName(getJobLabel(property), property.getVersion());
return getJobProjectFolderName(property.getLabel(), property.getVersion());
}
public static String getJobProjectFolderName(String label, String version) {
@@ -671,7 +642,7 @@ public class AggregatorPomsHelper {
public static String getJobProjectId(Property property) {
String _projectTechName = ProjectManager.getInstance().getProject(property).getTechnicalLabel();
return getJobProjectId(_projectTechName, getJobId(property), property.getVersion());
return getJobProjectId(_projectTechName, property.getId(), property.getVersion());
}
public static String getJobProjectId(String projectTechName, String id, String version) {
@@ -712,7 +683,7 @@ public class AggregatorPomsHelper {
AggregatorPomsHelper helper = new AggregatorPomsHelper(projectTechName);
IPath itemRelativePath = getItemRelativePath.apply(property);
String version = realVersion == null ? property.getVersion() : realVersion;
String jobFolderName = getJobProjectFolderName(getJobLabel(property), version);
String jobFolderName = getJobProjectFolderName(property.getLabel(), version);
ERepositoryObjectType type = ERepositoryObjectType.getItemType(property.getItem());
IFolder jobFolder = null;
if (PomIdsHelper.skipFolders()) {
@@ -1007,12 +978,6 @@ public class AggregatorPomsHelper {
}
Item item = object.getProperty().getItem();
if (ProjectManager.getInstance().isInCurrentMainProject(item)) {
// remove original child routelets projects as they will be created during parent Route generation
if (ProcessUtils.isRoutelet(item.getProperty())) {
continue;
}
monitor.subTask("Synchronize job pom: " + item.getProperty().getLabel() //$NON-NLS-1$
+ "_" + item.getProperty().getVersion()); //$NON-NLS-1$
if (runProcessService != null) {
@@ -1028,92 +993,11 @@ public class AggregatorPomsHelper {
modules.add(getModulePath(pomFile));
}
}
monitor.worked(1);
if (monitor.isCanceled()) {
return;
}
// Generate individual routelet projects/poms for each Route (CI mode only)
if (ProcessUtils.isRoute(item.getProperty()) && ProcessUtils.isRouteWithRoutelets(item)) {
Set<JobInfo> allJobInfos = ProcessorUtilities.getChildrenJobInfo(item, true, true);
for (JobInfo childJob : allJobInfos) {
if (childJob.getProcessItem() != null && childJob.getProcessItem().getProperty() != null ) {
if (!ProcessUtils.isRoutelet(childJob.getProcessItem().getProperty())) {
continue;
}
Property childJobProperty = childJob.getProcessItem().getProperty();
String jobGroupID = (String) childJob.getProcessItem().getProperty().getAdditionalProperties().get(MavenConstants.NAME_GROUP_ID);
String jobCustomVersion = (String) childJob.getProcessItem().getProperty().getAdditionalProperties().get(MavenConstants.NAME_USER_VERSION);
boolean jobUseSnapshot = childJob.getProcessItem().getProperty().getAdditionalProperties().containsKey(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
Property routeProperty = item.getProperty();
String routeGroupID = PomIdsHelper.getJobGroupId(routeProperty);
String routeVersion = VersionUtils.getPublishVersion(routeProperty.getVersion());
String routeCustomVersion = (String) routeProperty.getAdditionalProperties().get(MavenConstants.NAME_USER_VERSION);
boolean routeUseSnapshot = routeProperty.getAdditionalProperties().containsKey(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
IFile routePomFile = getItemPomFolder(item.getProperty()).getFile(TalendMavenConstants.POM_FILE_NAME);
// Inherit child job parameters from parent route
childJobProperty.setParentItem(item);
childJobProperty.getAdditionalProperties().put(MavenConstants.NAME_GROUP_ID, routeGroupID);
if (routeCustomVersion != null) {
childJobProperty.getAdditionalProperties().put(MavenConstants.NAME_USER_VERSION, routeCustomVersion);
} else {
childJobProperty.getAdditionalProperties().put(MavenConstants.NAME_USER_VERSION, routeVersion);
}
if (routeUseSnapshot) {
childJobProperty.getAdditionalProperties().put(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT, "true");
} else {
childJobProperty.getAdditionalProperties().remove(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
}
runProcessService.generatePom(childJob.getProcessItem(), TalendProcessOptionConstants.GENERATE_POM_NO_FILTER);
IFile childPomFile = getItemPomFolder(childJobProperty).getFile(TalendMavenConstants.POM_FILE_NAME);
if (childPomFile.getProject().getName().equalsIgnoreCase(routePomFile.getProject().getName())) {
modules.add(getModulePath(childPomFile));
}
// restore original Job parameters
childJobProperty.setParentItem(null);
if ( jobGroupID!= null) {
childJobProperty.getAdditionalProperties().put(MavenConstants.NAME_GROUP_ID, jobGroupID);
}else {
childJobProperty.getAdditionalProperties().remove(MavenConstants.NAME_GROUP_ID);
}
if (jobUseSnapshot) {
childJobProperty.getAdditionalProperties().put(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT, "true");
}else {
childJobProperty.getAdditionalProperties().remove(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
}
if (jobCustomVersion!=null) {
childJobProperty.getAdditionalProperties().put(MavenConstants.NAME_USER_VERSION, jobCustomVersion);
} else {
childJobProperty.getAdditionalProperties().remove(MavenConstants.NAME_USER_VERSION);
}
}
}
}
}
monitor.worked(1);
if (monitor.isCanceled()) {
return;
}
}
monitor.worked(1);
if (monitor.isCanceled()) {
return;
}
}
// sync project pom again with all modules.
monitor.subTask("Synchronize project pom with modules"); //$NON-NLS-1$

View File

@@ -149,30 +149,10 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
variablesValuesMap.put(ETalendMavenVariables.JobGroupId, PomIdsHelper.getJobGroupId(property));
variablesValuesMap.put(ETalendMavenVariables.JobVersion, PomIdsHelper.getJobVersion(property));
}
variablesValuesMap.put(ETalendMavenVariables.JobArtifactId, PomIdsHelper.getJobArtifactId(property));
variablesValuesMap.put(ETalendMavenVariables.TalendJobVersion, property.getVersion());
if(ProcessUtils.isRoutelet(property)) {
if(property.getParentItem() != null) {
String routeArtifactID = PomIdsHelper.getJobArtifactId(property.getParentItem().getProperty());
String jobArtifactID = PomIdsHelper.getJobArtifactId(property);
String routeVersion = property.getParentItem().getProperty().getVersion().replace(".", "_");
String jobName = (jobArtifactID.startsWith(routeArtifactID))? jobArtifactID :
routeArtifactID + "_" + routeVersion + "_" + jobArtifactID;
variablesValuesMap.put(ETalendMavenVariables.JobGroupId, PomIdsHelper.getJobGroupId(property.getParentItem().getProperty()));
variablesValuesMap.put(ETalendMavenVariables.JobArtifactId, jobName);
variablesValuesMap.put(ETalendMavenVariables.JobName, jobName);
variablesValuesMap.put(ETalendMavenVariables.JobVersion, PomIdsHelper.getJobVersion(property.getParentItem().getProperty()));
} else {
variablesValuesMap.put(ETalendMavenVariables.JobArtifactId, PomIdsHelper.getJobArtifactId(property));
final String jobName = JavaResourcesHelper.escapeFileName(process.getName());
variablesValuesMap.put(ETalendMavenVariables.JobName, jobName);
}
} else {
variablesValuesMap.put(ETalendMavenVariables.JobArtifactId, PomIdsHelper.getJobArtifactId(property));
final String jobName = JavaResourcesHelper.escapeFileName(process.getName());
variablesValuesMap.put(ETalendMavenVariables.JobName, jobName);
}
final String jobName = JavaResourcesHelper.escapeFileName(process.getName());
variablesValuesMap.put(ETalendMavenVariables.JobName, jobName);
if (property != null) {
Project currentProject = ProjectManager.getInstance().getProject(property);

View File

@@ -267,8 +267,6 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
jobInfoProp.getProperty(JobInfoProperties.CONTEXT_NAME, context.getName()));
checkPomProperty(properties, "talend.job.id", ETalendMavenVariables.JobId,
jobInfoProp.getProperty(JobInfoProperties.JOB_ID, process.getId()));
checkPomProperty(properties, "talend.job.parent.id", ETalendMavenVariables.JobParentId,
jobInfoProp.getProperty(JobInfoProperties.JOB_PARENT_ID, ""));
checkPomProperty(properties, "talend.job.type", ETalendMavenVariables.JobType,
jobInfoProp.getProperty(JobInfoProperties.JOB_TYPE));

View File

@@ -48,9 +48,9 @@
context="plugin:org.talend.metadata.managment"
language="java"
message="Needed for create snowflake connection"
mvn_uri="mvn:net.snowflake/snowflake-jdbc/3.13.29"
name="snowflake-jdbc-3.13.29.jar"
required="true">
mvn_uri="mvn:net.snowflake/snowflake-jdbc/3.11.0"
name="snowflake-jdbc-3.11.0.jar"
required="false">
</libraryNeeded>
<libraryNeeded
context="plugin:org.talend.metadata.managment"
@@ -148,33 +148,6 @@
required="true"
uripath="platform:/plugin/org.talend.libraries.jdbc.hsql/lib/hsqldb.jar">
</libraryNeeded>
<libraryNeeded
context="plugin:org.talend.metadata.managment"
language="java"
message="Needed for create Microsoft SQL Server db connection"
mvn_uri="mvn:net.minidev/json-smart/2.4.11"
name="json-smart-2.4.11.jar"
required="true"
uripath="platform:/plugin/org.talend.libraries.tis.custom/lib/json-smart-2.4.11.jar">
</libraryNeeded>
<libraryNeeded
context="plugin:org.talend.metadata.managment"
language="java"
message="Needed for create Microsoft SQL Server db connection"
mvn_uri="mvn:net.minidev/accessors-smart/2.4.11"
name="accessors-smart-2.4.11.jar"
required="true"
uripath="platform:/plugin/org.talend.libraries.tis.custom/lib/accessors-smart-2.4.11.jar">
</libraryNeeded>
<libraryNeeded
context="plugin:org.talend.metadata.managment"
language="java"
message="Needed for create Microsoft SQL Server db connection"
mvn_uri="mvn:org.ow2.asm/asm/9.5"
name="asm-9.5.jar"
required="true"
uripath="platform:/plugin/org.talend.libraries.tis.custom/lib/asm-9.5.jar">
</libraryNeeded>
</extension>
<extension
point="org.talend.core.migrationTask">

View File

@@ -126,7 +126,7 @@ public class ExtractMetaDataUtils {
public static final String SNOWFLAKE = "Snowflake"; //$NON-NLS-1$
public static final String SNOWFLAKE_DRIVER_JAR = "snowflake-jdbc-3.13.29.jar"; //$NON-NLS-1$
public static final String SNOWFLAKE_DRIVER_JAR = "snowflake-jdbc-3.11.0.jar"; //$NON-NLS-1$
private ExtractMetaDataUtils() {
}

View File

@@ -23,7 +23,6 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Stream;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
@@ -241,14 +240,20 @@ public class MigrationToolService implements IMigrationToolService {
sortMigrationTasks(toExecute);
final List<MigrationTask> done = new ArrayList<MigrationTask>(storedMigrations);
boolean hasTaskToExecute = toExecute.stream()
.anyMatch(task -> !task.isDeprecated() && MigrationUtil.findMigrationTask(done, task) == null);
int nbMigrationsToDo = 0;
for (IProjectMigrationTask task : toExecute) {
MigrationTask mgTask = MigrationUtil.findMigrationTask(done, task);
if (mgTask == null && !task.isDeprecated()) {
nbMigrationsToDo++;
}
}
// force to redo the migration task for the relations only if user ask for "clean" or if relations is empty
// or if there is at least another migration to do.
if (!beforeLogon && (!RelationshipItemBuilder.INDEX_VERSION.equals(project.getEmfProject().getItemsRelationVersion())
|| hasTaskToExecute)) {
if (!beforeLogon
&& (!RelationshipItemBuilder.INDEX_VERSION.equals(project.getEmfProject().getItemsRelationVersion()) || nbMigrationsToDo > 0)) {
// force to redo this migration task, to make sure the relationship is done correctly
// done.remove(RELATION_TASK);
MigrationUtil.removeMigrationTaskById(done, RELATION_TASK);
RelationshipItemBuilder.getInstance().unloadRelations();
@@ -259,37 +264,41 @@ public class MigrationToolService implements IMigrationToolService {
RelationshipItemBuilder.JOBLET_RELATION, true);
// reset
RelationshipItemBuilder.getInstance().unloadRelations();
hasTaskToExecute = true;
}
boolean checkDupContext = !beforeLogon && Boolean.getBoolean("duplicate.context.reference.check");
if (!hasTaskToExecute && !checkDupContext) {
nbMigrationsToDo++;
}
if (nbMigrationsToDo == 0) {
return;
}
if (checkDupContext) {
MigrationUtil.removeMigrationTaskById(done,
"org.talend.repository.model.migration.RemoveDuplicateContextReferencesMigrationTask");
}
if (hasTaskToExecute) {
// force execute migration in case user copy-past items with diffrent path on the file system and refresh
// the studio,it may cause bug TDI-19229
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.FixProjectResourceLink");
// force to re-generate all job poms
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.GenerateJobPomMigrationTask");
// force execute migration in case user copy-past items with diffrent path on the file system and refresh
// the studio,it may cause bug TDI-19229
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.FixProjectResourceLink");
// force to re-generate all job poms
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.GenerateJobPomMigrationTask");
if (beforeLogon) {
// for every migration, force reset to default maven template
MigrationUtil.removeMigrationTaskById(done,
"org.talend.repository.model.migration.ResetMavenTemplateMigrationTask");
if (beforeLogon) {
// for every migration, force reset to default maven template
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.ResetMavenTemplateMigrationTask");
}
boolean haveAnyBinFolder = false; // to avoid some problems of migration, sometimes
for (ERepositoryObjectType type : (ERepositoryObjectType[]) ERepositoryObjectType.values()) {
if (!type.hasFolder()) {
continue;
}
boolean hasBinFolder = Stream.of((ERepositoryObjectType[]) ERepositoryObjectType.values())
.filter(type -> type.hasFolder()).map(ERepositoryObjectType::getFolderName).filter(StringUtils::isNotBlank)
.map(folderName -> fsProject.getFolder(folderName))
.anyMatch(folder -> folder.exists() && folder.getFolder("bin").exists());
if (hasBinFolder) {
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.RemoveBinFolderMigrationTask");
String folderName = ERepositoryObjectType.getFolderName(type);
if (folderName == null || "".equals(folderName)) {
continue;
}
IFolder folder = fsProject.getFolder(folderName);
if (folder.exists() && folder.getFolder("bin").exists()) { //$NON-NLS-1$
haveAnyBinFolder = true;
break;
}
}
if (haveAnyBinFolder) {
MigrationUtil.removeMigrationTaskById(done, "org.talend.repository.model.migration.RemoveBinFolderMigrationTask");
}
final SubProgressMonitor subProgressMonitor = new SubProgressMonitor(monitorWrap, toExecute.size());

View File

@@ -400,36 +400,6 @@ public interface PropertiesPackage extends EPackage {
*/
int ITEM = 6;
/**
* The meta object id for the parent '{@link org.talend.core.model.properties.impl.ItemImpl <em>Item</em>}' class. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see org.talend.core.model.properties.impl.ItemImpl
* @see org.talend.core.model.properties.impl.PropertiesPackageImpl#getParentItem()
* @generated
*/
int PARENT_ITEM = 109;
/**
* The meta object id for the '{@link org.talend.core.model.properties.impl.ItemImpl <em>Item</em>}' class. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see org.talend.core.model.properties.impl.ItemImpl
* @see org.talend.core.model.properties.impl.PropertiesPackageImpl#getParentItem()
* @generated
*/
int PARENT_ITEM__PROPERTY = 110;
/**
* The feature id for the parent '<em><b>Item</b></em>' reference.
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
* @ordered
*/
int PROPERTY__PARENT_ITEM = 111;
/**
* The meta object id for the '{@link org.talend.core.model.properties.impl.BusinessProcessItemImpl <em>Business Process Item</em>}' class.
* <!-- begin-user-doc --> <!-- end-user-doc -->

View File

@@ -419,33 +419,5 @@ public interface Property extends EObject {
* @generated
*/
void setItem(Item value);
/**
* Returns the value of the parent '<em><b>Item</b></em>' reference. It is bidirectional and its opposite is '
* {@link org.talend.core.model.properties.Item#getProperty <em>Property</em>}'. <!-- begin-user-doc -->
* <p>
* If the meaning of the parent '<em>Item</em>' reference isn't clear, there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
*
* @return the value of the parent'<em>Item</em>' reference.
* @see #setParentItem(Item)
* @see org.talend.core.model.properties.PropertiesPackage#getProperty_Item()
* @see org.talend.core.model.properties.Item#getProperty
* @model opposite="property"
* @generated
*/
Item getParentItem();
/**
* Sets the value of the parent '{@link org.talend.core.model.properties.Property#getItem <em>Item</em>}' reference. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @param value the new value of the parent '<em>Item</em>' reference.
* @see #getParentItem()
* @generated
*/
void setParentItem(Item value);
} // Property

View File

@@ -227,17 +227,6 @@ public class PropertyImpl extends EObjectImpl implements Property {
* @ordered
*/
protected Item item;
/**
* The cached value of the parent '{@link #getParentItem() <em>Item</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParentItem()
* @generated
* @ordered
*/
protected Item parentItem;
/**
* The cached value of the '{@link #getAuthor() <em>Author</em>}' reference.
@@ -553,23 +542,6 @@ public class PropertyImpl extends EObjectImpl implements Property {
}
return item;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Item getParentItem() {
if (parentItem != null && parentItem.eIsProxy()) {
InternalEObject oldItem = (InternalEObject)parentItem;
parentItem = (Item)eResolveProxy(oldItem);
if (parentItem != oldItem) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, PropertiesPackage.PROPERTY__PARENT_ITEM, oldItem, parentItem));
}
}
return parentItem;
}
/**
* <!-- begin-user-doc -->
@@ -579,15 +551,6 @@ public class PropertyImpl extends EObjectImpl implements Property {
public Item basicGetItem() {
return item;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Item basicGetParentItem() {
return parentItem;
}
/**
* <!-- begin-user-doc -->
@@ -622,13 +585,6 @@ public class PropertyImpl extends EObjectImpl implements Property {
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PropertiesPackage.PROPERTY__ITEM, newItem, newItem));
}
public void setParentItem(Item newItem) {
Item oldItem = parentItem;
parentItem = newItem;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PropertiesPackage.PROPERTY__PARENT_ITEM, oldItem, newItem));
}
/**
* <!-- begin-user-doc -->

View File

@@ -457,41 +457,7 @@ public class ExportLogsWizardPage extends WizardPage {
for (Entry<Object, Object> en : p.entrySet()) {
sb.append(en.getKey() + "=" + en.getValue() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
}
StringBuffer processedData = processSensitiveDataHidden(sb.toString());
writeToFile(dest, ".sysConfig", processedData); //$NON-NLS-1$
}
private StringBuffer processSensitiveDataHidden(String data) {
StringBuffer processedData = new StringBuffer();
while (true) {
String line;
int index = data.indexOf("\n");
if (index == -1) {
line = data.toString();
String processedLine = line;
int equalsIndex = line.indexOf('=');
if (equalsIndex != -1) {
String key = line.substring(0, equalsIndex).trim();
if (key.toLowerCase().contains("password")) {
processedLine = key + "=" + "***";
}
}
processedData.append(processedLine);
break;
}
line = data.substring(0, index);
String processedLine = line;
int equalsIndex = line.indexOf('=');
if (equalsIndex != -1) {
String key = line.substring(0, equalsIndex).trim();
if (key.toLowerCase().contains("password")) {
processedLine = key + "=" + "***";
}
}
processedData.append(processedLine).append("\n");
data = data.substring(index + 1);
}
return processedData;
writeToFile(dest, ".sysConfig", sb); //$NON-NLS-1$
}
private void writeToFile(File dest, String fileName, StringBuffer sb) {

View File

@@ -22,7 +22,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.talend.commons.runtime.utils.io.FileCopyUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.process.JobInfo;
import org.talend.core.model.process.ProcessUtils;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.runtime.process.ITalendProcessJavaProject;
import org.talend.core.runtime.repository.build.IBuildResourcesProvider;
@@ -71,9 +70,6 @@ public class SyncChildrenContextsResourcesProvider implements IBuildResourcesPro
final IFolder mainResourcesFolder = processJavaProject.getExternalResourcesFolder();
final File targetFolder = mainResourcesFolder.getLocation().toFile();
dependenciesItems.stream().filter(jobInfo -> !jobInfo.isJoblet()).map(JobInfo::getProcessItem).forEach(item -> {
if (ProcessUtils.isRoutelet(item.getProperty())) {
item.getProperty().setParentItem(processItem);
}
ITalendProcessJavaProject childJavaProject = runProcessService.getTalendJobJavaProject(item.getProperty());
if (childJavaProject != null) {
final IFolder childResourcesFolder = childJavaProject.getExternalResourcesFolder();

View File

@@ -22,7 +22,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.talend.commons.runtime.utils.io.FileCopyUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.process.JobInfo;
import org.talend.core.model.process.ProcessUtils;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.runtime.process.ITalendProcessJavaProject;
import org.talend.core.runtime.repository.build.IBuildResourcesProvider;
@@ -68,9 +67,6 @@ public class SyncChildrenSourceCodeProvider implements IBuildResourcesProvider {
final File targetFolder = mainSrcFolder.getLocation().toFile();
dependenciesItems.stream().filter(jobInfo -> !jobInfo.isJoblet()).map(JobInfo::getProcessItem).forEach(item -> {
if (ProcessUtils.isRoutelet(item.getProperty())) {
item.getProperty().setParentItem(processItem);
}
ITalendProcessJavaProject childJavaProject = runProcessService.getTalendJobJavaProject(item.getProperty());
if (childJavaProject != null) {
final IFolder childSrcFolder = childJavaProject.getSrcFolder();

View File

@@ -22,7 +22,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.talend.commons.runtime.utils.io.FileCopyUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.process.JobInfo;
import org.talend.core.model.process.ProcessUtils;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.runtime.process.ITalendProcessJavaProject;
import org.talend.core.runtime.repository.build.IBuildResourcesProvider;
@@ -66,9 +65,6 @@ public class SyncChildrenTestReportsProvider implements IBuildResourcesProvider
if (jobInfo.isJoblet()) {
continue;
}
if (ProcessUtils.isRoutelet(jobInfo.getProcessItem().getProperty())) {
jobInfo.getProcessItem().getProperty().setParentItem(processItem);
}
ITalendProcessJavaProject childJavaProject = runProcessService
.getTalendJobJavaProject(jobInfo.getProcessItem().getProperty());
if (childJavaProject != null) {

View File

@@ -5,5 +5,4 @@ bin.includes = META-INF/,\
schema/,\
plugin.xml,\
OSGI-INF/,\
repository/,\
icons/

View File

@@ -9,196 +9,4 @@
</parent>
<artifactId>org.talend.updates.runtime</artifactId>
<packaging>eclipse-plugin</packaging>
<dependencies>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<exclusions>
<exclusion>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-cipher</artifactId>
</exclusion>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
<!-- for TUP-39614 -->
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit4</artifactId>
<version>2.22.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
<version>1.7.1</version>
</dependency>
<!-- TUP-39924 start-->
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>1.2</version>
</dependency>
<!-- TUP-39924 end -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>${project.basedir}/repository</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${project.basedir}/tmp</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies-jar</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/tmp</outputDirectory>
<includeScope>runtime</includeScope>
<useRepositoryLayout>true</useRepositoryLayout>
<addParentPoms>true</addParentPoms>
<copyPom>true</copyPom>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-artifact</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.9.3</version>
<type>pom</type>
<overWrite>false</overWrite>
<outputDirectory>${project.basedir}/tmp/org/junit/junit-bom/5.9.3</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.7.2</version>
<type>pom</type>
<overWrite>false</overWrite>
<outputDirectory>${project.basedir}/tmp/org/junit/junit-bom/5.7.2</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.apache.maven</groupId>
<artifactId>maven-bom</artifactId>
<version>4.0.0-alpha-5</version>
<type>pom</type>
<overWrite>false</overWrite>
<outputDirectory>${project.basedir}/tmp/org/apache/maven/maven-bom/4.0.0-alpha-5</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-io</artifactId>
<version>3.2.0</version>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.basedir}/tmp/org/codehaus/plexus/plexus-io/3.2.0</outputDirectory>
</artifactItem>
</artifactItems>
<outputDirectory>${project.basedir}/tmp</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>zip-maven-repository</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<zip destfile="${project.basedir}/repository/maven_repository.zip" basedir="${project.basedir}/tmp/" />
<delete dir="${project.basedir}/tmp/" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,2 +0,0 @@
*.zip
*.properties

View File

@@ -1,124 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2023 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.updates.runtime.maven;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ILibraryManagerService;
import org.talend.core.model.utils.BaseComponentInstallerTask;
import org.talend.core.model.utils.ComponentGAV;
import org.talend.core.nexus.TalendMavenResolver;
import org.talend.core.runtime.maven.MavenArtifact;
import org.talend.designer.maven.model.TalendMavenConstants;
import org.talend.designer.maven.utils.PomUtil;
import org.talend.updates.runtime.UpdatesRuntimePlugin;
import org.talend.utils.files.FileUtils;
public class M2repoBaseInstaller extends BaseComponentInstallerTask {
private static final String PLUGIN_GROUP = "org.talend.studio";
private static final String SYS_PROP_M2 = "m2.update";
protected boolean updateM2() {
String prop = System.getProperty(SYS_PROP_M2, "true");
return Boolean.valueOf(prop);
}
@Override
public boolean needInstall() {
if (this.updateM2()) {
return true;
}
ComponentGAV gav = this.getPluginGAV();
ILibraryManagerService librairesManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
if (librairesManagerService != null) {
File f = librairesManagerService.resolveStatusLocally(gav.toMavenUri());
if (f == null) {
return true;
}
}
return false;
}
@Override
public boolean install(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
boolean ret = super.install(monitor);
if (ret) {
// install pom
File tempFolder = FileUtils.createTmpFolder("generate", "pom");
ComponentGAV gav = this.getPluginGAV();
MavenArtifact art = new MavenArtifact();
art.setGroupId(gav.getGroupId());
art.setArtifactId(gav.getArtifactId());
art.setVersion(gav.getVersion());
art.setType(gav.getType());
try {
String pomPath = PomUtil.generatePomInFolder(tempFolder, art);
TalendMavenResolver.upload(art.getGroupId(), art.getArtifactId(), art.getClassifier(), TalendMavenConstants.PACKAGING_POM, art.getVersion(), new File(pomPath));
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
return ret;
}
@Override
protected String getMonitorText() {
ComponentGAV gav = this.getPluginGAV();
return gav.getArtifactId();
}
protected ComponentGAV getPluginGAV() {
Bundle bundle = FrameworkUtil.getBundle(getInstallerClass());
String[] bundleName = bundle.getSymbolicName().split("\\.");
String artifactId = bundleName[bundleName.length - 1];
if (bundleName.length > 1) {
artifactId = bundleName[bundleName.length - 2] + "-" + bundleName[bundleName.length - 1];
}
ComponentGAV gav = new ComponentGAV();
gav.setGroupId(PLUGIN_GROUP);
gav.setArtifactId(artifactId);
gav.setVersion(bundle.getVersion().toString());
gav.setType(TalendMavenConstants.PACKAGING_POM);
return gav;
}
@Override
protected Class<? extends BaseComponentInstallerTask> getInstallerClass() {
return M2repoBaseInstaller.class;
}
}

View File

@@ -17,19 +17,17 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.codehaus.plexus.util.FileUtils;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.resource.FileExtensions;
import org.talend.core.nexus.ArtifactRepositoryBean;
import org.talend.core.runtime.util.SharedStudioUtils;
import org.talend.core.service.IUpdateService;
import org.talend.updates.runtime.engine.component.InstallComponentMessages;
import org.talend.updates.runtime.engine.factory.ComponentsLocalNexusInstallFactory;
import org.talend.updates.runtime.maven.M2repoBaseInstaller;
import org.talend.updates.runtime.maven.MavenRepoSynchronizer;
import org.talend.updates.runtime.model.ExtraFeature;
import org.talend.updates.runtime.model.FeatureCategory;
@@ -160,17 +158,5 @@ public class UpdateService implements IUpdateService {
public boolean updateArtifactsFileSha256Hex(IProgressMonitor monitor, String studioArtifactsFileShaCodeHex) {
return SharedStudioPatchInfoProvider.getInstance().updateArtifactsFileSha256Hex(studioArtifactsFileShaCodeHex);
}
/**
* Check and install components
*/
public void installComponents(IProgressMonitor monitor) {
M2repoBaseInstaller installer = new M2repoBaseInstaller();
try {
installer.install(monitor);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}