Compare commits

..

2 Commits

Author SHA1 Message Date
bhe-talendbj
4d97f7c57c fix(TUP-34105): upgrade log4j2 to 2.16.0 (#4870) 2021-12-15 15:32:08 +08:00
bhe-talendbj
e14b1e769e fix(TUP-34105): upgrade log4j2 (#4853) (#4866)
* fix(TUP-34105): upgrade log4j2

* fix(TUP-34105): upgrade log4j2

* fix(TUP-34105): revert to 2.15.0
2021-12-15 10:41:08 +08:00
89 changed files with 372 additions and 2428 deletions

View File

@@ -65,7 +65,7 @@ Module.view.download.external.modules.action.text=Download external modules
Module.view.download.external.modules.action.description=Download external modules
download.external.dialog.title=The following modules are not yet installed. Please download and install all required modules.
download.external.dialog.desciption=List of modules to be downloaded automatically or imported manually.
download.external.dialog.help.url=https://document-link.us.cloud.talend.com/ts_ig_install-external-modules?version=73&lang=en&env=prd
download.external.dialog.help.url=https://help.talend.com/display/KB/How+to+install+external+modules+in+the+Talend+products
AcceptModuleLicensesWizard.title=Download external modules
AcceptModuleLicensesWizardDialog.button.acceptAll=Accept all
AcceptModuleLicensesWizardDialog.cancelConfirmation.title=Confirmation

View File

@@ -1136,7 +1136,7 @@ DatabaseForm.hc.link.none=None
DatabaseForm.hc.link.repository=Repository
DatabaseForm.hc.link.title=Hadoop Cluster
DatabaseForm.checkFileExist=The file {0} is invalid or doesn't exist
DatabaseForm.helpInfo.installDriverLink.url=https://document-link.us.cloud.talend.com/ts_ig_install-external-modules?version=73&lang=en&env=prd
DatabaseForm.helpInfo.installDriverLink.url=https://help.talend.com/pages/viewpage.action?pageId=14230347
DatabaseForm.helpInfo.installDriverLink.label=How to install a driver
SelectorTableForm.toolTip=Not available with this database
FileStep1.modeButText=Read excel2007 file format(xlsx)

View File

@@ -95,10 +95,11 @@
<version>2.12.0</version>
</dependency>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
</dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<type>bundle</type>
</dependency>
</dependencies>
<build>

View File

@@ -57,8 +57,6 @@ public class CommonsPlugin implements BundleActivator {
// TESB-17856: For commandline builds ESB Micorservice bundle
private static boolean isESBMicorservice = false;
private static Boolean isJunitWorking;
private static ServiceTracker proxyTracker;
public static boolean isWorkbenchCreated() {
@@ -125,35 +123,6 @@ public class CommonsPlugin implements BundleActivator {
return "org.talend.rcp.branding.tuj.product".equals(Platform.getProduct().getId()); //$NON-NLS-1$
}
public static boolean isJunitWorking() {
if (isJunitWorking == null) {
try {
String[] args = Platform.getCommandLineArgs();
String applicationId = null;
for (int i = 0; i < args.length - 1; i++) {
if (args[i].equalsIgnoreCase("-application")) { //$NON-NLS-1$
applicationId = args[i + 1];
}
}
if (applicationId != null
&& (applicationId.equals("org.eclipse.swtbot.eclipse.junit.headless.swtbottestapplication") //$NON-NLS-1$
|| applicationId.equals("org.eclipse.pde.junit.runtime.uitestapplication"))) { //$NON-NLS-1$
isJunitWorking = true;
} else {
isJunitWorking = false;
}
} catch (Throwable e) {
isJunitWorking = false;
}
}
if (isJunitWorking == null) {
isJunitWorking = false;
}
return isJunitWorking;
}
/**
* Answer the file associated with name. This handles the case of running as a plugin and running standalone which
* happens during testing.

View File

@@ -142,7 +142,6 @@ import org.talend.core.runtime.util.ItemDateParser;
import org.talend.core.runtime.util.SharedStudioUtils;
import org.talend.core.service.ICoreUIService;
import org.talend.core.service.IUpdateService;
import org.talend.core.service.IDetectCVEService;
import org.talend.core.utils.CodesJarResourceCache;
import org.talend.cwm.helper.SubItemHelper;
import org.talend.cwm.helper.TableHelper;
@@ -2468,15 +2467,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
if (runProcessService != null) {
runProcessService.clearProjectRelatedSettings();
}
// clear detect CVE cache
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDetectCVEService.class)) {
IDetectCVEService detectCVESvc = GlobalServiceRegister.getDefault().getService(IDetectCVEService.class);
if (detectCVESvc != null) {
detectCVESvc.clearCache();
}
}
ReferenceProjectProvider.clearTacReferenceList();
ReferenceProjectProblemManager.getInstance().clearAll();
fullLogonFinished = false;

View File

@@ -21,7 +21,6 @@ import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.RetrieveResult;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.nexus.ArtifactRepositoryBean;
import org.talend.core.nexus.TalendLibsServerManager;
@@ -78,8 +77,6 @@ public interface ILibraryManagerService extends IService {
public void saveMavenIndex(Map<String, String> libsToMavenUri, IProgressMonitor... monitorWrap);
public void createModulesIndexFromComponentAndExtension(IProgressMonitor... monitorWrap);
public Map<String,String> buildModulesIndexFromComponentAndExtension(IProgressMonitor... monitorWrap);
/**
* DOC ycbai Comment method "retrieve".
@@ -110,8 +107,6 @@ public interface ILibraryManagerService extends IService {
public boolean retrieve(ModuleNeeded module, String pathToStore, boolean showDialog, IProgressMonitor... monitorWrap);
RetrieveResult retrieveModules(ERepositoryObjectType codeType, Set<ModuleNeeded> modulesNeeded, String pathToStore,
boolean showDialog, IProgressMonitor... monitorWrap);
/**
*
* Resolve the jar from custom nexus

View File

@@ -58,7 +58,7 @@ public enum EDatabaseVersion4Drivers {
HSQLDB_SERVER(new DbVersion4Drivers(EDatabaseTypeName.HSQLDB_SERVER, "hsqldb.jar")), //$NON-NLS-1$
HSQLDB_WEBSERVER(new DbVersion4Drivers(EDatabaseTypeName.HSQLDB_WEBSERVER, "hsqldb.jar")), //$NON-NLS-1$
H2(new DbVersion4Drivers(EDatabaseTypeName.H2, "h2-2.1.210.jar")), //$NON-NLS-1$
H2(new DbVersion4Drivers(EDatabaseTypeName.H2, "h2-1.4.198.jar")), //$NON-NLS-1$
//
JAVADB_EMBEDED(new DbVersion4Drivers(EDatabaseTypeName.JAVADB_EMBEDED, "derby.jar")), //$NON-NLS-1$
@@ -71,10 +71,9 @@ public enum EDatabaseVersion4Drivers {
INFORMIX(new DbVersion4Drivers(EDatabaseTypeName.INFORMIX, "ifxjdbc.jar")), //$NON-NLS-1$
SAS_9_1(new DbVersion4Drivers(EDatabaseTypeName.SAS, "SAS 9.1", "SAS_9.1", new String[] { "sas.core.jar", //$NON-NLS-1$
"sas.intrnet.javatools.jar", "sas.svc.connection.jar", "reload4j-1.2.19.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
"sas.intrnet.javatools.jar", "sas.svc.connection.jar", "org.apache.log4j_1.2.15.v201012070815.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
SAS_9_2(new DbVersion4Drivers(EDatabaseTypeName.SAS,
"SAS 9.2", "SAS_9.2", //$NON-NLS-1$ //$NON-NLS-2$
new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar", "reload4j-1.2.19jar" })),
"SAS 9.2", "SAS_9.2", new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar", "org.apache.log4j_1.2.15.v201012070815.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
SAPHana(new DbVersion4Drivers(EDatabaseTypeName.SAPHana, "HDB 1.0", "HDB_1_0", "ngdbc.jar")), //$NON-NLS-1$
// MYSQL, add for 9594
MYSQL_8(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 8", "MYSQL_8", "mysql-connector-java-8.0.18.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -88,7 +87,7 @@ 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.6.jar", "oauth2-oidc-sdk-9.7.jar",
"json-smart-2.4.7.jar", "nimbus-jose-jwt-9.22.jar", "javax.mail-1.6.2.jar", "reload4j-1.2.19.jar",
"json-smart-2.4.7.jar", "nimbus-jose-jwt-8.11.jar", "javax.mail-1.6.2.jar", "log4j-1.2.17.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$
@@ -107,12 +106,12 @@ public enum EDatabaseVersion4Drivers {
GREENPLUM_PSQL(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM,"PostgreSQL", "POSTGRESQL", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$
GREENPLUM(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM,"Greenplum", "GREENPLUM", "greenplum-5.1.4.000275.jar")), //$NON-NLS-1$
// PSQL_V10(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v10", "V10", "postgresql-42.2.5.jar")),
PSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v9 and later", "V9_X", "postgresql-42.2.25.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v9 and later", "V9_X", "postgresql-42.2.14.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PSQL_PRIOR_TO_V9(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "Prior to v9", "PRIOR_TO_V9", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PLUSPSQL_PRIOR_TO_V9(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL,
"Prior to v9", "PRIOR_TO_V9", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PLUSPSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL, "v9 and later", "V9_X", "postgresql-42.2.25.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PLUSPSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL, "v9 and later", "V9_X", "postgresql-42.2.14.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
IBMDB2(new DbVersion4Drivers(EDatabaseTypeName.IBMDB2, new String[] { "db2jcc4.jar", "db2jcc_license_cu.jar", //$NON-NLS-1$ //$NON-NLS-2$
"db2jcc_license_cisuz.jar" })), //$NON-NLS-1$
IBMDB2ZOS(new DbVersion4Drivers(EDatabaseTypeName.IBMDB2ZOS, new String[] { "db2jcc4.jar", "db2jcc_license_cu.jar", //$NON-NLS-1$ //$NON-NLS-2$
@@ -169,9 +168,9 @@ public enum EDatabaseVersion4Drivers {
MAPRDB(new DbVersion4Drivers(EDatabaseTypeName.MAPRDB, new String[] {})),
REDSHIFT(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT, "redshift", "REDSHIFT", //$NON-NLS-1$ //$NON-NLS-2$
new String[]{ "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
"redshift-jdbc42-no-awssdk-1.2.37.1061.jar")), //$NON-NLS-1$
REDSHIFT_SSO(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT_SSO, "redshift sso", "REDSHIFT_SSO", //$NON-NLS-1$ //$NON-NLS-2$
new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar", "aws-java-sdk-1.11.848.jar", "jackson-core-2.10.1.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
new String[] { "redshift-jdbc42-no-awssdk-1.2.37.1061.jar", "aws-java-sdk-1.11.848.jar", "jackson-core-2.10.1.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"jackson-databind-2.10.1.jar", "jackson-annotations-2.10.1.jar", "httpcore-4.4.11.jar", "httpclient-4.5.9.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
"joda-time-2.8.1.jar", "commons-logging-1.2.jar", "commons-codec-1.11.jar" })), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

View File

@@ -14,14 +14,12 @@ package org.talend.core.model.general;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.runtime.Path;
import org.osgi.framework.Version;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ILibraryManagerService;
import org.talend.core.database.conn.version.DatabaseDriversCache;
@@ -31,9 +29,6 @@ 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.utils.TalendQuoteUtils;
import org.talend.utils.json.JSONException;
import org.talend.utils.json.JSONObject;
import org.talend.utils.json.JSONTokener;
/**
* This bean is use to manage needed moduless (perl) and libraries (java).<br/>
@@ -43,10 +38,6 @@ import org.talend.utils.json.JSONTokener;
*/
public class ModuleNeeded {
public static final String ATTR_USED_BY_DYNAMIC_DISTRIBUTION = "dynamicDistribution";
public static final String ATTR_DYNAMIC_DISTRIBUTION_VERSION = "distributionVersion";
private String id;
private String context;
@@ -103,11 +94,8 @@ public class ModuleNeeded {
*/
private boolean useReleaseVersion = false;
private Map<String, String> attributes;
ILibraryManagerService libManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault()
.getService(ILibraryManagerService.class);
/**
* DOC smallet ModuleNeeded class global comment. Detailled comment <br/>
@@ -174,10 +162,6 @@ public class ModuleNeeded {
this.required = required;
this.installURL = installURL;
this.requiredIf = requiredIf;
this.attributes = analyseMessage(informationMsg);
if (!this.attributes.isEmpty()) {
this.informationMsg = "";
}
String name = moduleName;
String uri = mavenUrl;
if (moduleName != null) {
@@ -200,32 +184,6 @@ public class ModuleNeeded {
setMavenUri(uri);
}
private Map<String, String> analyseMessage(String msg) {
Map<String, String> attrMap = new HashMap<>();
if (StringUtils.isBlank(msg) || !msg.startsWith("{") || !msg.endsWith("}")) {
return attrMap;
}
try {
JSONObject jo = new JSONObject(new JSONTokener(msg));
Iterator<String> keys = jo.keys();
keys.forEachRemaining(key -> {
try {
Object object = jo.get(key);
if (object != null) {
attrMap.put(key, object.toString());
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
});
} catch (Exception e) {
if (Boolean.getBoolean("talend.studio.moduleNeeded.init.debug")) {
ExceptionHandler.process(e);
}
}
return attrMap;
}
@Override
public ModuleNeeded clone() {
ModuleNeeded cloned = new ModuleNeeded(context, moduleName, informationMsg, mrRequired, installURL, requiredIf, mavenUri);
@@ -254,7 +212,6 @@ public class ModuleNeeded {
cloned.requiredIf = requiredIf;
cloned.status = status;
cloned.useReleaseVersion = useReleaseVersion;
cloned.attributes = attributes;
return cloned;
}
@@ -714,10 +671,6 @@ public class ModuleNeeded {
}
}
public boolean usedByDynamicDistribution() {
return Boolean.valueOf(attributes.get(ATTR_USED_BY_DYNAMIC_DISTRIBUTION));
}
public boolean isDynamic() {
return this.dynamic;
}
@@ -756,12 +709,5 @@ public class ModuleNeeded {
public void setUseReleaseVersion(boolean useReleaseVersion) {
this.useReleaseVersion = useReleaseVersion;
}
public String getDynamicDistributionVersion() {
return attributes.get(ATTR_DYNAMIC_DISTRIBUTION_VERSION);
}
public void setDynamicDistributionVersion(String distribution) {
attributes.put(ATTR_DYNAMIC_DISTRIBUTION_VERSION, distribution);
}
}

View File

@@ -1,42 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2022 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.general;
import java.util.HashSet;
import java.util.Set;
public class RetrieveResult {
private boolean allResolved;
private Set<ModuleNeeded> resovledModules = new HashSet<>();
private Set<ModuleNeeded> unresolvedModules = new HashSet<>();
public boolean isAllResolved() {
return allResolved;
}
public void setAllResolved(boolean allResolved) {
this.allResolved = allResolved;
}
public Set<ModuleNeeded> getResovledModules() {
return resovledModules;
}
public Set<ModuleNeeded> getUnresolvedModules() {
return unresolvedModules;
}
}

View File

@@ -69,8 +69,6 @@ public interface IMetadataTable {
public boolean sameMetadataAs(IMetadataTable other, int options);
public boolean sameMetadataAs(List<IMetadataColumn> otherMetadataTableColumns, int options);
public void sortCustomColumns();
public boolean isReadOnly();

View File

@@ -252,13 +252,8 @@ public class MetadataTable implements IMetadataTable, Cloneable {
if (!(input instanceof IMetadataTable)) {
return false;
}
List<IMetadataColumn> inputColumnListWithUnselected = input.getListColumns(true);
return sameMetadataAs(inputColumnListWithUnselected, options);
}
@Override
public boolean sameMetadataAs(List<IMetadataColumn> inputColumnListWithUnselected, int options) {
List<IMetadataColumn> thisColumnListWithUnselected = this.getListColumns(true);
List<IMetadataColumn> inputColumnListWithUnselected = input.getListColumns(true);
if (thisColumnListWithUnselected == null) {
if (inputColumnListWithUnselected != null) {
return false;
@@ -300,6 +295,9 @@ public class MetadataTable implements IMetadataTable, Cloneable {
// no matter if this one is custom or not (all custom must be propagated too)
for (int i = 0; i < inputColumnListWithUnselected.size(); i++) {
IMetadataColumn inputColumn = inputColumnListWithUnselected.get(i);
if(inputColumn.isCustom()) {
continue;
}
IMetadataColumn myColumn = this.getColumn(inputColumn.getLabel());
outputColumnsNotTested.remove(myColumn);
if (!inputColumn.sameMetacolumnAs(myColumn, options)) {

View File

@@ -139,8 +139,4 @@ public enum EParameterFieldType {
}
return TEXT; // Default Value
}
public static boolean isPassword(EParameterFieldType type) {
return EParameterFieldType.PASSWORD.equals(type) || EParameterFieldType.LICENSEKEY.equals(type);
}
}

View File

@@ -58,11 +58,6 @@ public interface IProcess extends IElement {
public static final String SCREEN_OFFSET_Y = "SCREEN_OFFSET_Y"; //$NON-NLS-1$
public static final String PROP_ERR_ON_COMPONENT_MISSING = "error.on.component.missing";
public static final boolean ERR_ON_COMPONENT_MISSING = Boolean
.valueOf(System.getProperty(PROP_ERR_ON_COMPONENT_MISSING, Boolean.TRUE.toString()));
public String getName();
public String getId();

View File

@@ -1086,18 +1086,6 @@ public final class ProcessUtils {
}
}
}
if ("cHttp".equals(node.getComponentName())) {
for (Object elementParameter : node.getElementParameter()) {
ElementParameterType elementParameterType = (ElementParameterType)elementParameter;
String name = elementParameterType.getName();
String value = elementParameterType.getValue();
if ("SERVER".equals(name) && (value != null && "true".equals(value.toString()))) {
return true;
}
}
}
}
return false;

View File

@@ -2023,8 +2023,8 @@ public abstract class RepositoryUpdateManager {
};
repositoryUpdateManager.checkAddContextGroup = detectAddContextGroup;
repositoryUpdateManager.isConfigContextGroup = repositoryContextManager.isConfigContextGroup();
if (repositoryContextManager != null) {
repositoryUpdateManager.isConfigContextGroup = repositoryContextManager.isConfigContextGroup();
// add for bug 9119 context group
Map<ContextItem, List<IContext>> repositoryContextGroupMap = new HashMap<ContextItem, List<IContext>>();
List<IContext> addGroupContext = repositoryContextManager.getAddGroupContext();

View File

@@ -310,8 +310,8 @@ public enum UpdateManagerProviderDetector {
Item item = node.getObject().getProperty().getItem();
List<Relation> allRelations = new ArrayList<Relation>();
if (node.getObject() != null) {
List<Relation> relations = RelationshipItemBuilder.getInstance().getItemsHaveRelationWith(item.getProperty().getId(),
RelationshipItemBuilder.LATEST_VERSION);
List<Relation> relations = RelationshipItemBuilder.getInstance().getItemsRelatedTo(item.getProperty().getId(),
RelationshipItemBuilder.LATEST_VERSION, RelationshipItemBuilder.PROPERTY_RELATION);
if (relations != null && relations.size() > 0) {
allRelations.addAll(relations);
}

View File

@@ -12,11 +12,6 @@
// ============================================================================
package org.talend.core.runtime.services;
import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.IClasspathEntry;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
import org.talend.core.model.properties.RoutineItem;
@@ -30,10 +25,6 @@ public interface IDesignerMavenService extends IService {
void updateCodeJarMavenProject(CodesJarInfo info, boolean needReSync) throws Exception;
void enableMavenNature(IProgressMonitor monitor, IProject project);
void addProjectClasspathEntry(IProgressMonitor monitor, IProject project, List<IClasspathEntry> entries);
public static IDesignerMavenService get() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerMavenService.class)) {
return GlobalServiceRegister.getDefault().getService(IDesignerMavenService.class);

View File

@@ -133,7 +133,7 @@ public interface IRunProcessService extends IService {
public void updateLibraries(Set<ModuleNeeded> jobModuleList, IProcess process, Set<ModuleNeeded> alreadyRetrievedModules)
throws ProcessorException;
public boolean updateLibraries(Item routineItem);
public void updateLibraries(Item routineItem);
public void refreshView();
@@ -234,8 +234,6 @@ public interface IRunProcessService extends IService {
void clearProjectRelatedSettings();
void clearAllBuildCaches();
void batchDeleteAllVersionTalendJobProject(List<String> idList);
boolean isExportConfig();

View File

@@ -636,7 +636,6 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
visibleItemCount = 20;
}
contextsCombo.setVisibleItemCount(visibleItemCount);
contextsCombo.getParent().getParent().pack();
}
private void checkContextGroupSource() {

View File

@@ -337,6 +337,7 @@ public class ContextTreeTable {
private void attachCheckColumnTip(NatTable nt) {
DefaultToolTip toolTip = new ContextNatTableToolTip(nt);
toolTip.setBackgroundColor(natTable.getDisplay().getSystemColor(7));
toolTip.setPopupDelay(500);
toolTip.activate();
toolTip.setShift(new Point(10, 10));

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/log4j-api-2.17.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/log4j-core-2.17.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry exported="true" kind="lib" path="lib/log4j-api-2.16.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/log4j-core-2.16.0.jar"/>
<classpathentry kind="src" path="src/main/java/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@@ -55,6 +55,6 @@ Export-Package: org.talend.core,
org.talend.core.views,
org.talend.designer.runprocess
Import-Package: org.apache.commons.collections4.map
Bundle-ClassPath: .,
lib/log4j-api-2.17.1.jar,
lib/log4j-core-2.17.1.jar
Bundle-ClassPath: lib/log4j-api-2.16.0.jar,
lib/log4j-core-2.16.0.jar,
.

View File

@@ -13,7 +13,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.1</version>
<version>2.16.0</version>
</dependency>
</dependencies>
<build>

View File

@@ -46,7 +46,6 @@ import org.apache.logging.log4j.core.config.builder.api.RootLoggerComponentBuild
import org.apache.logging.log4j.core.config.builder.impl.BuiltConfiguration;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceDescription;
@@ -57,15 +56,13 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.emf.common.util.EList;
import org.eclipse.jdt.core.IClasspathAttribute;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.ui.IEditorPart;
import org.talend.commons.CommonsPlugin;
import org.talend.commons.exception.CommonExceptionHandler;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.runtime.model.repository.ERepositoryStatus;
import org.talend.commons.runtime.utils.io.FileCopyUtils;
import org.talend.commons.utils.PasswordEncryptUtil;
import org.talend.commons.utils.generation.JavaUtils;
import org.talend.commons.utils.time.TimeMeasure;
@@ -101,7 +98,6 @@ import org.talend.core.model.process.JobInfo;
import org.talend.core.model.process.ProcessUtils;
import org.talend.core.model.process.ReplaceNodesInProcessProvider;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.JobletProcessItem;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.Property;
import org.talend.core.model.relationship.RelationshipItemBuilder;
@@ -123,7 +119,6 @@ import org.talend.core.runtime.process.TalendProcessArgumentConstant;
import org.talend.core.runtime.process.TalendProcessOptionConstants;
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
import org.talend.core.runtime.repository.build.BuildExportManager;
import org.talend.core.runtime.services.IDesignerMavenService;
import org.talend.core.service.IResourcesDependenciesService;
import org.talend.core.services.ICoreTisService;
import org.talend.core.services.ISVNProviderService;
@@ -707,7 +702,6 @@ public class ProcessorUtilities {
processor.setArguments(argumentsMap);
handelDQComponents(selectedProcessItem, currentProcess);
// generate the code of the father after the childrens
// so the code won't have any error during the check, and it will help to check
// if the generation is really needed.
@@ -723,8 +717,6 @@ public class ProcessorUtilities {
*/
generateBuildInfo(jobInfo, progressMonitor, isMainJob, currentProcess, currentJobName, processor, option);
checkNeedExportItemsForDQ(currentProcess);
copyDependenciedResources(currentProcess, progressMonitor);
return processor;
@@ -1270,8 +1262,6 @@ public class ProcessorUtilities {
generateBuildInfo(jobInfo, progressMonitor, isMainJob, currentProcess, currentJobName, processor, option);
TimeMeasure.step(idTimer, "generateBuildInfo");
checkNeedExportItemsForDQ(currentProcess);
copyDependenciedResources(currentProcess, progressMonitor);
return processor;
@@ -1285,6 +1275,39 @@ public class ProcessorUtilities {
}
}
private static void syncContextResourcesForParentJob(IProcess currentProcess, IProgressMonitor progressMonitor) {
ITalendProcessJavaProject processJavaProject = mainJobInfo.getProcessor().getTalendJavaProject();
final IFolder mainResourcesFolder = processJavaProject.getExternalResourcesFolder();
final File targetFolder = mainResourcesFolder.getLocation().toFile();
final Set<JobInfo> dependenciesItems = mainJobInfo.getProcessor().getBuildChildrenJobs();
final IRunProcessService runProcessService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(
IRunProcessService.class);
List<ProcessItem> dependenciesItemsFiltered = dependenciesItems.stream().filter(jobInfo -> !jobInfo.isJoblet())
.map(JobInfo::getProcessItem).collect(Collectors.toList());
if (dependenciesItemsFiltered.size() > 0) {
dependenciesItemsFiltered.forEach(item -> {
ITalendProcessJavaProject childJavaProject = runProcessService.getTalendJobJavaProject(item.getProperty());
if (childJavaProject != null) {
final IFolder childResourcesFolder = childJavaProject.getExternalResourcesFolder();
if (childResourcesFolder.exists()) {
FileCopyUtils.syncFolder(childResourcesFolder.getLocation().toFile(), targetFolder, false);
}
}
});
try {
mainResourcesFolder.refreshLocal(IResource.DEPTH_INFINITE, progressMonitor);
} catch (CoreException e) {
ExceptionHandler.process(e);
}
}
}
private static Set<ModuleNeeded> getAllJobTestcaseModules(ProcessItem selectedProcessItem) {
Set<ModuleNeeded> neededLibraries = new HashSet<>();
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
@@ -1359,34 +1382,10 @@ public class ProcessorUtilities {
}
/**
* if the job includes tdqReportRun, set 'needExportItemsForDQ'to true so as the item folder can be exported
*
* @param processItem
* @param currentProcess
*/
private static void checkNeedExportItemsForDQ(IProcess currentProcess) {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQItemService.class)) {
ITDQItemService tdqItemService =
GlobalServiceRegister.getDefault().getService(ITDQItemService.class);
// TDQ-19637 if it includes 'tDqReportRun',must export item folder
if (tdqItemService != null && !needExportItemsForDQ) {
for (INode node : currentProcess.getGeneratingNodes()) {
String componentName = node.getComponent().getName();
if ("tDqReportRun".equals(componentName)) {
needExportItemsForDQ = true;
break;
}
}
}
}
}
/**
*
* Specail operation for DQ components:
* - For tRuleSurvivorship, copy the current item's drools file from 'workspace/metadata/survivorship' to
* '.Java/src/resources'
*
*
* Specail operation for DQ components:
* - For tdqReportRun, set 'needExportItemsForDQ'to true so as the item folder can be exported
* - For tRuleSurvivorship, copy the current item's drools file from 'workspace/metadata/survivorship' to '.Java/src/resources'
* @param processItem
*/
private static void handelDQComponents(ProcessItem processItem,IProcess currentProcess) {
@@ -1401,7 +1400,17 @@ public class ProcessorUtilities {
return;
}
try {
/* 1.TDQ-12474 copy the "metadata/survivorship/rulePackage" to ".Java/src/main/resources/". so that it will be
// TDQ-19637 if it includes 'tDqReportRun',must export item folder
if (!needExportItemsForDQ) {
for (INode node : currentProcess.getGeneratingNodes()) {
String componentName = node.getComponent().getName();
if ("tDqReportRun".equals(componentName)) {
needExportItemsForDQ = true;
break;
}
}
}
/* 1.TDQ-12474 copy the "metadata/survivorship/rulePackage" to ".Java/src/main/resources/". so that it will be
used by maven command 'include-survivorship-rules' to export.
2.TDQ-14308 current drools file in 'src/resourcesmetadata/survivorship/' should be included to job jar.
*/
@@ -1505,6 +1514,7 @@ public class ProcessorUtilities {
}
}
}
syncContextResourcesForParentJob(currentProcess, progressMonitor);
}
/**
@@ -1560,7 +1570,6 @@ public class ProcessorUtilities {
}
jobInfo.setProcessItem(null);
if (!BitwiseOptionUtils.containOption(option, GENERATE_MAIN_ONLY)) {
List<JobInfo> firstSubjobs = new ArrayList<JobInfo>();
// handle subjob in joblet. see bug 004937: tRunJob in a Joblet
for (INode node : currentProcess.getGeneratingNodes()) {
String componentName = node.getComponent().getName();
@@ -1649,8 +1658,6 @@ public class ProcessorUtilities {
if (!BitwiseOptionUtils.containOption(option, GENERATE_WITH_FIRST_CHILD)) {
currentProcess.setNeedRegenerateCode(true);
} else {
firstSubjobs.add(subJobInfo);
}
}
@@ -1659,9 +1666,6 @@ public class ProcessorUtilities {
}
}
}
if (BitwiseOptionUtils.containOption(option, GENERATE_WITH_FIRST_CHILD)) {
handleGenerateFirstChildOnlyClasspath(progressMonitor, jobInfo, firstSubjobs);
}
}
}
@@ -1671,32 +1675,6 @@ public class ProcessorUtilities {
jobInfo.setIncludeESBFlag(includeESBFlag);
}
private static void handleGenerateFirstChildOnlyClasspath(IProgressMonitor progressMonitor, JobInfo jobInfo,
List<JobInfo> subjobInfoList) {
IDesignerMavenService mavenService = IDesignerMavenService.get();
if (mavenService == null || jobInfo == null || subjobInfoList.isEmpty()) {
return;
}
List<IClasspathEntry> classpathEntries = new ArrayList<IClasspathEntry>();
for (JobInfo subJobInfo : subjobInfoList) {
if (subJobInfo.getProcessor() != null) {
IProject codeProject = subJobInfo.getProcessor().getCodeProject();
if (codeProject != null) {
mavenService.enableMavenNature(progressMonitor, codeProject);
IClasspathEntry classpathEntry = JavaCore.newSourceEntry(codeProject.getFullPath(), new IPath[0],
new IPath[0], null, new IClasspathAttribute[] {});
classpathEntries.add(classpathEntry);
}
}
}
if (jobInfo.getProcessor() != null) {
IProject codeProject = jobInfo.getProcessor().getCodeProject();
if (codeProject != null) {
mavenService.addProjectClasspathEntry(progressMonitor, codeProject, classpathEntries);
}
}
}
static void setGenerationInfoWithChildrenJob(INode node, JobInfo jobInfo, final JobInfo subJobInfo) {
final LastGenerationInfo generationInfo = LastGenerationInfo.getInstance();
@@ -2070,7 +2048,7 @@ public class ProcessorUtilities {
}
public static IProcessor generateCode(IProcess process, IContext context, boolean statistics, boolean trace,
boolean properties, int option, IProgressMonitor progressMonitor) throws ProcessorException {
boolean properties, int option) throws ProcessorException {
// added by nma, to refresh routines when generating code in SVN mode. 10225.
ISVNProviderService service = null;
if (PluginChecker.isSVNProviderPluginLoaded()) {
@@ -2082,7 +2060,8 @@ public class ProcessorUtilities {
// achen modify to fix 0006107
JobInfo jobInfo = new JobInfo(process, context);
resetBuildFlagsAndCaches();
IProcessor genCode = generateCode(jobInfo, context.getName(), statistics, trace, properties, option, progressMonitor);
IProcessor genCode = generateCode(jobInfo, context.getName(), statistics, trace, properties, option,
new NullProgressMonitor());
resetBuildFlagsAndCaches();
return genCode;
}
@@ -2540,13 +2519,6 @@ public class ProcessorUtilities {
ExceptionHandler.process(e);
}
}
// TUP-35219 avoid resource unload
if (property != null && property.getItem() != null
&& property.getItem() instanceof JobletProcessItem) {
((JobletProcessItem) property.getItem()).getJobletProcess();
}
JobInfo jobInfo = new JobInfo(property, jobletProcess.getDefaultContext());
if (!jobInfos.contains(jobInfo)) {
jobInfos.add(jobInfo);

View File

@@ -23,10 +23,6 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
</exclusion>
<exclusion>
<groupId>org.beanshell</groupId>
<artifactId>bsh</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>

View File

@@ -97,18 +97,7 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
<exclusions>
<exclusion>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>

View File

@@ -19,10 +19,6 @@
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
</exclusion>
</exclusions>
</dependency>

View File

@@ -14,17 +14,6 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
<exclusions>
<exclusion>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.tycho</groupId>

View File

@@ -34,17 +34,6 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
<exclusions>
<exclusion>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
@@ -138,11 +127,6 @@
<artifactId>commons-compress</artifactId>
<version>1.21</version>
</dependency>
<dependency>
<groupId>org.apache-extras.beanshell</groupId>
<artifactId>bsh</artifactId>
<version>2.0b6</version>
</dependency>
</dependencies>
<build>
<plugins>

View File

@@ -14,22 +14,22 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.17.1</version>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.1</version>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.17.1</version>
<version>2.16.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>2.17.1</version>
<version>2.16.0</version>
</dependency>
</dependencies>
<build>

View File

@@ -20,7 +20,7 @@
<module>zip/pom.xml</module>
</modules>
<properties>
<m2.fasterxml.jackson.version>2.13.2</m2.fasterxml.jackson.version>
<jackson-codehaus.version>1.9.16-TALEND</jackson-codehaus.version>
<m2.fasterxml.jackson.version>2.11.4</m2.fasterxml.jackson.version>
<jackson-codehaus.version>1.9.15-TALEND</jackson-codehaus.version>
</properties>
</project>

View File

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

View File

@@ -11,10 +11,9 @@
<packaging>pom</packaging>
<properties>
<tcomp.version>1.38.6</tcomp.version>
<tcomp.version>1.38.3</tcomp.version>
<slf4j.version>1.7.32</slf4j.version>
<log4j2.version>2.17.1</log4j2.version>
<reload4j.version>1.2.19</reload4j.version>
<log4j2.version>2.16.0</log4j2.version>
</properties>
<repositories>
@@ -142,17 +141,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>${reload4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>

View File

@@ -33,7 +33,7 @@
<artifactItem>
<groupId>org.talend.studio</groupId>
<artifactId>studio-maven-repository</artifactId>
<version>7.3.1.v20220325</version>
<version>7.3.1.v20211025</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.basedir}/../repository</outputDirectory>

View File

@@ -206,11 +206,6 @@
<artifactId>commons-codec</artifactId>
<version>1.15</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.3.3</version>
</dependency>
</dependencies>
</plugin>
<plugin>

View File

@@ -12,17 +12,11 @@
// ============================================================================
package org.talend.designer.maven;
import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.IClasspathEntry;
import org.talend.core.model.properties.RoutineItem;
import org.talend.core.model.routines.CodesJarInfo;
import org.talend.core.runtime.services.IDesignerMavenService;
import org.talend.designer.maven.tools.CodesJarM2CacheManager;
import org.talend.designer.maven.utils.CodesJarMavenUtil;
import org.talend.designer.maven.utils.MavenProjectUtils;
public class DesignerMavenService implements IDesignerMavenService {
@@ -41,14 +35,4 @@ public class DesignerMavenService implements IDesignerMavenService {
CodesJarM2CacheManager.updateCodesJarProject(info, needReSync);
}
@Override
public void enableMavenNature(IProgressMonitor monitor, IProject project) {
MavenProjectUtils.enableMavenNature(monitor, project);
}
@Override
public void addProjectClasspathEntry(IProgressMonitor monitor, IProject project, List<IClasspathEntry> entries) {
MavenProjectUtils.addProjectClasspathEntry(monitor, project, entries);
}
}

View File

@@ -14,7 +14,6 @@ package org.talend.designer.maven.tools;
import static org.talend.designer.maven.model.TalendJavaProjectConstants.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.nio.file.Paths;
import java.util.ArrayList;
@@ -25,7 +24,6 @@ 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;
@@ -35,7 +33,6 @@ 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;
@@ -57,7 +54,6 @@ import org.eclipse.m2e.core.MavenPlugin;
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.core.GlobalServiceRegister;
import org.talend.core.IESBService;
import org.talend.core.ILibraryManagerService;
@@ -79,7 +75,6 @@ import org.talend.core.model.routines.CodesJarInfo;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.core.repository.utils.ItemResourceUtil;
import org.talend.core.runtime.CoreRuntimePlugin;
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.ITalendProcessJavaProject;
@@ -147,7 +142,8 @@ public class AggregatorPomsHelper {
public void installRootPom(boolean force) throws Exception {
IFile pomFile = getProjectRootPom();
if (pomFile.exists()) {
if (force || needInstallRootPom(pomFile)) {
Model model = MavenPlugin.getMaven().readModel(pomFile.getLocation().toFile());
if (force || !isPomInstalled(model.getGroupId(), model.getArtifactId(), model.getVersion())) {
MavenPomCommandLauncher launcher =
new MavenPomCommandLauncher(pomFile, TalendMavenConstants.GOAL_INSTALL);
Map<String, Object> argumentsMap = new HashMap<>();
@@ -159,40 +155,9 @@ public class AggregatorPomsHelper {
}
}
public boolean needInstallRootPom(IFile pomFile) {
try {
Model model = MavenPlugin.getMaven().readModel(pomFile.getLocation().toFile());
String mvnUrl = MavenUrlHelper.generateMvnUrl(model.getGroupId(), model.getArtifactId(), model.getVersion(),
MavenConstants.PACKAGING_POM, null);
MavenArtifact artifact = MavenUrlHelper.parseMvnUrl(mvnUrl);
if (artifact != null) {
String artifactPath = PomUtil.getAbsArtifactPath(artifact);
if (artifactPath == null) {
return true;
}
Model installedModel = MavenPlugin.getMaven().readModel(new File(artifactPath));
// check ci-builder
String currentCIBuilderVersion = model.getBuild().getPlugins().stream()
.filter(p -> p.getArtifactId().equals(MojoType.CI_BUILDER.getArtifactId())).findFirst().get()
.getVersion();
String installedCIBuilderVersion = installedModel.getBuild().getPlugins().stream()
.filter(p -> p.getArtifactId().equals(MojoType.CI_BUILDER.getArtifactId())).findFirst().get()
.getVersion();
if (!currentCIBuilderVersion.equals(installedCIBuilderVersion)) {
return true;
}
// check signer
String currentSignerVersion = model.getProperties().getProperty(MojoType.SIGNER.getVersionKey());
String installedSignerVersion = installedModel.getProperties().getProperty(MojoType.SIGNER.getVersionKey());
if (!currentSignerVersion.equals(installedSignerVersion)) {
return true;
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
return true;
}
return false;
public boolean isPomInstalled(String groupId, String artifactId, String version) {
String mvnUrl = MavenUrlHelper.generateMvnUrl(groupId, artifactId, version, MavenConstants.PACKAGING_POM, null);
return PomUtil.isAvailable(mvnUrl);
}
public IFolder getProjectPomsFolder() {
@@ -214,36 +179,31 @@ public class AggregatorPomsHelper {
@Override
protected void run() {
Project currentProject = ProjectManager.getInstance().getCurrentProject();
try {
for (ERepositoryObjectType codeType : ERepositoryObjectType.getAllTypesOfCodes()) {
updateCodeProject(monitor, codeType, forceBuild, ignoreM2Cache, buildIfNoUpdate);
ITalendProcessJavaProject codeProject = getCodesProject(codeType);
if (ERepositoryObjectType.ROUTINES == codeType) {
PomUtil.checkExistingLog4j2Dependencies4RoutinePom(projectTechName, codeProject.getProjectPom());
}
if (ignoreM2Cache || CodeM2CacheManager.needUpdateCodeProject(currentProject, codeType)) {
updateCodeProjectPom(monitor, codeType, codeProject.getProjectPom());
MavenProjectUtils.updateMavenProject(monitor, codeProject.getProject());
buildAndInstallCodesProject(monitor, codeType, true, forceBuild);
CodeM2CacheManager.updateCodeProjectCache(currentProject, codeType);
} else if (buildIfNoUpdate) {
buildAndInstallCodesProject(monitor, codeType, false, true);
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
};
workUnit.setAvoidUnloadResources(true);
ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(workUnit);
}
public void updateCodeProject(IProgressMonitor monitor, ERepositoryObjectType codeType, boolean forceBuild, boolean ignoreM2Cache,
boolean buildIfNoUpdate) throws Exception, CoreException {
Project currentProject = ProjectManager.getInstance().getCurrentProject();
ITalendProcessJavaProject codeProject = getCodesProject(codeType);
if (ERepositoryObjectType.ROUTINES == codeType) {
PomUtil.checkExistingLog4j2Dependencies4RoutinePom(projectTechName, codeProject.getProjectPom());
}
if (ignoreM2Cache || CodeM2CacheManager.needUpdateCodeProject(currentProject, codeType)) {
updateCodeProjectPom(monitor, codeType, codeProject.getProjectPom());
MavenProjectUtils.updateMavenProject(monitor, codeProject.getProject());
buildAndInstallCodesProject(monitor, codeType, true, forceBuild);
CodeM2CacheManager.updateCodeProjectCache(currentProject, codeType);
} else if (buildIfNoUpdate) {
buildAndInstallCodesProject(monitor, codeType, false, true);
}
}
public void updateCodeProjectPom(IProgressMonitor monitor, ERepositoryObjectType type, IFile pomFile)
throws Exception {
if (type != null) {

View File

@@ -324,8 +324,7 @@ public class BuildCacheManager {
Parent parent = new Parent();
parent.setGroupId(PomIdsHelper.getProjectGroupId());
parent.setArtifactId(PomIdsHelper.getProjectArtifactId());
parent.setVersion(PomIdsHelper.getProjectVersion());
parent.setRelativePath(".");
parent.setVersion(PomIdsHelper.getProjectVersion());
model.setParent(parent);
PomUtil.savePom(null, model, pomFile);
}

View File

@@ -105,11 +105,12 @@ public class ProcessorDependenciesManager {
Dependency dependency = PomUtil.createModuleDependency(mavenUri);
if (dependency != null) {
((SortableDependency) dependency).setAssemblyOptional(optional);
Exclusion exclusion = new Exclusion();
exclusion.setGroupId("*"); //$NON-NLS-1$
exclusion.setArtifactId("*"); //$NON-NLS-1$
dependency.addExclusion(exclusion);
if (module.isExcludeDependencies()) {
Exclusion exclusion = new Exclusion();
exclusion.setGroupId("*"); //$NON-NLS-1$
exclusion.setArtifactId("*"); //$NON-NLS-1$
dependency.addExclusion(exclusion);
}
neededDependencies.add(dependency);
}
}

View File

@@ -927,6 +927,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
IMaven maven = MavenPlugin.getMaven();
ArtifactRepository repository = maven.getLocalRepository();
boolean isDIJob = ERepositoryObjectType.getItemType(getJobProcessor().getProperty().getItem()) == ERepositoryObjectType.PROCESS;
for (Dependency dependency : duplicateDependencies) {
if (((SortableDependency) dependency).isAssemblyOptional()) {
continue;
@@ -937,7 +938,7 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
sourceLocation = path.toString();
boolean latestVersionOrLowerVersionInChildJob = isLatestVersionOrLowerVersionInChildJob(parentJobDependencies, childJobDependencies, duplicateLibs, dependency);
if (!latestVersionOrLowerVersionInChildJob && !new File(sourceLocation).exists()) {
if (isDIJob && !latestVersionOrLowerVersionInChildJob && !new File(sourceLocation).exists()) {
CommonExceptionHandler.warn("Job dependency [" + sourceLocation + "] does not exist!");
continue;
}

View File

@@ -14,7 +14,6 @@ package org.talend.designer.maven.utils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -146,23 +145,6 @@ public class MavenProjectUtils {
}
}
public static void addProjectClasspathEntry(IProgressMonitor monitor, IProject project, List<IClasspathEntry> entries) {
try {
Set<IClasspathEntry> classpathentries = new LinkedHashSet<IClasspathEntry>();
IJavaProject javaProject = JavaCore.create(project);
IClasspathEntry[] rawClasspathEntries = javaProject.getRawClasspath();
for (IClasspathEntry entry : rawClasspathEntries) {
classpathentries.add(entry);
}
classpathentries.addAll(entries);
rawClasspathEntries = classpathentries.toArray(new IClasspathEntry[] {});
javaProject.setRawClasspath(rawClasspathEntries, monitor);
javaProject.setOutputLocation(project.getFolder(MavenSystemFolders.JAVA.getOutputPath()).getFullPath(), monitor);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
/**
* Clear compliance settings from project, and set them into Eclipse compliance settings

View File

@@ -1,37 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry exported="true" kind="lib" path="lib/txw2-2.3.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.xml.ws-api-2.3.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/istack-commons-runtime-3.0.12.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jaxb-runtime-2.3.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/woodstox-core-6.2.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-core-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-soap-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-xml-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-databinding-jaxb-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-features-clustering-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxrs-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxws-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-simple-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-rs-client-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-security-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-security-saml-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-transports-http-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-addr-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-wsdl-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-policy-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-security-3.4.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.activation-1.2.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-wsdl-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.activation-api-1.2.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/woodstox-core-6.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.annotation-api-1.3.5.jar"/>
<classpathentry exported="true" kind="lib" path="lib/stax2-api-4.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/neethi-3.1.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.ws.rs-api-2.1.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-core-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-xml-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxrs-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-rs-client-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-transports-http-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-bindings-soap-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-databinding-jaxb-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-features-clustering-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-jaxws-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-frontend-simple-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-security-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-security-saml-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-addr-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-policy-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/cxf-rt-ws-security-3.3.10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/javax.ws.rs-api-2.0-m10.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.xml.bind-api-2.3.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xmlschema-core-2.2.5.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jaxb-runtime-2.3.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.jws-api-2.1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/istack-commons-runtime-3.0.11.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta.xml.soap-api-1.4.2.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>

View File

@@ -5,39 +5,66 @@ Bundle-SymbolicName: org.talend.libraries.apache.cxf;singleton:=true
Bundle-Version: 7.3.1.qualifier
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
lib/cxf-core-3.4.7.jar,
lib/cxf-rt-bindings-soap-3.4.7.jar,
lib/cxf-rt-bindings-xml-3.4.7.jar,
lib/cxf-rt-databinding-jaxb-3.4.7.jar,
lib/cxf-rt-features-clustering-3.4.7.jar,
lib/cxf-rt-frontend-jaxrs-3.4.7.jar,
lib/cxf-rt-frontend-jaxws-3.4.7.jar,
lib/cxf-rt-frontend-simple-3.4.7.jar,
lib/cxf-rt-rs-client-3.4.7.jar,
lib/cxf-rt-security-3.4.7.jar,
lib/cxf-rt-security-saml-3.4.7.jar,
lib/cxf-rt-transports-http-3.4.7.jar,
lib/cxf-rt-ws-addr-3.4.7.jar,
lib/cxf-rt-wsdl-3.4.7.jar,
lib/cxf-rt-ws-security-3.4.7.jar,
lib/cxf-rt-ws-policy-3.4.7.jar,
lib/istack-commons-runtime-3.0.12.jar,
lib/jakarta.activation-1.2.2.jar,
lib/jakarta.activation-api-1.2.2.jar,
lib/jakarta.annotation-api-1.3.5.jar,
lib/jakarta.jws-api-2.1.0.jar,
lib/jakarta.ws.rs-api-2.1.6.jar,
lib/jakarta.xml.bind-api-2.3.3.jar,
lib/jakarta.xml.soap-api-1.4.2.jar,
lib/jakarta.xml.ws-api-2.3.3.jar,
lib/jaxb-runtime-2.3.4.jar,
lib/neethi-3.1.1.jar,
lib/stax2-api-4.2.1.jar,
lib/txw2-2.3.4.jar,
lib/javax.activation-1.2.0.jar,
lib/cxf-core-3.3.10.jar,
lib/cxf-rt-bindings-xml-3.3.10.jar,
lib/cxf-rt-frontend-jaxrs-3.3.10.jar,
lib/cxf-rt-rs-client-3.3.10.jar,
lib/cxf-rt-transports-http-3.3.10.jar,
lib/cxf-rt-wsdl-3.3.10.jar,
lib/cxf-rt-bindings-soap-3.3.10.jar,
lib/cxf-rt-databinding-jaxb-3.3.10.jar,
lib/cxf-rt-features-clustering-3.3.10.jar,
lib/cxf-rt-frontend-jaxws-3.3.10.jar,
lib/cxf-rt-frontend-simple-3.3.10.jar,
lib/cxf-rt-security-3.3.10.jar,
lib/cxf-rt-security-saml-3.3.10.jar,
lib/cxf-rt-ws-addr-3.3.10.jar,
lib/cxf-rt-ws-policy-3.3.10.jar,
lib/cxf-rt-ws-security-3.3.10.jar,
lib/jakarta.ws.rs-api-2.1.6.jar,
lib/jakarta.annotation-api-1.3.5.jar,
lib/woodstox-core-6.2.1.jar,
lib/jakarta.xml.bind-api-2.3.3.jar,
lib/jakarta.activation-api-1.2.2.jar,
lib/jakarta.activation-1.2.2.jar,
lib/javax.ws.rs-api-2.0-m10.jar,
lib/xmlschema-core-2.2.5.jar,
lib/woodstox-core-6.2.6.jar,
lib/wsdl4j-1.6.3.jar
Export-Package: javax.jws,
lib/jaxb-runtime-2.3.3.jar,
lib/jakarta.jws-api-2.1.0.jar,
lib/istack-commons-runtime-3.0.11.jar,
lib/jakarta.xml.soap-api-1.4.2.jar
Export-Package: com.sun.istack,
com.sun.istack.localization,
com.sun.istack.logging,
com.sun.xml.bind,
com.sun.xml.bind.annotation,
com.sun.xml.bind.api,
com.sun.xml.bind.api.impl,
com.sun.xml.bind.marshaller,
com.sun.xml.bind.unmarshaller,
com.sun.xml.bind.util,
com.sun.xml.bind.v2,
com.sun.xml.bind.v2.bytecode,
com.sun.xml.bind.v2.model.annotation,
com.sun.xml.bind.v2.model.core,
com.sun.xml.bind.v2.model.impl,
com.sun.xml.bind.v2.model.nav,
com.sun.xml.bind.v2.model.runtime,
com.sun.xml.bind.v2.model.util,
com.sun.xml.bind.v2.runtime,
com.sun.xml.bind.v2.runtime.output,
com.sun.xml.bind.v2.runtime.property,
com.sun.xml.bind.v2.runtime.reflect,
com.sun.xml.bind.v2.runtime.reflect.opt,
com.sun.xml.bind.v2.runtime.unmarshaller,
com.sun.xml.bind.v2.schemagen,
com.sun.xml.bind.v2.schemagen.episode,
com.sun.xml.bind.v2.schemagen.xmlschema,
com.sun.xml.bind.v2.util,
javax.jws,
javax.ws.rs,
javax.ws.rs.client,
javax.ws.rs.container,
@@ -49,15 +76,6 @@ Export-Package: javax.jws,
javax.xml.bind.attachment,
javax.xml.bind.helpers,
javax.xml.bind.util,
javax.xml.soap,
javax.xml.ws,
javax.xml.ws.handler,
javax.xml.ws.handler.soap,
javax.xml.ws.http,
javax.xml.ws.soap,
javax.xml.ws.spi,
javax.xml.ws.spi.http,
javax.xml.ws.wsaddressing,
org.apache.cxf,
org.apache.cxf.annotations,
org.apache.cxf.attachment,
@@ -174,6 +192,7 @@ Export-Package: javax.jws,
org.apache.cxf.wsdl11,
org.apache.neethi,
org.apache.neethi.builders,
javax.xml.ws,
org.talend.libraries.apache.cxf
Require-Bundle: javax.wsdl;bundle-version="1.6.2",
org.apache.log4j,

View File

@@ -10,10 +10,6 @@
<artifactId>org.talend.libraries.apache.cxf</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<cxf.version>3.4.7</cxf.version>
</properties>
<repositories>
<repository>
<id>talend-update</id>
@@ -25,88 +21,83 @@
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-xml</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-wsdl</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-soap</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-databinding-jaxb</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-features-clustering</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-simple</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-security</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-security-saml</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-ws-addr</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-ws-policy</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-ws-security</artifactId>
<version>${cxf.version}</version>
<version>3.3.10</version>
</dependency>
<dependency>
<groupId>com.sun.istack</groupId>
<artifactId>istack-commons-runtime</artifactId>
<version>3.0.12</version>
</dependency>
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>jakarta.activation</artifactId>
@@ -117,40 +108,15 @@
<artifactId>jakarta.activation-api</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>1.3.5</version>
</dependency>
<dependency>
<groupId>jakarta.jws</groupId>
<artifactId>jakarta.jws-api</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>2.1.6</version>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>jakarta.xml.soap</groupId>
<artifactId>jakarta.xml.soap-api</artifactId>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.4</version>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>1.3.5</version>
</dependency>
<dependency>
<groupId>org.apache.neethi</groupId>
@@ -162,15 +128,15 @@
<artifactId>stax2-api</artifactId>
<version>4.2.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>txw2</artifactId>
<version>2.3.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.woodstox</groupId>
<artifactId>woodstox-core</artifactId>
<version>6.2.6</version>
<version>6.2.1</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0-m10</version>
</dependency>
<dependency>
<groupId>org.apache.ws.xmlschema</groupId>
@@ -178,9 +144,29 @@
<version>2.2.5</version>
</dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>1.6.3</version>
<groupId>jakarta.jws</groupId>
<artifactId>jakarta.jws-api</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>com.sun.istack</groupId>
<artifactId>istack-commons-runtime</artifactId>
<version>3.0.11</version>
</dependency>
<dependency>
<groupId>jakarta.xml.soap</groupId>
<artifactId>jakarta.xml.soap-api</artifactId>
<version>1.4.2</version>
</dependency>
</dependencies>
<build>
@@ -208,7 +194,6 @@
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<excludeTypes>pom</excludeTypes>
<excludeTransitive>true</excludeTransitive>
<outputDirectory>${project.basedir}/lib</outputDirectory>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/xmlbeans-3.1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xmlbeans-2.3.0.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>

View File

@@ -22,6 +22,9 @@ Export-Package: org.apache.xmlbeans,
org.apache.xmlbeans.impl.jam.provider,
org.apache.xmlbeans.impl.jam.visitor,
org.apache.xmlbeans.impl.jam.xml,
org.apache.xmlbeans.impl.piccolo.io,
org.apache.xmlbeans.impl.piccolo.util,
org.apache.xmlbeans.impl.piccolo.xml,
org.apache.xmlbeans.impl.regex,
org.apache.xmlbeans.impl.richParser,
org.apache.xmlbeans.impl.schema,
@@ -48,6 +51,8 @@ Export-Package: org.apache.xmlbeans,
org.apache.xmlbeans.xml.stream,
org.apache.xmlbeans.xml.stream.events,
org.apache.xmlbeans.xml.stream.utils,
org.w3c.dom,
repackage,
schemaorg_apache_xmlbeans.system.sXMLCONFIG,
schemaorg_apache_xmlbeans.system.sXMLLANG,
schemaorg_apache_xmlbeans.system.sXMLSCHEMA,

View File

@@ -1,3 +1,4 @@
xmlschema-core-2.0.1.jar
xmlbeans-3.1.0.jar
xmlbeans-2.3.0.jar
xmlbeans-2.6.0.jar
xercesImpl-2.12.0.jar

View File

@@ -26,6 +26,16 @@
<configuration>
<outputDirectory>${project.basedir}/lib</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.3.0</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.6.0</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/xmlbeans-3.1.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xml-apis.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
@@ -8,5 +7,6 @@
<classpathentry exported="true" kind="lib" path="lib/apache-mime4j-0.6.jar"/>
<classpathentry exported="true" kind="lib" path="lib/castor-1.0.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jakarta-oro-2.0.8.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xmlbeans-2.3.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -8,8 +8,8 @@ Bundle-ClassPath: .,
lib/apache-mime4j-0.6.jar,
lib/castor-1.0.3.jar,
lib/jakarta-oro-2.0.8.jar,
lib/xml-apis.jar,
lib/xmlbeans-3.1.0.jar
lib/xmlbeans-2.3.0.jar,
lib/xml-apis.jar
Bundle-Vendor: .Talend SA.
Require-Bundle: org.apache.log4j;resolution:=optional,
org.talend.libraries.apache.common;visibility:=reexport,
@@ -63,6 +63,9 @@ Export-Package:
org.apache.xmlbeans.impl.jam.provider,
org.apache.xmlbeans.impl.jam.visitor,
org.apache.xmlbeans.impl.jam.xml,
org.apache.xmlbeans.impl.piccolo.io,
org.apache.xmlbeans.impl.piccolo.util,
org.apache.xmlbeans.impl.piccolo.xml,
org.apache.xmlbeans.impl.regex,
org.apache.xmlbeans.impl.richParser,
org.apache.xmlbeans.impl.schema,

View File

@@ -3,8 +3,7 @@ bin.includes = META-INF/,\
.,\
licences/,\
lib/,\
lib/xml-apis.jar,\
lib/xmlbeans-3.1.0.jar
lib/xml-apis.jar
bin.excludes = libs_not_used/commons-betwixt-0.8.jar,\
libs_not_used/commons-digester-1.7.jar,\
libs_not_used/commons-discovery-0.2.jar,\

View File

@@ -10,26 +10,20 @@
<artifactId>org.talend.libraries.apache</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<reload4j.version>1.2.19</reload4j.version>
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.7.25</slf4j.version>
<log4j2.version>2.17.1</log4j2.version>
<log4j2.version>2.16.0</log4j2.version>
</properties>
<dependencies>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>${reload4j.version}</version>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
@@ -76,11 +70,6 @@
<artifactId>log4j-1.2-api</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>3.1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
@@ -99,7 +88,7 @@
<excludeTypes>pom</excludeTypes>
<excludeTransitive>true</excludeTransitive>
<outputDirectory>${project.basedir}/lib</outputDirectory>
<includeGroupIds>ch.qos.reload4j,org.slf4j,org.apache.xmlbeans,org.apache.logging.log4j</includeGroupIds>
<includeGroupIds>log4j,org.slf4j,org.apache.logging.log4j</includeGroupIds>
</configuration>
</execution>
</executions>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="lib" kind="lib" path="lib/h2-2.1.210.jar"/>
<classpathentry exported="true" kind="lib" path="lib/h2-1.4.198.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -4,7 +4,7 @@ Bundle-Name: H2
Bundle-SymbolicName: org.talend.libraries.jdbc.h2
Bundle-Version: 7.3.1.qualifier
Bundle-ClassPath: .,
lib/h2-2.1.210.jar
lib/h2-1.4.198.jar
Export-Package: org.h2,
org.h2.api;uses:="org.h2.command.ddl,org.h2.table",
org.h2.bnf;uses:="org.h2.server.web",
@@ -35,6 +35,7 @@ Export-Package: org.h2,
org.h2.value,
org.h2.util",
org.h2.compress,
org.h2.constant,
org.h2.constraint;
uses:="org.h2.expression,
org.h2.result,

View File

@@ -1,4 +1,4 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
lib/h2-2.1.210.jar
lib/h2-1.4.198.jar

View File

@@ -28,7 +28,7 @@
<artifactItem>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.1.210</version>
<version>1.4.198</version>
</artifactItem>
</artifactItems>
</configuration>

View File

@@ -69,7 +69,7 @@ Module.view.download.external.modules.action.text=Download external modules
Module.view.download.external.modules.action.description=Download external modules
download.external.dialog.title=The following modules are not yet installed. Please download and install all required modules.
download.external.dialog.desciption=List of modules to be downloaded automatically or imported manually.
download.external.dialog.help.url=https://document-link.us.cloud.talend.com/ts_ig_install-external-modules?version=73&lang=en&env=prd
download.external.dialog.help.url=https://help.talend.com/display/KB/How+to+install+external+modules+in+the+Talend+products
download.external.dialog.warning=Warning
download.external.dialog.message=Select at least one module not installed.
Module.view.sharelibsAction.title=Share libraries

View File

@@ -49,7 +49,7 @@ public class ExportCustomSettingsAction extends Action {
public void run() {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
FileDialog dialog = new FileDialog(shell, SWT.SAVE);
dialog.setText(Messages.getString("ExportCustomSettingsAction.title"));
dialog.setText(Messages.getString("ImportCustomSettingsAction.title"));
String selectedFile = dialog.open();
if (selectedFile != null) {
CustomUriManager.getInstance().exportSettings(dialog.getFilterPath(), dialog.getFileName());

View File

@@ -57,32 +57,12 @@ public class JDBCUtil {
throw new RuntimeException("Null value in non-Nullable column");
}
/**
* getDate can be called with the resultSet having either a java.sql.Timestamp or a java.sql.Date
* the double try implementation is not something im proud of, but having two methods would require
* a huge refactoring that in the end is the same as doing that
* @param rs
* @param index
* @return java.util.Date converted from java.sql.Timestamp/Date
* @throws java.sql.SQLException
*/
public static Date getDate(ResultSet rs, int index) throws java.sql.SQLException {
Date result = null;
try {
if(rs.getTimestamp(index) != null) {
result = new Date(rs.getTimestamp(index).getTime());
return result;
}
} catch (java.sql.SQLException e) {
if(rs.getTimestamp(index) != null) {
return new Date(rs.getTimestamp(index).getTime());
}
try {
if(rs.getDate(index) != null) {
result = new Date(rs.getDate(index).getTime());
return result;
}
} catch (java.sql.SQLException e) {
}
return result;
return null;
}
//decrease the get method call number

View File

@@ -313,13 +313,10 @@ public class ParserUtils {
*/
public static java.util.Date parseTo_Date(String dateString, String pattern) {
// check the parameter for supporting " ","2007-09-13"," 2007-09-13 "
if (dateString != null) {
dateString = dateString.trim();
}
if (dateString == null || dateString.length() == 0) {
return null;
}
dateString = dateString.trim();
if (pattern == null) {
pattern = Constant.dateDefaultPattern;
}

View File

@@ -140,7 +140,7 @@ public class ModulesNeededProvider {
private static volatile boolean installModuleForRountine = false;
private static Set<ModuleNeeded> missingModulesForRountine = new HashSet<>();
private static Set<ModuleNeeded> modulesForRountine = new HashSet<>();
private static List<ModuleNeeded> systemModules = null;
@@ -382,18 +382,12 @@ public class ModulesNeededProvider {
}
public static void collectModuleNeeded(String context, IMPORTType importType, List<ModuleNeeded> importNeedsList) {
collectModuleNeeded(context, importType, importNeedsList, null);
}
public static void collectModuleNeeded(String context, IMPORTType importType, List<ModuleNeeded> importNeedsList, String distribution) {
List<ModuleNeeded> importModuleFromExtension = ExtensionModuleManager.getInstance().getModuleNeededForComponent(context, importType);
List<ModuleNeeded> importModuleFromExtension = ExtensionModuleManager.getInstance().getModuleNeededForComponent(context,
importType);
boolean foundModule = importModuleFromExtension.size() > 0;
if (!foundModule) { // If cannot find the jar from extension point then do it like before.
createModuleNeededForComponent(context, importType, importNeedsList, distribution);
createModuleNeededForComponent(context, importType, importNeedsList);
} else {
if (!StringUtils.isEmpty(distribution)) {
importModuleFromExtension.forEach(m -> m.setDynamicDistributionVersion(distribution));
}
importNeedsList.addAll(importModuleFromExtension);
}
}
@@ -408,10 +402,6 @@ public class ModulesNeededProvider {
}
public static void createModuleNeededForComponent(String context, IMPORTType importType, List<ModuleNeeded> importNeedsList) {
createModuleNeededForComponent(context, importType, importNeedsList, null);
}
public static void createModuleNeededForComponent(String context, IMPORTType importType, List<ModuleNeeded> importNeedsList, String distribution) {
if (importType.getMODULE() == null) {
if (importType.getMODULEGROUP() != null) {
CommonExceptionHandler.warn("Missing module group definition: " + importType.getMODULEGROUP());
@@ -430,9 +420,6 @@ public class ModulesNeededProvider {
moduleNeeded.setMrRequired(importType.isMRREQUIRED());
moduleNeeded.setShow(importType.isSHOW());
moduleNeeded.setModuleLocaion(importType.getUrlPath());
if (!StringUtils.isEmpty(distribution)) {
moduleNeeded.setDynamicDistributionVersion(distribution);
}
importNeedsList.add(moduleNeeded);
}
@@ -513,7 +500,6 @@ public class ModulesNeededProvider {
/**
* @deprecated
*/
@Deprecated
public static List<ModuleNeeded> getModulesNeededForJobs() {
IProxyRepositoryFactory repositoryFactory = repositoryService.getProxyRepositoryFactory();
List<ModuleNeeded> importNeedsList = new ArrayList<ModuleNeeded>();
@@ -1203,37 +1189,30 @@ public class ModulesNeededProvider {
return mvnPath;
}
static void checkInstallStatus(Collection<ModuleNeeded> importNeedsList) {
private static void checkInstallStatus(Collection<ModuleNeeded> importNeedsList) {
if (!importNeedsList.isEmpty()) {
for (ModuleNeeded mod : importNeedsList) {
if (ELibraryInstallStatus.NOT_INSTALLED == mod.getStatus()) {
missingModulesForRountine.add(mod);
if (ELibraryInstallStatus.INSTALLED != mod.getStatus()) {
installModuleForRountine = true;
}
}
modulesForRountine.addAll(importNeedsList);
}
}
public static boolean installModuleForRoutineOrBeans() {
if (!installModuleForRountine) {
for (ModuleNeeded mod : missingModulesForRountine) {
if (ELibraryInstallStatus.NOT_INSTALLED != mod.getStatus()) {
installModuleForRountine = true;
break;
}
}
}
return installModuleForRountine;
}
public static void setInstallModuleForRoutineOrBeans() {
installModuleForRountine = false;
Iterator<ModuleNeeded> iterator = missingModulesForRountine.iterator();
while (iterator.hasNext()) {
ModuleNeeded mod = iterator.next();
if (ELibraryInstallStatus.NOT_INSTALLED != mod.getStatus()) {
iterator.remove();
boolean allSet = true;
for (ModuleNeeded mod : modulesForRountine) {
if (ELibraryInstallStatus.INSTALLED != mod.getStatus()) {
allSet = false;
}
}
if (allSet) {
installModuleForRountine = false;
}
}
}

View File

@@ -15,12 +15,8 @@ package org.talend.librariesmanager.model.service;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.util.URI;
@@ -49,17 +45,6 @@ public class LibrariesIndexManager {
private static final String MAVEN_INDEX = "MavenUriIndex.xml";
private static final Set<String> EXCLUDED_INDEX_EXT = new HashSet<String>();
static {
EXCLUDED_INDEX_EXT.add(".javajet");
EXCLUDED_INDEX_EXT.add(".xml");
EXCLUDED_INDEX_EXT.add(".png");
EXCLUDED_INDEX_EXT.add(".gif");
EXCLUDED_INDEX_EXT.add(".properties");
}
private LibrariesIndexManager() {
loadIndexResources();
}
@@ -106,9 +91,6 @@ public class LibrariesIndexManager {
}
public void saveStudioIndexResource() {
Set<String> ignoredKeys = studioLibIndex.getJarsToRelativePath().stream().map(entry -> entry.getKey())
.filter(k -> ingoredIndex(k)).collect(Collectors.toSet());
ignoredKeys.forEach(k -> studioLibIndex.getJarsToRelativePath().removeKey(k));
saveResource(studioLibIndex, LIBRARIES_INDEX);
}
@@ -180,13 +162,4 @@ public class LibrariesIndexManager {
return null;
}
private static boolean ingoredIndex(String key) {
for (String ext : EXCLUDED_INDEX_EXT) {
if (StringUtils.endsWith(key, ext)) {
return true;
}
}
return false;
}
}

View File

@@ -64,7 +64,6 @@ import org.talend.core.model.general.ILibrariesService.IChangedLibrariesListener
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.ModuleNeeded.ELibraryInstallStatus;
import org.talend.core.model.general.ModuleStatusProvider;
import org.talend.core.model.general.RetrieveResult;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.nexus.ArtifactRepositoryBean;
import org.talend.core.nexus.NexusConstants;
@@ -373,10 +372,6 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
.process(new Exception(getClass().getSimpleName() + " resolve " + module.getModuleName() + " failed !"));
}
try {
// try maven uri first
if (jarFile == null) {
jarFile = getJarFile(module.getMavenUri());
}
// try the jar name if can't get jar with uri.
if (jarFile == null) {
jarFile = getJarFile(jarNeeded);
@@ -388,10 +383,7 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
ILibraryManagerUIService libUiService = GlobalServiceRegister.getDefault()
.getService(ILibraryManagerUIService.class);
// libUiService.installModules(new String[] { jarNeeded });
List<ModuleNeeded> moduleList = new ArrayList<ModuleNeeded>();
moduleList.add(module);
libUiService.installModules(moduleList);
libUiService.installModules(new String[] { jarNeeded });
}
jarFile = retrieveJarFromLocal(module);
if (jarFile == null) {
@@ -710,15 +702,8 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
@Override
public boolean retrieve(ERepositoryObjectType codeType, Set<ModuleNeeded> modulesNeeded, String pathToStore,
boolean showDialog, IProgressMonitor... monitorWrap) {
return retrieveModules(codeType, modulesNeeded, pathToStore, showDialog, monitorWrap).isAllResolved();
}
@Override
public RetrieveResult retrieveModules(ERepositoryObjectType codeType, Set<ModuleNeeded> modulesNeeded, String pathToStore,
boolean showDialog, IProgressMonitor... monitorWrap) {
RetrieveResult result = new RetrieveResult();
if (modulesNeeded == null || modulesNeeded.size() == 0) {
return result;
return false;
}
Set<ModuleNeeded> jarNotFound = new HashSet<>();
boolean allIsOK = true;
@@ -741,10 +726,8 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
if (!retrieve(jar, pathToStore, false, false)) {
jarNotFound.add(jar);
allIsOK = false;
result.getUnresolvedModules().add(jar);
} else {
needResetModulesNeeded = true;
result.getResovledModules().add(jar);
}
}
if (needResetModulesNeeded) {
@@ -761,8 +744,8 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
}
}
}
result.setAllResolved(allIsOK);
return result;
return allIsOK;
}
@Override
@@ -1052,9 +1035,6 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
if (localMavenUri == null) {
localMavenUri = mvnUriStatusKey.replace("mvn:", "mvn:" + MavenConstants.LOCAL_RESOLUTION_URL + "!"); //$NON-NLS-1$ //$NON-NLS-2$
}
if (!isResolveAllowed(localMavenUri)) {
return null;
}
try {
File resolvedJar = TalendMavenResolver.resolve(localMavenUri);
if (resolvedJar != null) {
@@ -1273,10 +1253,6 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
@Override
public void createModulesIndexFromComponentAndExtension(IProgressMonitor... monitorWrap) {
buildModulesIndexFromComponentAndExtension(monitorWrap);
}
public Map<String, String> buildModulesIndexFromComponentAndExtension(IProgressMonitor... monitorWrap) {
// key: moduleName, value: platformURL
Map<String, String> platformURLMap = new HashMap<>();
// key: moduleName, value: mvn uri
@@ -1318,11 +1294,11 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
saveMavenIndex(mavenURIMap, monitorWrap);
savePlatfromURLIndex(platformURLMap, monitorWrap);
if (service != null) {
deployLibsFromCustomComponents(service, platformURLMap);
}
return mavenURIMap;
}
/**
@@ -1354,7 +1330,7 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
if (path.equals(moduleLocation)) {
continue;
} else {
if (CommonsPlugin.isDebugMode() && !CommonsPlugin.isHeadless()) {
if (CommonsPlugin.isDebugMode()) {
CommonExceptionHandler
.warn(name + " is duplicated, locations:" + path + " and:" + moduleLocation);
}

View File

@@ -22,7 +22,6 @@ import org.talend.core.model.metadata.builder.connection.Connection;
import org.talend.core.model.utils.ContextParameterUtils;
import org.talend.core.runtime.evaluator.AbstractPropertyValueEvaluator;
import org.talend.core.runtime.maven.MavenUrlHelper;
import org.talend.core.runtime.util.GenericTypeUtils;
import org.talend.core.utils.TalendQuoteUtils;
import org.talend.daikon.properties.property.Property;
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
@@ -85,13 +84,6 @@ public class MetadataContextPropertyValueEvaluator extends AbstractPropertyValue
}
}
if (GenericTypeUtils.isStringType(property)) {
String val = String.valueOf(storedValue);
if (property.isFlag(Property.Flags.ENCRYPT)) {
return val;
}
}
return getTypedValue(property, currentStoredValue, storedValue);
}

View File

@@ -14,15 +14,15 @@
<!-- Seems those 3 are not useful -->
<classloader
index="HIVE:HORTONWORKS:HDP_1_0:EMBEDDED"
libraries="hive-hbase-handler-0.9.0.jar;hbase-0.92.0.jar;hadoop-core-1.0.3.jar;commons-logging-1.0.4.jar;datanucleus-api-jdo-3.0.7.jar;datanucleus-core-3.0.9.jar;datanucleus-rdbms-3.0.8.jar;hive-builtins-0.9.0.jar;hive-exec-0.9.0_hdp.jar;hive-jdbc-0.9.0_hdp.jar;hive-metastore-0.9.0_hdp.jar;hive-service-0.9.0_hdp.jar;libfb303-0.7.0.jar;libthrift-0.7.0.jar;commons-lang-2.4.jar;antlr-runtime-3.0.1.jar;commons-dbcp-1.4.jar;commons-pool-1.5.4.jar;derby-10.4.2.0.jar;commons-configuration-1.6.jar;jdo2-api-2.3-ec.jar;reload4j-1.2.19.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;jackson-core-asl-1.8.8.jar;jackson-mapper-asl-1.8.8.jar">
libraries="hive-hbase-handler-0.9.0.jar;hbase-0.92.0.jar;hadoop-core-1.0.3.jar;commons-logging-1.0.4.jar;datanucleus-api-jdo-3.0.7.jar;datanucleus-core-3.0.9.jar;datanucleus-rdbms-3.0.8.jar;hive-builtins-0.9.0.jar;hive-exec-0.9.0_hdp.jar;hive-jdbc-0.9.0_hdp.jar;hive-metastore-0.9.0_hdp.jar;hive-service-0.9.0_hdp.jar;libfb303-0.7.0.jar;libthrift-0.7.0.jar;commons-lang-2.4.jar;antlr-runtime-3.0.1.jar;commons-dbcp-1.4.jar;commons-pool-1.5.4.jar;derby-10.4.2.0.jar;commons-configuration-1.6.jar;jdo2-api-2.3-ec.jar;log4j-1.2.17.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;jackson-core-asl-1.8.8.jar;jackson-mapper-asl-1.8.8.jar">
</classloader>
<classloader
index="HIVE:CLOUDERA:Cloudera_CDH3:STANDALONE"
libraries="hadoop-core-0.20.203.0.jar;reload4j-1.2.19.jar;hive-exec-0.7.1.jar;hive-jdbc-0.7.1.jar;hive-metastore-0.7.1.jar;hive-service-0.7.1.jar;libfb303.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;commons-logging-1.1.1.jar;commons-logging-api-1.0.4.jar">
libraries="hadoop-core-0.20.203.0.jar;log4j-1.2.17.jar;hive-exec-0.7.1.jar;hive-jdbc-0.7.1.jar;hive-metastore-0.7.1.jar;hive-service-0.7.1.jar;libfb303.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;commons-logging-1.1.1.jar;commons-logging-api-1.0.4.jar">
</classloader>
<classloader
index="HIVE:AMAZON_EMR:MapR_EMR:STANDALONE"
libraries="hadoop-core-0.20.203.0.jar;reload4j-1.2.19.jar;hive-exec-0.7.1.jar;hive-jdbc-0.7.1.jar;hive-metastore-0.7.1.jar;hive-service-0.7.1.jar;libfb303.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;commons-logging-1.1.1.jar;commons-logging-api-1.0.4.jar">
libraries="hadoop-core-0.20.203.0.jar;log4j-1.2.17.jar;hive-exec-0.7.1.jar;hive-jdbc-0.7.1.jar;hive-metastore-0.7.1.jar;hive-service-0.7.1.jar;libfb303.jar;slf4j-api-1.6.1.jar;slf4j-log4j12-1.6.1.jar;commons-logging-1.1.1.jar;commons-logging-api-1.0.4.jar">
</classloader>
<!-- -->
<classloader
@@ -40,8 +40,8 @@
context="PostgresPlus wizard"
language="java"
message="wizard for PostgresPlus"
mvn_uri="mvn:org.postgresql/postgresql/42.2.25"
name="postgresql-42.2.25.jar"
mvn_uri="mvn:org.postgresql/postgresql/42.2.14"
name="postgresql-42.2.14.jar"
required="true">
</libraryNeeded>
<libraryNeeded

View File

@@ -83,6 +83,7 @@ import org.talend.core.utils.TalendQuoteUtils;
import org.talend.designer.core.IDesignerCoreService;
import org.talend.metadata.managment.connection.manager.HiveConnectionManager;
import org.talend.metadata.managment.hive.EmbeddedHiveDataBaseMetadata;
import org.talend.metadata.managment.utils.MetadataConnectionUtils;
import org.talend.repository.ProjectManager;
import org.talend.utils.exceptions.MissingDriverException;
import org.talend.utils.sql.ConnectionUtils;
@@ -1075,10 +1076,8 @@ public class ExtractMetaDataUtils {
}
}
} else {
if (TalendQuoteUtils.removeQuotesIfExist(driverJarPathArg)
.startsWith(MavenUrlHelper.MVN_PROTOCOL)) {
setDriverPath(librairesManagerService, jarPathList,
TalendQuoteUtils.removeQuotesIfExist(driverJarPathArg));
if (driverJarPathArg.startsWith(MavenUrlHelper.MVN_PROTOCOL)) {
setDriverPath(librairesManagerService, jarPathList, driverJarPathArg);
} else {
String jarName = librairesManagerService.getJarNameFromMavenuri(driverJarPathArg);
if (jarName == null) {
@@ -1454,6 +1453,10 @@ public class ExtractMetaDataUtils {
if (StringUtils.isEmpty(defautVal)) {
return;
}
if (defautVal.trim().equals("NULL")) {
initialValue.setBody("");
return;
}
defautVal = defautVal.trim();
boolean defaultValueIsFunction = false;
List<String> functions = getAllDBFuctions(dbMetaData);
@@ -1471,45 +1474,12 @@ public class ExtractMetaDataUtils {
defautVal = TalendQuoteUtils.addQuotes(defautVal, TalendQuoteUtils.SINGLE_QUOTE);
}
} else {
defautVal = adaptForDBs(defautVal,dbMetaData);
if(!defautVal.trim().equalsIgnoreCase("NULL")) {
defautVal = TalendQuoteUtils.addSingleQuotesIfNotExist(defautVal);
}
defautVal = TalendQuoteUtils.addSingleQuotesIfNotExist(defautVal);
}
}
initialValue.setBody(defautVal);
}
/*
* add special code for different DBs as they may have special return value if set default NULL. (for now only add mysql/oracle/mssql , could add more later if customer requests)
*/
private String adaptForDBs(String defaultVal,DatabaseMetaData dbMetaData) {
String dbType= "";
try {
String type = dbMetaData.getDatabaseProductName();
if(type != null) {
dbType = type;
}
} catch (SQLException e) {
log.error(e.getMessage());
}
if(EDatabaseTypeName.MYSQL.getDisplayName().equalsIgnoreCase(dbType)) {
if("NULL".equalsIgnoreCase(defaultVal)) {
defaultVal = TalendQuoteUtils.addSingleQuotesIfNotExist(defaultVal);
}
}else if(EDatabaseTypeName.ORACLE_OCI.getProduct().equalsIgnoreCase(dbType)) {
//oracle do nothing for now
}else if(EDatabaseTypeName.MSSQL.getDisplayName().equalsIgnoreCase(dbType)) {
defaultVal = removeBracketsIfExist(defaultVal);
}
return defaultVal;
}
private String removeBracketsIfExist(String value) {
if (StringUtils.isNotEmpty(value)&&value.startsWith("(") && value.endsWith(")")) {
value= value.substring(1,value.length()-1);
}
return value;
}
public String getSchema() {
return schema;
}

View File

@@ -70,25 +70,9 @@ public class ImpalaConnectionManager extends DataBaseConnectionManager {
@Override
public Connection call() throws Exception {
Connection conn = null;
if( !("".equals( metadataConn.getPassword() ) || "\"\"".equals( metadataConn.getPassword() )) ) {
String url = metadataConn.getUrl().replace(";auth=noSasl", "");
if (url.startsWith("jdbc:hive2") && !url.contains(";user=")) {
url = url + ";user=" + metadataConn.getUsername() + ";password=" + metadataConn.getPassword();
} else if (!url.contains(";AuthMech=3;UID=")) {
url = url + ";AuthMech=3;UID=" + metadataConn.getUsername() + ";PWD=" + metadataConn.getPassword();
}
metadataConn.setUrl(url);
}
String connURL = metadataConn.getUrl();
String username = metadataConn.getUsername();
String password = metadataConn.getPassword();
String password = metadataConn.getPassword();
// 1. Get class loader.
ClassLoader currClassLoader = Thread.currentThread().getContextClassLoader();
ClassLoader impalaClassLoader = getClassLoader(metadataConn);
@@ -163,11 +147,8 @@ public class ImpalaConnectionManager extends DataBaseConnectionManager {
Properties info = new Properties();
username = username != null ? username : ""; //$NON-NLS-1$
password = password != null ? password : "";//$NON-NLS-1$
// info.setProperty("user", username);//$NON-NLS-1$
// info.setProperty("password", password);//$NON-NLS-1$
info.setProperty("user", username);//$NON-NLS-1$
info.setProperty("password", password);//$NON-NLS-1$
conn = hiveDriver.connect(connURL, info);
} finally {
Thread.currentThread().setContextClassLoader(currClassLoader);

View File

@@ -576,16 +576,6 @@ public class MetadataConnectionUtils {
return false;
}
public static boolean isH2(DatabaseMetaData connectionMetadata) throws SQLException {
if (connectionMetadata.getDriverName() != null && connectionMetadata.getDatabaseProductName() != null) {
if (EDatabaseTypeName.H2.getDbType().equalsIgnoreCase(connectionMetadata.getDatabaseProductName().trim())) {
return true;
}
}
return false;
}
public static boolean isSybase16SA(IMetadataConnection connectionMetadata) throws SQLException {
boolean isSybase16SA = false;
if(connectionMetadata!=null) {

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="jst.java"/>
<fixed facet="jst.utility"/>
<installed facet="jst.utility" version="1.0"/>
<installed facet="jst.java" version="5.0"/>
</faceted-project>

View File

@@ -654,9 +654,8 @@ public class ImportExportHandlersManager {
importItemRecordsWithRelations(monitor, resManager, checkedItemRecords, overwrite,
allImportItemRecords, destinationPath);
if (!CommonsPlugin.isTUJTest()) {
RelationshipItemBuilder.getInstance().buildAndSaveIndex();
}
RelationshipItemBuilder.getInstance().buildAndSaveIndex();
} catch (Exception e) {
if (Platform.inDebugMode()) {
ExceptionHandler.process(e);

View File

@@ -1006,7 +1006,7 @@ DatabaseForm.genaralJDBC.mappingFileAlert=Mapping File must be specified
DatabaseForm.hc.link.none=None
DatabaseForm.hc.link.repository=Repository
DatabaseForm.hc.link.title=Hadoop Cluster
DatabaseForm.helpInfo.installDriverLink.url=https://document-link.us.cloud.talend.com/ts_ig_install-external-modules?version=73&lang=en&env=prd
DatabaseForm.helpInfo.installDriverLink.url=https://help.talend.com/pages/viewpage.action?pageId=14230347
DatabaseForm.helpInfo.installDriverLink.label=How to install a driver
DatabaseTableFilterForm.allSynonyms=All synonyms
DatabaseTableFilterForm.edit=Edit...

View File

@@ -4495,20 +4495,6 @@ public class DatabaseForm extends AbstractForm {
};
} else if (isImpalaDBConnSelected()) {
final IMetadataConnection metadataConn = ConvertionHelper.convert(connectionItem.getConnection(), true);
if( !("".equals(metadataConn.getPassword()) || "\"\"".equals(metadataConn.getPassword())) ) {
String url = metadataConn.getUrl().replace(";auth=noSasl", "");
if (url.startsWith("jdbc:hive2")) {
url = url + ";user=" + metadataConn.getUsername() + ";password=" + metadataConn.getPassword();
} else {
url = url + ";AuthMech=3;UID=" + metadataConn.getUsername() + ";PWD=" + metadataConn.getPassword();
}
metadataConn.setUrl(url);
}
checkingDialog = new AProgressMonitorDialogWithCancel<Boolean>(getShell()) {
@Override
@@ -8709,7 +8695,7 @@ public class DatabaseForm extends AbstractForm {
hiveVersion == null ? null : hiveVersion.getVersion(), false);
if (impalaDriverDisplay != null && impalaDriverDisplay.length == 0) {
// hive2 by default
impalaDriverCombo.getCombo().setItems(EImpalaDriver.HIVE2.getDisplayName().split("\n"));
impalaDriverCombo.getCombo().setItems(EImpalaDriver.HIVE2.getDisplayName());
} else {
impalaDriverCombo.getCombo().setItems(impalaDriverDisplay);
}

View File

@@ -15,7 +15,6 @@ package org.talend.repository.viewer.ui.provider;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.StructuredViewer;
@@ -25,7 +24,6 @@ import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.swt.widgets.Composite;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.utils.RepositoryManagerHelper;
import org.talend.core.repository.model.ProjectRepositoryNode;
@@ -33,7 +31,6 @@ import org.talend.core.repository.ui.utils.RecombineRepositoryNodeUtil;
import org.talend.core.repository.ui.view.RepositoryLabelProvider;
import org.talend.repository.model.IRepositoryNode;
import org.talend.repository.model.IRepositoryNode.ENodeType;
import org.talend.repository.model.IRepositoryService;
import org.talend.repository.model.RepositoryNode;
import org.talend.repository.model.nodes.IProjectRepositoryNode;
import org.talend.repository.navigator.RepoViewCommonNavigator;
@@ -110,8 +107,6 @@ public class RepositoryViewerProvider extends AbstractViewerProvider {
sorter = viewer.getSorter();
}
final ViewerSorter viewerSorter = sorter;
IRepositoryService service = (IRepositoryService) GlobalServiceRegister.getDefault()
.getService(IRepositoryService.class);
// TDI-20528
// treeViewer.setSorter(sorter);
treeViewer.setSorter(new TreePathViewerSorter() {
@@ -132,35 +127,7 @@ public class RepositoryViewerProvider extends AbstractViewerProvider {
// do special for simple folder,TDI-20528
if (node1.getType() == IRepositoryNode.ENodeType.SIMPLE_FOLDER
|| node2.getType() == IRepositoryNode.ENodeType.SIMPLE_FOLDER) {
int ret = e1.toString().compareTo(e2.toString());
// TUP-33214:sort between leaf node and embedded folder node. should return positive integer
// when leaf node is in prefix folder of folder node instead of comparing the string simply.
if (node1.getType() != IRepositoryNode.ENodeType.SIMPLE_FOLDER) {
IRepositoryNode parent = node1.getParent();
if (parent != null && parent.getType() != IRepositoryNode.ENodeType.SIMPLE_FOLDER) {
ret = 1;
}
if (parent != null && parent.getType() == IRepositoryNode.ENodeType.SIMPLE_FOLDER) {
IPath path1 = service.getRepositoryPath(parent);
IPath path2 = service.getRepositoryPath(node2);
if (path1 != null && (path1.isPrefixOf(path2) || path1.equals(path2))) {
ret = 1;
}
}
} else if (node2.getType() != IRepositoryNode.ENodeType.SIMPLE_FOLDER) {
IRepositoryNode parent = node2.getParent();
if (parent != null && parent.getType() != IRepositoryNode.ENodeType.SIMPLE_FOLDER) {
ret = -1;
}
if (parent != null && parent.getType() == IRepositoryNode.ENodeType.SIMPLE_FOLDER) {
IPath path2 = service.getRepositoryPath(parent);
IPath path1 = service.getRepositoryPath(node1);
if (path2 != null && (path2.equals(path1) || path2.isPrefixOf(path1))) {
ret = -1;
}
}
}
return ret;
return e1.toString().compareTo(e2.toString());
} else if (viewerSorter != null) {
if (viewerSorter instanceof TreePathViewerSorter) {
if (!node1.isInitialized() && !node2.isInitialized()) {

View File

@@ -18,8 +18,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -255,9 +253,8 @@ public class UpdateTools {
dropList.addAll(list);
});
// collect from drop.bundle.info
dropBundles.forEach((b,vs) -> {
Arrays.asList(vs.split("\\|")).forEach(v -> plugins.stream().filter(f -> f.getName().contains(b + "_"+v)).forEach(f -> dropList.add(f.getAbsolutePath())));
});
dropBundles.forEach((b, v) -> plugins.stream().filter(f -> f.getName().contains(b + "_" + v))
.forEach(f -> dropList.add(f.getAbsolutePath())));
File dropFile = new File(pluginFolderFile, "droplist");
if (!dropFile.exists()) {
dropFile.createNewFile();
@@ -294,4 +291,5 @@ public class UpdateTools {
}
return !file.delete();
}
}

View File

@@ -31,10 +31,10 @@
<version>1.9.12</version>
</dependency>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
</dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
@@ -54,12 +54,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.10</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>

View File

@@ -38,9 +38,10 @@
<version>1.9.12</version>
</dependency>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<type>bundle</type>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
@@ -71,12 +72,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.10</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

View File

@@ -38,9 +38,10 @@
<version>1.9.12</version>
</dependency>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.19</version>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<type>bundle</type>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
@@ -71,12 +72,6 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.10</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.talend.daikon</groupId>

View File

@@ -1,170 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2022 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.update.extension;
import java.util.List;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.junit.Assert;
import org.junit.Test;
import org.talend.core.model.metadata.builder.connection.ConnectionFactory;
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
import org.talend.core.model.metadata.builder.connection.MetadataTable;
import org.talend.core.model.properties.ContextItem;
import org.talend.core.model.properties.DatabaseConnectionItem;
import org.talend.core.model.properties.ItemState;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.PropertiesFactory;
import org.talend.core.model.properties.Property;
import org.talend.core.model.relationship.RelationshipItemBuilder;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.utils.ReflectionUtils;
import org.talend.cwm.helper.ConnectionHelper;
import org.talend.cwm.helper.PackageHelper;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
import org.talend.designer.core.model.utils.emf.talendfile.TalendFileFactory;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.IRepositoryNode.ENodeType;
import org.talend.repository.model.RepositoryNode;
import orgomg.cwm.resource.record.RecordFactory;
import orgomg.cwm.resource.record.RecordFile;
/**
* DOC jding class global comment. Detailled comment
*/
public class UpdateManagerProviderDetectorTest {
@Test
public void testGetAllRelations() throws Exception {
IProxyRepositoryFactory proxyRepositoryFactory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
IRepositoryViewObject contextRepObject = null;
IRepositoryViewObject metadataRepObject = null;
ProcessItem item = null;
ProcessItem item1 = null;
try {
Property property = PropertiesFactory.eINSTANCE.createProperty();
ProcessType process = TalendFileFactory.eINSTANCE.createProcessType();
item = PropertiesFactory.eINSTANCE.createProcessItem();
item.setProperty(property);
item.setProcess(process);
property.setId(proxyRepositoryFactory.getNextId());
property.setLabel("testjob");
property.setVersion("0.1");
ItemState itemState = PropertiesFactory.eINSTANCE.createItemState();
itemState.setPath("");
item.setState(itemState);
Property property1 = PropertiesFactory.eINSTANCE.createProperty();
ProcessType process1 = TalendFileFactory.eINSTANCE.createProcessType();
item1 = PropertiesFactory.eINSTANCE.createProcessItem();
item1.setProperty(property1);
item1.setProcess(process1);
property1.setId(proxyRepositoryFactory.getNextId());
property1.setLabel("testjob");
property1.setVersion("0.1");
ItemState itemState1 = PropertiesFactory.eINSTANCE.createItemState();
itemState1.setPath("");
item.setState(itemState1);
// test property
Property metadataProperty = PropertiesFactory.eINSTANCE.createProperty();
DatabaseConnectionItem metadataItem = PropertiesFactory.eINSTANCE.createDatabaseConnectionItem();
ItemState metadataItemState = PropertiesFactory.eINSTANCE.createItemState();
metadataItemState.setPath("");
metadataItem.setProperty(metadataProperty);
metadataProperty.setId(proxyRepositoryFactory.getNextId());
metadataProperty.setLabel("testMetadata");
metadataProperty.setVersion("0.1");
DatabaseConnection connection = ConnectionFactory.eINSTANCE.createDatabaseConnection();
connection.setName("mysql_1");
connection.setId(proxyRepositoryFactory.getNextId());
metadataItem.setConnection(connection);
RecordFile record = (RecordFile) ConnectionHelper.getPackage(connection.getName(), connection, RecordFile.class);
MetadataTable inputTable = ConnectionFactory.eINSTANCE.createMetadataTable();
inputTable.setId(proxyRepositoryFactory.getNextId());
inputTable.setLabel("Input");
if (record != null) {
PackageHelper.addMetadataTable(inputTable, record);
} else {
RecordFile newrecord = RecordFactory.eINSTANCE.createRecordFile();
newrecord.setName(connection.getName());
ConnectionHelper.addPackage(newrecord, connection);
PackageHelper.addMetadataTable(inputTable, newrecord);
}
proxyRepositoryFactory.create(metadataItem, new Path(""));
proxyRepositoryFactory.save(metadataItem);
RelationshipItemBuilder.getInstance().addRelationShip(item, metadataProperty.getId(),
RelationshipItemBuilder.LATEST_VERSION, RelationshipItemBuilder.PROPERTY_RELATION);
metadataRepObject = proxyRepositoryFactory.getSpecificVersion(metadataProperty.getId(), metadataProperty.getVersion(),
true);
RepositoryNode metadataNode = new RepositoryNode(metadataRepObject, null, ENodeType.REPOSITORY_ELEMENT);
IStructuredSelection metadataSelection = new StructuredSelection(metadataNode);
List relationList = (List) ReflectionUtils.invokeDeclaredMethod(UpdateManagerProviderDetector.INSTANCE,
"getAllRelations", new Object[] { metadataSelection }, IStructuredSelection.class);
Assert.assertEquals(relationList.size(), 1);
// test context
Property contextProperty = PropertiesFactory.eINSTANCE.createProperty();
ContextItem contextItem = PropertiesFactory.eINSTANCE.createContextItem();
ItemState contextItemState = PropertiesFactory.eINSTANCE.createItemState();
contextItemState.setPath("");
contextItem.setProperty(contextProperty);
contextItem.setState(contextItemState);
contextProperty.setId(proxyRepositoryFactory.getNextId());
contextProperty.setLabel("testContext");
contextProperty.setVersion("0.1");
proxyRepositoryFactory.create(contextItem, new Path(""));
proxyRepositoryFactory.save(contextItem);
RelationshipItemBuilder.getInstance().addRelationShip(item, contextProperty.getId(),
RelationshipItemBuilder.LATEST_VERSION, RelationshipItemBuilder.CONTEXT_RELATION);
contextRepObject = proxyRepositoryFactory.getSpecificVersion(contextProperty.getId(), contextProperty.getVersion(),
true);
RepositoryNode contextNode = new RepositoryNode(contextRepObject, null, ENodeType.REPOSITORY_ELEMENT);
IStructuredSelection contextSelection = new StructuredSelection(contextNode);
relationList = (List) ReflectionUtils.invokeDeclaredMethod(UpdateManagerProviderDetector.INSTANCE, "getAllRelations",
new Object[] { contextSelection }, IStructuredSelection.class);
Assert.assertEquals(relationList.size(), 1);
RelationshipItemBuilder.getInstance().addRelationShip(item1, contextProperty.getId(),
RelationshipItemBuilder.LATEST_VERSION, RelationshipItemBuilder.CONTEXT_RELATION);
relationList = (List) ReflectionUtils.invokeDeclaredMethod(UpdateManagerProviderDetector.INSTANCE, "getAllRelations",
new Object[] { contextSelection }, IStructuredSelection.class);
Assert.assertEquals(relationList.size(), 2);
} finally {
if (item !=null) {
RelationshipItemBuilder.getInstance().removeItemRelations(item);
}
if (item1 != null) {
RelationshipItemBuilder.getInstance().removeItemRelations(item1);
}
if (contextRepObject != null) {
proxyRepositoryFactory.deleteObjectPhysical(contextRepObject);
}
if (metadataRepObject != null) {
proxyRepositoryFactory.deleteObjectPhysical(metadataRepObject);
}
}
}
}

View File

@@ -24,7 +24,6 @@ import java.util.List;
import java.util.stream.Collectors;
import org.apache.maven.model.Model;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.Profile;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
@@ -39,7 +38,6 @@ import org.eclipse.m2e.core.MavenPlugin;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.talend.commons.utils.MojoType;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.Project;
@@ -50,7 +48,6 @@ import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.nexus.TalendMavenResolver;
import org.talend.core.repository.model.ProxyRepositoryFactory;
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.projectsetting.ProjectPreferenceManager;
@@ -61,7 +58,6 @@ import org.talend.designer.maven.DesignerMavenPlugin;
import org.talend.designer.maven.model.TalendJavaProjectConstants;
import org.talend.designer.maven.model.TalendMavenConstants;
import org.talend.designer.maven.utils.PomIdsHelper;
import org.talend.designer.maven.utils.PomUtil;
import org.talend.designer.runprocess.IRunProcessService;
import org.talend.repository.ProjectManager;
import org.talend.repository.model.IProxyRepositoryFactory;
@@ -108,44 +104,6 @@ public class AggregatorPomsHelperTest {
defaultUseSnapshot = false;
}
@Test
public void testNeedInstallRootPom() throws Exception {
Model modelBak = null;
File installedPomFile = null;
try {
IFile pomFile = helper.getProjectRootPom();
assertFalse(helper.needInstallRootPom(pomFile));
Model model = MavenPlugin.getMaven().readModel(pomFile.getLocation().toFile());
String mvnUrl = MavenUrlHelper.generateMvnUrl(model.getGroupId(), model.getArtifactId(), model.getVersion(),
MavenConstants.PACKAGING_POM, null);
MavenArtifact artifact = MavenUrlHelper.parseMvnUrl(mvnUrl);
String artifactPath = PomUtil.getAbsArtifactPath(artifact);
installedPomFile = new File(artifactPath);
modelBak = MavenPlugin.getMaven().readModel(installedPomFile);
Model installedModel = MavenPlugin.getMaven().readModel(installedPomFile);
// test ci-builder
Plugin mojo = installedModel.getBuild().getPlugins().stream()
.filter(p -> p.getArtifactId().equals(MojoType.CI_BUILDER.getArtifactId())).findFirst().get();
String versionBak = mojo.getVersion();
mojo.setVersion("1.1.1");
PomUtil.savePom(null, installedModel, installedPomFile);
assertTrue(helper.needInstallRootPom(pomFile));
// test signer
mojo.setVersion(versionBak);
installedModel.getProperties().setProperty(MojoType.SIGNER.getVersionKey(), "1.1.1");
PomUtil.savePom(null, installedModel, installedPomFile);
assertTrue(helper.needInstallRootPom(pomFile));
} finally {
// restore m2 project pom file
if (modelBak != null && installedPomFile != null) {
PomUtil.savePom(null, modelBak, installedPomFile);
}
}
}
@Test
public void testAddToAndRemoveFromParentModules() throws Exception {
String projectTechName = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel();

View File

@@ -37,14 +37,14 @@ public class CreateMavenJobPomTest {
@Test
public void testNormalizeSpaces() throws Exception {
String inputSh = "#!/bin/sh\n" + "cd `dirname $0`\n" + "ROOT_PATH=`pwd`\n"
+ "java -Dtalend.component.manager.m2.repository=$ROOT_PATH/../lib -cp .:$ROOT_PATH:$ROOT_PATH/../lib/routines.jar:$ROOT_PATH/../lib/log4j-slf4j-impl-2.17.1.jar:$ROOT_PATH/../lib/log4j-api-2.17.1.jar:$ROOT_PATH/../lib/log4j-core-2.17.1.jar:$ROOT_PATH/../lib/antlr-runtime-3.5.2.jar:$ROOT_PATH/../lib/org.talend.dataquality.parser.jar:$ROOT_PATH/../lib/crypto-utils.jar:$ROOT_PATH/../lib/talend_file_enhanced-1.1.jar:$ROOT_PATH/../lib/slf4j-api-1.7.25.jar:$ROOT_PATH/../lib/dom4j-2.1.1.jar:$ROOT_PATH/nojvmparam_0_1.jar: local_project.nojvmparam_0_1.noJVMparam --context=Default \"$@\"\n";
+ "java -Dtalend.component.manager.m2.repository=$ROOT_PATH/../lib -cp .:$ROOT_PATH:$ROOT_PATH/../lib/routines.jar:$ROOT_PATH/../lib/log4j-slf4j-impl-2.16.0.jar:$ROOT_PATH/../lib/log4j-api-2.16.0.jar:$ROOT_PATH/../lib/log4j-core-2.16.0.jar:$ROOT_PATH/../lib/antlr-runtime-3.5.2.jar:$ROOT_PATH/../lib/org.talend.dataquality.parser.jar:$ROOT_PATH/../lib/crypto-utils.jar:$ROOT_PATH/../lib/talend_file_enhanced-1.1.jar:$ROOT_PATH/../lib/slf4j-api-1.7.25.jar:$ROOT_PATH/../lib/dom4j-2.1.1.jar:$ROOT_PATH/nojvmparam_0_1.jar: local_project.nojvmparam_0_1.noJVMparam --context=Default \"$@\"\n";
String expectSh = "#!/bin/sh\n" + "cd `dirname $0`\n" + "ROOT_PATH=`pwd`\n"
+ "java -Dtalend.component.manager.m2.repository=$ROOT_PATH/../lib -cp .:$ROOT_PATH:$ROOT_PATH/../lib/routines.jar:$ROOT_PATH/../lib/log4j-slf4j-impl-2.17.1.jar:$ROOT_PATH/../lib/log4j-api-2.17.1.jar:$ROOT_PATH/../lib/log4j-core-2.17.1.jar:$ROOT_PATH/../lib/antlr-runtime-3.5.2.jar:$ROOT_PATH/../lib/org.talend.dataquality.parser.jar:$ROOT_PATH/../lib/crypto-utils.jar:$ROOT_PATH/../lib/talend_file_enhanced-1.1.jar:$ROOT_PATH/../lib/slf4j-api-1.7.25.jar:$ROOT_PATH/../lib/dom4j-2.1.1.jar:$ROOT_PATH/nojvmparam_0_1.jar: local_project.nojvmparam_0_1.noJVMparam --context=Default \"$@\"\n";
+ "java -Dtalend.component.manager.m2.repository=$ROOT_PATH/../lib -cp .:$ROOT_PATH:$ROOT_PATH/../lib/routines.jar:$ROOT_PATH/../lib/log4j-slf4j-impl-2.16.0.jar:$ROOT_PATH/../lib/log4j-api-2.16.0.jar:$ROOT_PATH/../lib/log4j-core-2.16.0.jar:$ROOT_PATH/../lib/antlr-runtime-3.5.2.jar:$ROOT_PATH/../lib/org.talend.dataquality.parser.jar:$ROOT_PATH/../lib/crypto-utils.jar:$ROOT_PATH/../lib/talend_file_enhanced-1.1.jar:$ROOT_PATH/../lib/slf4j-api-1.7.25.jar:$ROOT_PATH/../lib/dom4j-2.1.1.jar:$ROOT_PATH/nojvmparam_0_1.jar: local_project.nojvmparam_0_1.noJVMparam --context=Default \"$@\"\n";
String inputBat = "%~d0\n" + "cd %~dp0\n"
+ "java -Dtalend.component.manager.m2.repository=\"%cd%/../lib\" -cp .;../lib/routines.jar;../lib/log4j-slf4j-impl-2.17.1.jar;../lib/log4j-api-2.17.1.jar;../lib/log4j-core-2.17.1.jar;../lib/antlr-runtime-3.5.2.jar;../lib/org.talend.dataquality.parser.jar;../lib/crypto-utils.jar;../lib/talend_file_enhanced-1.1.jar;../lib/slf4j-api-1.7.25.jar;../lib/dom4j-2.1.1.jar;nojvmparam_0_1.jar; local_project.nojvmparam_0_1.noJVMparam --context=Default %*\n";
+ "java -Dtalend.component.manager.m2.repository=\"%cd%/../lib\" -cp .;../lib/routines.jar;../lib/log4j-slf4j-impl-2.16.0.jar;../lib/log4j-api-2.16.0.jar;../lib/log4j-core-2.16.0.jar;../lib/antlr-runtime-3.5.2.jar;../lib/org.talend.dataquality.parser.jar;../lib/crypto-utils.jar;../lib/talend_file_enhanced-1.1.jar;../lib/slf4j-api-1.7.25.jar;../lib/dom4j-2.1.1.jar;nojvmparam_0_1.jar; local_project.nojvmparam_0_1.noJVMparam --context=Default %*\n";
String expectBat = "%~d0\n" + "cd %~dp0\n"
+ "java -Dtalend.component.manager.m2.repository=\"%cd%/../lib\" -cp .;../lib/routines.jar;../lib/log4j-slf4j-impl-2.17.1.jar;../lib/log4j-api-2.17.1.jar;../lib/log4j-core-2.17.1.jar;../lib/antlr-runtime-3.5.2.jar;../lib/org.talend.dataquality.parser.jar;../lib/crypto-utils.jar;../lib/talend_file_enhanced-1.1.jar;../lib/slf4j-api-1.7.25.jar;../lib/dom4j-2.1.1.jar;nojvmparam_0_1.jar; local_project.nojvmparam_0_1.noJVMparam --context=Default %*\n";
+ "java -Dtalend.component.manager.m2.repository=\"%cd%/../lib\" -cp .;../lib/routines.jar;../lib/log4j-slf4j-impl-2.16.0.jar;../lib/log4j-api-2.16.0.jar;../lib/log4j-core-2.16.0.jar;../lib/antlr-runtime-3.5.2.jar;../lib/org.talend.dataquality.parser.jar;../lib/crypto-utils.jar;../lib/talend_file_enhanced-1.1.jar;../lib/slf4j-api-1.7.25.jar;../lib/dom4j-2.1.1.jar;nojvmparam_0_1.jar; local_project.nojvmparam_0_1.noJVMparam --context=Default %*\n";
String actualSh = CreateMavenJobPom.normalizeSpaces(inputSh);
assertEquals(expectSh, actualSh);

View File

@@ -12,7 +12,6 @@
// ============================================================================
package org.talend.librariesmanager.model;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -20,8 +19,6 @@ import java.util.Set;
import org.junit.Assert;
import org.junit.Test;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.ModuleNeeded.ELibraryInstallStatus;
import org.talend.core.model.general.ModuleStatusProvider;
import org.talend.core.model.properties.PropertiesFactory;
import org.talend.core.model.properties.RoutineItem;
import org.talend.core.model.repository.ERepositoryObjectType;
@@ -96,26 +93,4 @@ public class ModulesNeededProviderTest {
Assert.assertEquals(module1.get(0).getContext(), "Global Routines " + routineItem.getProperty().getLabel());
Assert.assertEquals(module2.get(0).getContext(), "Global Routines " + routineItem.getProperty().getLabel());
}
@Test
public void testInstallModuleForRoutineOrBeans() throws Exception {
ModuleNeeded module1 = new ModuleNeeded("", "ModulesNeededProviderTest", "description", false, null, null,
"mvn:org.talend.librariesmanager.model/ModulesNeededProviderTest/8.0.1");
try {
ModuleStatusProvider.putStatus(module1.getMavenUri(), ELibraryInstallStatus.NOT_INSTALLED);
ModulesNeededProvider.getModulesNeeded().add(module1);
ModulesNeededProvider.checkInstallStatus(Arrays.asList(module1));
Assert.assertTrue("Don't need to rebuild the codes project here",
ModulesNeededProvider.installModuleForRoutineOrBeans() == false);
ModuleStatusProvider.putStatus(module1.getMavenUri(), ELibraryInstallStatus.INSTALLED);
Assert.assertTrue("Need to rebuild the codes project here",
ModulesNeededProvider.installModuleForRoutineOrBeans() == true);
ModulesNeededProvider.setInstallModuleForRoutineOrBeans();
Assert.assertTrue("Don't need to rebuild the codes project here",
ModulesNeededProvider.installModuleForRoutineOrBeans() == false);
} finally {
ModulesNeededProvider.getModulesNeeded().remove(module1);
}
}
}

View File

@@ -60,7 +60,6 @@ import org.talend.core.language.ECodeLanguage;
import org.talend.core.model.components.IComponentsService;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.ModuleNeeded.ELibraryInstallStatus;
import org.talend.core.model.general.ModuleStatusProvider;
import org.talend.core.model.general.Project;
import org.talend.core.nexus.ArtifactRepositoryBean;
import org.talend.core.nexus.NexusServerUtils;
@@ -533,22 +532,6 @@ public class LocalLibraryManagerTest {
assertFalse(lm.isResolveAllowed("a")); //$NON-NLS-1$
}
@Test
public void testResolveLocallySnapshotNoUpdate() {
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(NexusServerUtils.ORG_TALEND_DESIGNER_CORE);
int bak = node.getInt(ITalendCorePrefConstants.NEXUS_REFRESH_FREQUENCY, 0);
String mvnUrl = "mvn:a.b.c/d/1.0/jar";
try {
ModuleStatusProvider.putDeployStatus(mvnUrl, ELibraryInstallStatus.DEPLOYED);
node.putInt(ITalendCorePrefConstants.NEXUS_REFRESH_FREQUENCY, -1);
LocalLibraryManager lm = new LocalLibraryManager();
assertNull(lm.resolveStatusLocally(mvnUrl));
} finally {
node.putInt(ITalendCorePrefConstants.NEXUS_REFRESH_FREQUENCY, bak);
ModuleStatusProvider.putDeployStatus(mvnUrl, ELibraryInstallStatus.NOT_INSTALLED);
}
}
@Test
@Ignore
public void testNexusUpdateJar() throws Exception {

View File

@@ -7,7 +7,6 @@ import static org.junit.Assert.*;
import static org.mockito.Matchers.*;
import static org.mockito.Mockito.*;
import java.lang.reflect.InvocationTargetException;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
@@ -16,17 +15,6 @@ import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.resource.Resource;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -43,10 +31,7 @@ import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
import org.talend.core.model.metadata.builder.connection.MetadataColumn;
import junit.framework.Assert;
import orgomg.cwm.objectmodel.core.CoreFactory;
import orgomg.cwm.objectmodel.core.CorePackage;
import orgomg.cwm.objectmodel.core.Expression;
import orgomg.cwm.objectmodel.core.impl.ExpressionImpl;
/**
* @author zshen
@@ -819,126 +804,6 @@ public class ExtractMetaDataUtilsTest {
verify(initialValue, times(2)).setBody(initialValue.getBody());
}
@Test
public void testHandleDefaultValueWhenOracleNULL() throws SQLException {
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
when(dbMetadata.getDatabaseProductName()).thenReturn("ORACLE");
MetadataColumn metadataColumn = mock(MetadataColumn.class);
when(metadataColumn.getTalendType()).thenReturn("id_String");
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
initialValue.setBody("NULL");
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
Assert.assertEquals(initialValue.getBody(), "NULL");
}
@Test
public void testHandleDefaultValueWhenOraclenull() throws SQLException {
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
when(dbMetadata.getDatabaseProductName()).thenReturn("ORACLE");
MetadataColumn metadataColumn = mock(MetadataColumn.class);
when(metadataColumn.getTalendType()).thenReturn("id_String");
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
initialValue.setBody("null");
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
Assert.assertEquals(initialValue.getBody(), "null");
}
@Test
public void testHandleDefaultValueOracleNullWithQuotes() throws SQLException {
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
when(dbMetadata.getDatabaseProductName()).thenReturn("ORACLE");
MetadataColumn metadataColumn = mock(MetadataColumn.class);
when(metadataColumn.getTalendType()).thenReturn("id_String");
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
initialValue.setBody("'NULL'");
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
Assert.assertEquals(initialValue.getBody(), "'NULL'");
}
@Test
public void testHandleDefaultValueOracleCommon() throws SQLException {
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
when(dbMetadata.getDatabaseProductName()).thenReturn("ORACLE");
MetadataColumn metadataColumn = mock(MetadataColumn.class);
when(metadataColumn.getTalendType()).thenReturn("id_String");
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
initialValue.setBody("abc");
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
Assert.assertEquals(initialValue.getBody(), "'abc'");
}
@Test
public void testHandleDefaultValueWhenMysqlNULL() throws SQLException {
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
when(dbMetadata.getDatabaseProductName()).thenReturn("MySQL");
MetadataColumn metadataColumn = mock(MetadataColumn.class);
when(metadataColumn.getTalendType()).thenReturn("id_String");
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
initialValue.setBody(null);
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
Assert.assertEquals(initialValue.getBody(), null);
}
@Test
public void testHandleDefaultValueMysqlNullWithQuotes() throws SQLException {
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
when(dbMetadata.getDatabaseProductName()).thenReturn("MySQL");
MetadataColumn metadataColumn = mock(MetadataColumn.class);
when(metadataColumn.getTalendType()).thenReturn("id_String");
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
initialValue.setBody("NULL");
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
Assert.assertEquals(initialValue.getBody(), "'NULL'");
}
@Test
public void testHandleDefaultValueMysqlCommon() throws SQLException {
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
when(dbMetadata.getDatabaseProductName()).thenReturn("MySQL");
MetadataColumn metadataColumn = mock(MetadataColumn.class);
when(metadataColumn.getTalendType()).thenReturn("id_String");
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
initialValue.setBody("abc");
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
Assert.assertEquals(initialValue.getBody(), "'abc'");
}
@Test
public void testHandleDefaultValueWhenMssqlNULL() throws SQLException {
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
when(dbMetadata.getDatabaseProductName()).thenReturn("Microsoft SQL Server");
MetadataColumn metadataColumn = mock(MetadataColumn.class);
when(metadataColumn.getTalendType()).thenReturn("id_String");
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
initialValue.setBody("(NULL)");
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
Assert.assertEquals(initialValue.getBody(), "NULL");
}
@Test
public void testHandleDefaultValueMssqlNullWithQuotes() throws SQLException {
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
when(dbMetadata.getDatabaseProductName()).thenReturn("Microsoft SQL Server");
MetadataColumn metadataColumn = mock(MetadataColumn.class);
when(metadataColumn.getTalendType()).thenReturn("id_String");
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
initialValue.setBody("('NULL')");
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
Assert.assertEquals(initialValue.getBody(), "'NULL'");
}
@Test
public void testHandleDefaultValueMssqlCommon() throws SQLException {
DatabaseMetaData dbMetadata = mock(DatabaseMetaData.class);
when(dbMetadata.getDatabaseProductName()).thenReturn("Microsoft SQL Server");
MetadataColumn metadataColumn = mock(MetadataColumn.class);
when(metadataColumn.getTalendType()).thenReturn("id_String");
Expression initialValue = CoreFactory.eINSTANCE.createExpression();
when(metadataColumn.getInitialValue()).thenReturn(initialValue);
initialValue.setBody("abc");
extractMetaManger.handleDefaultValue(metadataColumn, dbMetadata);
Assert.assertEquals(initialValue.getBody(), "'abc'");
}
@Test
public void testGetMultiSchems() {
// null

View File

@@ -56,9 +56,7 @@ public class UpdateToolsTest {
String _3rdBundleNameA = "third.party.a";
String _3rdBundleNameB = "third.party.b";
String _3rdBundleNameC = "third.party.c";
String old3rdVersion = "7.3.1.20180101_0000";
String old3rdVersion2 = "7.3.1.20190101_0000";
String new3rdVersion = "7.3.1.20190701_2222";
Set<IInstallableUnit> validInstall = new HashSet<>();
@@ -70,20 +68,17 @@ public class UpdateToolsTest {
// new third-party patch bundle
validInstall.add(createIU(_3rdBundleNameA, Version.create(new3rdVersion), false));
validInstall.add(createIU(_3rdBundleNameB, Version.create(new3rdVersion), false));
validInstall.add(createIU(_3rdBundleNameC, Version.create(new3rdVersion), false));
// bundles defined in new_feature.index
Map<String, String> extraBundles = new HashMap<>();
extraBundles.put("org.talend.new.c", "");
extraBundles.put("third.party.a", new3rdVersion);
extraBundles.put("third.party.b", new3rdVersion);
extraBundles.put("third.party.c", new3rdVersion);
// drop bundles defined in new_feature.index
Map<String, String> dropBundleInfo = new HashMap<>();
dropBundleInfo.put(_3rdBundleNameA, old3rdVersion);
dropBundleInfo.put(_3rdBundleNameB, old3rdVersion);
dropBundleInfo.put(_3rdBundleNameC, old3rdVersion+"|"+old3rdVersion2);
// create test plugins
createFile(talendBundleNameA, oldTalendVersion, false);
@@ -92,9 +87,6 @@ public class UpdateToolsTest {
createFile(_3rdBundleNameA, new3rdVersion, false);
createFile(_3rdBundleNameB, old3rdVersion, false);
createFile(_3rdBundleNameB, new3rdVersion, false);
createFile(_3rdBundleNameC, old3rdVersion, false);
createFile(_3rdBundleNameC, old3rdVersion2, false);
createFile(_3rdBundleNameC, new3rdVersion, false);
File pluginFolder = UpdateTools.getProductRootFolder().toPath().resolve("plugins").toFile();
File dropFile = new File(pluginFolder, "droplist");
@@ -104,8 +96,6 @@ public class UpdateToolsTest {
pluginsToDrop.add(new File(pluginFolder, talendBundleNameB + "_" + oldTalendVersion));
pluginsToDrop.add(new File(pluginFolder, _3rdBundleNameA + "_" + old3rdVersion + ".jar"));
pluginsToDrop.add(new File(pluginFolder, _3rdBundleNameB + "_" + old3rdVersion + ".jar"));
pluginsToDrop.add(new File(pluginFolder, _3rdBundleNameC + "_" + old3rdVersion + ".jar"));
pluginsToDrop.add(new File(pluginFolder, _3rdBundleNameC + "_" + old3rdVersion2 + ".jar"));
UpdateTools.collectDropBundles(validInstall, extraBundles, dropBundleInfo);