Compare commits

...

19 Commits

Author SHA1 Message Date
jiezhang-tlnd
c158786b83 test 80 cve 2022-08-03 15:24:56 +08:00
Zhiwei Xue
e7ba1d5016 fix(TUP-36175):align bcprov-jdk15on to 1.70 (#5461) 2022-08-02 10:23:42 +08:00
zyuan-talend
ba1ee02e4e Add localized files (#5507)
* Add localized files (#5505)

Co-authored-by: jenkins-git <jenkins-git@talend.com>

* Add localized files (#5506)

Co-authored-by: jenkins-git <jenkins-git@talend.com>

Co-authored-by: jzhangbj <jzhang@talend.com>
Co-authored-by: jenkins-git <jenkins-git@talend.com>
Co-authored-by: tsasada-talend <51699524+tsasada-talend@users.noreply.github.com>
2022-07-29 15:51:09 +08:00
Samuel ANTOINE
a5df51204e feat(TBD-13810): add dynamic schema on thdfsinputformat components (#5442)
* feat(TBD-13810): add dynamic schema on thdfsinputformat components
2022-07-29 07:26:46 +02:00
kjwang
dfe132d87e TUP-36242 jobs changing Hadoop metadata distribution after changing (#5484)
TUP-36242 jobs changing Hadoop metadata distribution after changing project/branch
https://jira.talendforge.org/browse/TUP-36242
2022-07-28 16:03:38 +08:00
jiezhang-tlnd
4c0b9c6f91 feat(TUP-35808)Generate module name from maven url (#5425)
* feat(TUP-35808)Generate module name from maven url

* handle for component and plugin.xml

* handle for component

* move to moduleNeeded.java

* format code

* feat(TUP-35808)Generate module name from maven url

* feat(TUP-35808)Generate module name from maven url

* add junits

* feat(TUP-35808)Generate module name from maven url

* add warning for incorrect module name

* add warning log for module name

* Use MODULE (name in plugin.xml) to build MVN_URI

* handle log

* handle mssql metedata
2022-07-27 18:38:21 +08:00
sbliu
16b6699cc9 feat(TUP-29393) replace nexus connection timeout with default connection timeout (#5475) 2022-07-27 17:42:01 +08:00
jiezhang-tlnd
3f57a592d1 fix(TUP-35446)CVE: org.apache.maven:maven-core:3.8.3 (#5446) 2022-07-27 11:25:19 +08:00
wang wei
74bc5ee66f fix(TDI-48203): [CVE]: routines.system.JSONObject(Object bean) use reflect to call method invoke, that's dangerous for evil script inject (#5426) 2022-07-27 09:29:03 +08:00
sbliu
6a0c96627f fix(TUP-36252) fix NPE for tos studio build job (#5482) 2022-07-26 14:25:12 +08:00
sbliu
ecf339a6ca chore(TUP-35865) upgrade wstx-asl-3.2.9.jar with wstx-core-asl-4.4.1 and stax2-api-4.2.1 (#5438) 2022-07-22 17:28:02 +08:00
Zhiwei Xue
dc5c3d0ec9 fix(TUP-18979):fix junit failure (#5492) 2022-07-22 16:15:34 +08:00
Jane Ding
503924aa75 Jding/add localized files 2022 07 21 (#5488)
* Add localized files (#5486)

Co-authored-by: jenkins-git <jenkins-git@talend.com>

* Add localized files (#5487)

Co-authored-by: jenkins-git <jenkins-git@talend.com>

Co-authored-by: Alexiane Yvonet <ayvonet@talend.com>
Co-authored-by: jenkins-git <jenkins-git@talend.com>
Co-authored-by: tsasada-talend <51699524+tsasada-talend@users.noreply.github.com>
2022-07-21 17:43:39 +08:00
hzhao-talendbj
4ed461840a fix jackson cve (#5480) 2022-07-19 20:37:51 +08:00
hzhao-talendbj
cafa72f52a Revert "chore(TUP-35265): upgrade 'crypto-utils' jar in low level (#5372)" (#5476)
This reverts commit aed39722eb.
2022-07-19 16:25:28 +08:00
pyzhou
af62f01007 fix(TDI-48024): ResumeUtil performance issue (#5458)
* fix(TDI-48024): ResumeUtil performance issue

* NPE
2022-07-19 12:01:41 +08:00
zyuan-talend
5e4b9311a9 fix(TUP-36231,TUP31721): deploy libs from custom component. (#5468) (#5473) 2022-07-19 10:07:24 +08:00
Zhiwei Xue
a6164bf006 fix(TUP-18979):fix sync mapping file error of job project (#5470) 2022-07-18 16:55:14 +08:00
sbliu
24622068ec chore(TUP-35863) remove lower version of maven-settings (#5419)
* chore(TUP-35863) remove lower version of maven-settings
2022-07-18 09:44:36 +08:00
44 changed files with 316 additions and 288 deletions

View File

@@ -5,7 +5,7 @@
<copyright url="http://www.example.com/copyright">[Enter Copyright Description here.]</copyright>
<license url="http://www.example.com/license">[Enter License Description here.]</license>
<requires>
<import plugin="org.bouncycastle.bcprov" version="1.69.0" match="greaterOrEqual"/>
<import plugin="org.bouncycastle.bcprov" version="1.70.0" match="greaterOrEqual"/>
<import plugin="com.cedarsoftware.json-io" version="0.0.0" match="greaterOrEqual"/>
<import plugin="com.fasterxml.jackson.core.jackson-annotations" version="2.9.0" match="greaterOrEqual"/>
<import plugin="com.fasterxml.jackson.core.jackson-core" version="2.9.8" match="greaterOrEqual"/>

View File

@@ -52,6 +52,10 @@ public final class CommonExceptionHandler {
log.log(Level.WARN, message);
}
public static void error(String message) {
log.log(Level.ERROR, message);
}
/**
* Return priority corresponding to the exception implementation.
*

View File

@@ -1,18 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2021 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.commons.utils.network;
public interface ITalendNexusPrefConstants {
public static final String NEXUS_TIMEOUT = "NEXUS_TIMEOUT"; //$NON-NLS-1$
}

View File

@@ -55,6 +55,11 @@ public class NetworkUtil {
private static final int DEFAULT_NEXUS_TIMEOUT = 20000;// same as preference value
public static final String ORG_TALEND_DESIGNER_CORE = "org.talend.designer.core"; //$NON-NLS-1$
/*
* see ITalendCorePrefConstants.PERFORMANCE_TAC_READ_TIMEOUT
*/
private static final String PERFORMANCE_TAC_READ_TIMEOUT = "PERFORMANCE_TAC_READ_TIMEOUT"; //$NON-NLS-1$
private static final String PROP_DISABLEDSCHEMES_USE_DEFAULT = "talend.studio.jdk.http.auth.tunneling.disabledSchemes.useDefault";
@@ -149,10 +154,10 @@ public class NetworkUtil {
}
public static int getNexusTimeout() {
int timeout = DEFAULT_NEXUS_TIMEOUT;
int timeout = Integer.getInteger("nexus.timeout.min", DEFAULT_NEXUS_TIMEOUT);
try {
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(ORG_TALEND_DESIGNER_CORE);
timeout = node.getInt(ITalendNexusPrefConstants.NEXUS_TIMEOUT, DEFAULT_NEXUS_TIMEOUT);
timeout = Math.max(timeout, node.getInt(PERFORMANCE_TAC_READ_TIMEOUT, 0) * 1000);
} catch (Throwable e) {
ExceptionHandler.process(e);
}

View File

@@ -93,6 +93,7 @@ import org.talend.core.context.CommandLineContext;
import org.talend.core.context.Context;
import org.talend.core.context.RepositoryContext;
import org.talend.core.exception.TalendInternalPersistenceException;
import org.talend.core.hadoop.BigDataBasicUtil;
import org.talend.core.hadoop.IHadoopDistributionService;
import org.talend.core.model.components.IComponentsService;
import org.talend.core.model.general.ILibrariesService;
@@ -2209,6 +2210,9 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
ExceptionHandler.process(e);
}
// init dynamic distirbution after `beforeLogon`, before loading libraries.
initDynamicDistribution(monitor);
// need to set m2
LoginTaskRegistryReader loginTaskRegistryReader = new LoginTaskRegistryReader();
ILoginTask[] allLoginTasks = loginTaskRegistryReader.getAllCommandlineTaskListInstance();
@@ -2404,6 +2408,18 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
throw e;
}
}
private void initDynamicDistribution(IProgressMonitor monitor) {
try {
if (BigDataBasicUtil.isDynamicDistributionLoaded(monitor)) {
BigDataBasicUtil.reloadAllDynamicDistributions(monitor);
} else {
BigDataBasicUtil.loadDynamicDistribution(monitor);
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
// to fix the ops4j and m2e.core maven handler conflict issue TUP-31484
private void unregisterM2EServiceBeforeLogon() {

View File

@@ -156,6 +156,8 @@ public interface ILibraryManagerService extends IService {
public void clearCache();
public void clearCache(boolean cleanIndex);
public void deployLibsFromCustomComponents();
@Deprecated
public Set<String> list(boolean withComponent, IProgressMonitor... monitorWrap);

View File

@@ -83,7 +83,8 @@ public enum EDatabaseVersion4Drivers {
"Microsoft SQL Server 2012", "Microsoft SQL Server 2012", "jtds-1.3.1-patch-20190523.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
MSSQL_PROP(new DbVersion4Drivers(EDatabaseTypeName.MSSQL,
"Microsoft", "MSSQL_PROP", //$NON-NLS-1$ //$NON-NLS-2$
new String[] { "mssql-jdbc.jar", "slf4j-api-1.7.29.jar", "slf4j-log4j12-1.7.29.jar", "msal4j-1.11.0.jar", //$NON-NLS-1$
new String[] { "mssql-jdbc-actual.jar", "slf4j-api-1.7.29.jar", "slf4j-log4j12-1.7.29.jar", //$NON-NLS-1$
"msal4j-1.11.0.jar",
"oauth2-oidc-sdk-9.7.jar", "reload4j-1.2.19.jar", "jackson-core-2.13.2.jar",
"jackson-databind-2.13.2.2.jar", "jackson-annotations-2.13.2.jar", "jcip-annotations-1.0-1.jar",
"json-smart-2.4.7.jar", "nimbus-jose-jwt-9.22.jar", "accessors-smart-2.4.7.jar", "asm-9.1.jar",

View File

@@ -13,17 +13,16 @@
package org.talend.core.model.general;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.runtime.Path;
import org.osgi.framework.Version;
import org.talend.commons.CommonsPlugin;
import org.talend.commons.exception.CommonExceptionHandler;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ILibraryManagerService;
@@ -108,7 +107,7 @@ public class ModuleNeeded {
private Map<String, String> attributes;
ILibraryManagerService libManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault()
ILibraryManagerService libManagerService = GlobalServiceRegister.getDefault()
.getService(ILibraryManagerService.class);
@@ -369,7 +368,7 @@ public class ModuleNeeded {
}
public ELibraryInstallStatus getStatus() {
ILibraryManagerService libManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault()
ILibraryManagerService libManagerService = GlobalServiceRegister.getDefault()
.getService(ILibraryManagerService.class);
libManagerService.checkModuleStatus(this);
String mvnUriStatusKey = getMavenUri();
@@ -378,7 +377,7 @@ public class ModuleNeeded {
}
public ELibraryInstallStatus getDeployStatus() {
ILibraryManagerService libManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault()
ILibraryManagerService libManagerService = GlobalServiceRegister.getDefault()
.getService(ILibraryManagerService.class);
libManagerService.checkModuleStatus(this);
String mvnUriStatusKey = getMavenUri();
@@ -715,6 +714,19 @@ public class ModuleNeeded {
if (!StringUtils.isEmpty(mavenUriFromConfiguration)) {
this.mavenUri = mavenUriFromConfiguration;
}
String generateModuleName = MavenUrlHelper.generateModuleNameByMavenURI(this.mavenUri);
if (StringUtils.isNotBlank(generateModuleName)) {
if (!StringUtils.equals(getModuleName(), generateModuleName)) {
if (CommonsPlugin.isDebugMode() && StringUtils.isNotBlank(this.context)) {
CommonExceptionHandler
.warn("module name definition should be " + generateModuleName + ", not " + getModuleName()
+ " :" + this.context);
}
setModuleName(generateModuleName);
}
}
}
public boolean usedByDynamicDistribution() {

View File

@@ -25,6 +25,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
@@ -515,14 +516,15 @@ public final class MetadataTalendType {
try {
Map<String, File> targetFileMap = Stream.of(arr).collect(Collectors.toMap(File::getName, Function.identity()));
Map<String, File> workingFileMap = getWorkingMappingFiles().stream()
.collect(Collectors.toMap(File::getName, Function.identity()));
.collect(Collectors.toMap(f -> getTargetName(f, rename), Function.identity(), (f1, f2) -> f1));
targetFileMap.entrySet().stream().filter(entry -> !workingFileMap.containsKey(entry.getKey()))
.forEach(entry -> entry.getValue().delete());
for (File workingMappingFile : workingFileMap.values()) {
for (Entry<String, File> entry : workingFileMap.entrySet()) {
String targetName = entry.getKey();
File workingMappingFile = entry.getValue();
boolean needUpdate = false;
String targetName = getTargetName(workingMappingFile, rename);
File targetMappingFile = targetFileMap.get(targetName);
if (targetMappingFile == null) {
targetMappingFile = new File(target, targetName);

View File

@@ -16,7 +16,10 @@ public class SparkBatchMetadataTalendTypeFilter extends SparkMetadataTalendTypeF
"tFileInputParquet",
"tFileOutputParquet",
"tJDBCInput",
"tJDBCOutput", "tLogRow", "tSqlRow"
"tJDBCOutput",
"tLogRow",
"tSqlRow",
"tFileInputDelimited"
);
public SparkBatchMetadataTalendTypeFilter(INode node) {

View File

@@ -12,8 +12,6 @@
// ============================================================================
package org.talend.core.prefs;
import org.talend.commons.utils.network.ITalendNexusPrefConstants;
/**
* Core preferences. Detailled comment <br/>
*
@@ -187,8 +185,6 @@ public interface ITalendCorePrefConstants {
public static final String PERFORMANCE_JAVA_PROCESS_CODE_FORMATE_TIMEOUT = "PERFORMANCE_JAVA_PROCESS_CODE_FORMATE_TIMEOUT"; //$NON-NLS-1$
public static final String NEXUS_TIMEOUT = ITalendNexusPrefConstants.NEXUS_TIMEOUT;
public static final String NEXUS_REFRESH_FREQUENCY = "NEXUS_REFRESH_FREQUENCY"; //$NON-NLS-1$
/**

View File

@@ -402,7 +402,7 @@ repository.SAPIDoc=SAP iDoc
repository.SAPTable=SAP\u30C6\u30FC\u30D6\u30EB
repository.metadataSQLPatterns=SQL\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8
repository.metadataSQLPatterns.alias=SQLTemplates
repository.metadataFileDelimited=\u533A\u5207\u308A\u6587\u5B57\u4ED8\u304D\u30D5\u30A1\u30A4\u30EB
repository.metadataFileDelimited=\u533A\u5207\u308A\u4ED8\u304D\u30D5\u30A1\u30A4\u30EB
repository.metadataFileDelimited.alias=DELIM
repository.metadataTable=\u30E1\u30BF\u30C7\u30FC\u30BF\u30B9\u30AD\u30FC\u30DE
repository.metadataColumn=\u30E1\u30BF\u30C7\u30FC\u30BF\u30AB\u30E9\u30E0

View File

@@ -309,7 +309,7 @@ repository.metadataSAPConnections.alias=SAP
repository.SAPFunction=SAP\u30D5\u30A1\u30F3\u30AF\u30B7\u30E7\u30F3
repository.metadataSQLPatterns=SQL\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8
repository.metadataSQLPatterns.alias=SQLTemplates
repository.metadataFileDelimited=\u533A\u5207\u308A\u6587\u5B57\u4ED8\u304D\u30D5\u30A1\u30A4\u30EB
repository.metadataFileDelimited=\u533A\u5207\u308A\u4ED8\u304D\u30D5\u30A1\u30A4\u30EB
repository.metadataFileDelimited.alias=DELIM
repository.metadataFileLdif=LDIF\u30D5\u30A1\u30A4\u30EB
repository.metadataFileLdif.alias=LDIF

View File

@@ -33,7 +33,7 @@ public class TalendDataCollectorPreferenceInitializer extends AbstractPreference
IPreferenceStore preferenceStore = CoreUIPlugin.getDefault().getPreferenceStore();
preferenceStore.setDefault(ITalendCorePrefConstants.DATA_COLLECTOR_ENABLED, true);
preferenceStore.setDefault(ITalendCorePrefConstants.DATA_COLLECTOR_UPLOAD_PERIOD, 5);
if(IRemoteService.get().isCloudConnection()) {
if(IRemoteService.get() != null && IRemoteService.get().isCloudConnection()) {
preferenceStore.setValue(ITalendCorePrefConstants.DATA_COLLECTOR_ENABLED, true);
}
}

View File

@@ -47,7 +47,7 @@ public class TalendDataCollectorPreferencePage extends FieldEditorPreferencePage
@Override
protected void createFieldEditors() {
if(!IRemoteService.get().isCloudConnection()) {
if(!(IRemoteService.get() != null && IRemoteService.get().isCloudConnection())) {
addField(new BooleanFieldEditor(ITalendCorePrefConstants.DATA_COLLECTOR_ENABLED,
Messages.getString("TalendDataCollectorPreferencePage_EnableCapture"), getFieldEditorParent())); //$NON-NLS-1$
}

View File

@@ -113,12 +113,12 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.68</version>
<version>1.70</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.0</version>
<version>2.13.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>

View File

@@ -84,12 +84,12 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.68</version>
<version>1.70</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.0</version>
<version>2.13.2.2</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>

View File

@@ -38,7 +38,7 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.68</version>
<version>1.70</version>
</dependency>
</dependencies>
<build>

View File

@@ -13,7 +13,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>org.eclipse.tycho</groupId>

View File

@@ -32,7 +32,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
@@ -123,7 +123,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>

View File

@@ -24,195 +24,22 @@
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.6.8</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.datastax.oss</groupId>
<artifactId>java-driver-bom</artifactId>
<version>4.13.0</version>
<type>pom</type>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-parent</artifactId>
<version>4.2.9</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-bom</artifactId>
<version>4.2.9</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-bom</artifactId>
<version>3.0.10</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-parent</artifactId>
<version>36</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-build-configuration-parent</artifactId>
<version>12.1.11.Final</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-bom</artifactId>
<version>12.1.11.Final</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.13.3</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>2.35</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-bom</artifactId>
<version>9.4.46.v20220331</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.8.2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-bom</artifactId>
<version>1.6.21</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-bom</artifactId>
<version>1.5.2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.logging</groupId>
<artifactId>logging-parent</artifactId>
<version>5</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-bom</artifactId>
<version>2.17.2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>24</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-bom</artifactId>
<version>1.8.6</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-bom</artifactId>
<version>4.1.77.Final</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc-bom</artifactId>
<version>21.3.0.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>parent</artifactId>
<version>0.12.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_bom</artifactId>
<version>0.12.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-bom</artifactId>
<version>5.0.0</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.r2dbc</groupId>
<artifactId>r2dbc-bom</artifactId>
<version>Arabba-SR13</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-bom</artifactId>
<version>2020.0.19</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>io.rsocket</groupId>
<artifactId>rsocket-bom</artifactId>
<version>1.1.2</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-bom</artifactId>
<version>2021.1.4</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>5.3.20</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-bom</artifactId>
<version>5.5.12</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-bom</artifactId>
<version>5.6.5</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-bom</artifactId>
<version>2021.1.3</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>

View File

@@ -58,7 +58,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
@@ -68,7 +68,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
@@ -100,7 +100,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
@@ -147,7 +147,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
@@ -199,12 +199,12 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.8.3</version>
<version>3.8.6</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
@@ -228,6 +228,11 @@
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
<version>3.8.3</version>
</dependency>
</dependencies>
</plugin>
<plugin>
@@ -254,7 +259,12 @@
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.8.0</version>
</dependency>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
<version>3.8.3</version>
</dependency>
</dependencies>
</plugin>
<plugin>
@@ -267,6 +277,11 @@
<artifactId>plexus-utils</artifactId>
<version>3.0.24</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
<version>3.8.3</version>
</dependency>
</dependencies>
</plugin>
</plugins>

View File

@@ -122,7 +122,7 @@ public class TalendMavenLaunchDelegate extends JavaLaunchDelegate implements Mav
this.extensionsSupport = MavenLaunchExtensionsSupport.create(configuration, launch);
log.info("" + getWorkingDirectory(configuration)); //$NON-NLS-1$
log.info(" mvn" + getProgramArguments(configuration, IRemoteService.get().isCloudConnection())); //$NON-NLS-1$
log.info(" mvn" + getProgramArguments(configuration, IRemoteService.get() == null ? false: IRemoteService.get().isCloudConnection())); //$NON-NLS-1$
this.programArguments = null;
extensionsSupport.configureSourceLookup(configuration, launch, monitor);

View File

@@ -128,7 +128,7 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
if (ProcessUtils.isTestContainer(process)) {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
ITestContainerProviderService testService = (ITestContainerProviderService) GlobalServiceRegister.getDefault()
ITestContainerProviderService testService = GlobalServiceRegister.getDefault()
.getService(ITestContainerProviderService.class);
try {
property = testService.getParentJobItem(property.getItem()).getProperty();
@@ -231,7 +231,7 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
Dependency mavenCoreDep = new Dependency();
mavenCoreDep.setGroupId("org.apache.maven");
mavenCoreDep.setArtifactId("maven-core");
mavenCoreDep.setVersion("3.8.3");
mavenCoreDep.setVersion("3.8.6");
shade.getDependencies().add(guavaDep);
shade.getDependencies().add(codecDep);
@@ -454,6 +454,7 @@ public abstract class AbstractMavenProcessorPom extends CreateMavenBundleTemplat
*
* @param hasLoopDependency the hasLoopDependency to set
*/
@Override
public void setHasLoopDependency(boolean hasLoopDependency) {
this.hasLoopDependency = hasLoopDependency;
}

View File

@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/stax2-api-4.2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/woodstox-core-asl-4.4.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/woden-api-1.0M9.jar"/>
<classpathentry exported="true" kind="lib" path="lib/axiom-api-1.2.13.jar"/>
<classpathentry exported="true" kind="lib" path="lib/axiom-impl-1.2.13.jar"/>
<classpathentry exported="true" kind="lib" path="lib/geronimo-stax-api_1.0_spec-1.0.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/httpcore-4.0.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/neethi-3.0.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/wstx-asl-3.2.9.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xmlschema-core-2.2.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>

View File

@@ -20,12 +20,13 @@ Bundle-ClassPath: lib/axiom-api-1.3.0.jar,
lib/geronimo-stax-api_1.0_spec-1.0.1.jar,
lib/mail-1.4.jar,
lib/neethi-3.0.1.jar,
lib/wstx-asl-3.2.9.jar,
lib/xmlschema-core-2.2.1.jar,
lib/woden-api-1.0M9.jar,
lib/axis2-codegen-1.8.0.jar,
lib/axis2-java2wsdl-1.8.0.jar,
lib/axis2-metadata-1.8.0.jar,
lib/woodstox-core-asl-4.4.1.jar,
lib/stax2-api-4.2.1.jar,
.
Export-Package: com.ctc.wstx.api,
com.ctc.wstx.cfg,

View File

@@ -80,6 +80,16 @@
<groupId>org.apache.ws.commons.axiom</groupId>
<artifactId>axiom-impl</artifactId>
<version>1.3.0</version>
</artifactItem>
<artifactItem>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>woodstox-core-asl</artifactId>
<version>4.4.1</version>
</artifactItem>
<artifactItem>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>stax2-api</artifactId>
<version>4.2.1</version>
</artifactItem>
</artifactItems>
</configuration>

View File

@@ -243,10 +243,37 @@ public class JSONObject {
*
* @param bean An object that has getter methods that should be used to make a JSONObject.
*/
@Deprecated
public JSONObject(Object bean) {
this();
populateMap(bean);
}
/**
* Construct a JSONObject from an Object using bean getters. It reflects on all of the public methods of the object.
* For each of the methods with no parameters and a name starting with <code>"get"</code> or <code>"is"</code>
* followed by an uppercase letter, the method is invoked, and a key and the value returned from the getter method
* are put into the new JSONObject.
*
* The key is formed by removing the <code>"get"</code> or <code>"is"</code> prefix. If the second remaining
* character is not upper case, then the first character is converted to lower case.
*
* For example, if an object has a method named <code>"getName"</code>, and if the result of calling
* <code>object.getName()</code> is <code>"Larry Fine"</code>, then the JSONObject will contain
* <code>"name": "Larry Fine"</code>.
*
* @param bean An object that has getter methods that should be used to make a JSONObject.
* @param expectedClass Bean must be the instance of this class, for safe to avoid evil script inject
*/
public JSONObject(Object bean, Class<?> expectedClass) {
this();
if(bean.getClass() != expectedClass) {
throw new JSONException("expectedClass doesn't match the bean or is null");
}
populateMap(bean);
}
/**
* Construct a JSONObject from an Object, using reflection to find the public members. The resulting JSONObject's

View File

@@ -105,7 +105,7 @@ public class ResumeUtil {
csvWriter.write("stackTrace");// stackTrace
csvWriter.write("dynamicData");// dynamicData
csvWriter.endRecord();
csvWriter.flush();
csvWriter.flush(true);
}
// shared
sharedWriterMap.put(this.root_pid, this.csvWriter);
@@ -171,7 +171,7 @@ public class ResumeUtil {
csvWriter.write(item.stackTrace);// stackTrace
csvWriter.write(item.dynamicData);// dynamicData--->it is the 17th field. @see:feature:11296
csvWriter.endRecord();
csvWriter.flush();
csvWriter.flush(false);
fileLock.release();
}
// for test the order
@@ -193,6 +193,12 @@ public class ResumeUtil {
}
}
}
public void flush() {
if(csvWriter != null) {
csvWriter.flush(true);
}
}
// Util: invoke target check point
@Deprecated
@@ -353,13 +359,12 @@ public class ResumeUtil {
String str = out.toString();
return str;
}
// to support encrypt the password in the resume
public static String convertToJsonText(Object context, List<String> parametersToEncrypt) {
public static String convertToJsonText(Object context, Class<?> expectedClass, List<String> parametersToEncrypt) {
String jsonText = "";
try {
JSONObject firstNode = new JSONObject();
JSONObject secondNode = new JSONObject(context);
JSONObject secondNode = new JSONObject(context, expectedClass);
if (parametersToEncrypt != null) {
for (String parameterToEncrypt : parametersToEncrypt) {
if (secondNode.isNull(parameterToEncrypt)) {
@@ -379,9 +384,15 @@ public class ResumeUtil {
return jsonText;
}
// to support encrypt the password in the resume
@Deprecated
public static String convertToJsonText(Object context, List<String> parametersToEncrypt) {
return convertToJsonText(context, context == null ? null : context.getClass(), parametersToEncrypt);
}
// Util: convert the context variable to json style text.
// feature:11296
// @Deprecated
@Deprecated
public static String convertToJsonText(Object context) {
return convertToJsonText(context, null);
}
@@ -459,6 +470,8 @@ public class ResumeUtil {
USER_DEF_LOG,
JOB_ENDED;
}
/**
* this class is reference with CsvWriter.
@@ -503,7 +516,10 @@ public class ResumeUtil {
private String lineSeparator = System.getProperty("line.separator");
private int capibility = 2<<14; //32k
private int capibility = 2 << 22; //8M
private int FLUSH_FACTOR = 6 *1024 *1024; //6M
public SimpleCsvWriter(FileChannel channel) {
this.channel = channel;
@@ -534,10 +550,8 @@ public class ResumeUtil {
}
byte[] contentByte = content.getBytes();
if(contentByte.length > capibility - 1024) {
flush();
capibility = contentByte.length * 2;
buf = ByteBuffer.allocate(capibility);
if(contentByte.length > capibility - buf.position()) {
flush(true);
}
buf.put(contentByte);
@@ -562,18 +576,20 @@ public class ResumeUtil {
/**
* flush
*/
public void flush() {
try {
((Buffer) buf).flip();
channel.position(channel.size());
while(buf.hasRemaining()) {
channel.write(buf);
public void flush(boolean force) {
if(force || buf.position() > FLUSH_FACTOR) {
try {
((Buffer) buf).flip();
channel.position(channel.size());
while(buf.hasRemaining()) {
channel.write(buf);
}
channel.force(true);
((Buffer) buf).clear();
} catch (IOException e) {
e.printStackTrace();
}
channel.force(true);
((Buffer) buf).clear();
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**

View File

@@ -25,6 +25,7 @@ import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IContributor;
import org.talend.commons.exception.CommonExceptionHandler;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.workbench.extensions.ExtensionImplementationProvider;
import org.talend.commons.utils.workbench.extensions.ExtensionPointLimiterImpl;
@@ -109,7 +110,7 @@ public class ExtensionModuleManager {
private ExtensionModuleManager() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
libManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault().getService(
libManagerService = GlobalServiceRegister.getDefault().getService(
ILibraryManagerService.class);
}
moduleGroupElementsCache = new ArrayList<>();
@@ -186,6 +187,13 @@ public class ExtensionModuleManager {
if (!StringUtils.isEmpty(importType.getMVN())) {
moduleNeeded.setMavenUri(importType.getMVN());
}
if (StringUtils.isBlank(importType.getMVN())) {
if (importType.getMODULE() != null) {
CommonExceptionHandler.error("Missing module MVN_URI definition: " + importType.getMODULE());
}
}
if (importType.getUrlPath() != null && libManagerService.checkJarInstalledFromPlatform(importType.getUrlPath())) {
moduleNeeded.setModuleLocaion(importType.getUrlPath());
}

View File

@@ -30,6 +30,7 @@ import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.emf.common.util.EList;
import org.talend.commons.CommonsPlugin;
import org.talend.commons.exception.CommonExceptionHandler;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
@@ -129,10 +130,10 @@ public class ModulesNeededProvider {
static {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRepositoryService.class)) {
repositoryService = (IRepositoryService) GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
repositoryService = GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
}
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerService.class)) {
libManagerService = (ILibraryManagerService) GlobalServiceRegister.getDefault()
libManagerService = GlobalServiceRegister.getDefault()
.getService(ILibraryManagerService.class);
}
}
@@ -330,15 +331,17 @@ public class ModulesNeededProvider {
.collect(Collectors.toList());
}
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,
boolean isExtComponentProvider) {
collectModuleNeeded(context, importType, importNeedsList, null, isExtComponentProvider);
}
public static void collectModuleNeeded(String context, IMPORTType importType, List<ModuleNeeded> importNeedsList, String distribution) {
public static void collectModuleNeeded(String context, IMPORTType importType, List<ModuleNeeded> importNeedsList,
String distribution, boolean isExtComponentProvider) {
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, distribution, isExtComponentProvider);
} else {
if (!StringUtils.isEmpty(distribution)) {
importModuleFromExtension.forEach(m -> m.setDynamicDistributionVersion(distribution));
@@ -348,17 +351,29 @@ 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, boolean isExtComponentProvider) {
createModuleNeededForComponent(context, importType, importNeedsList, null, isExtComponentProvider);
}
public static void createModuleNeededForComponent(String context, IMPORTType importType, List<ModuleNeeded> importNeedsList, String distribution) {
public static void createModuleNeededForComponent(String context, IMPORTType importType,
List<ModuleNeeded> importNeedsList, String distribution, boolean isExtComponentProvider) {
if (importType.getMODULE() == null) {
if (importType.getMODULEGROUP() != null) {
CommonExceptionHandler.warn("Missing module group definition: " + importType.getMODULEGROUP());
}
return;
}
if (StringUtils.isBlank(importType.getMVN())) {
if (importType.getMODULE() != null) {
if (isExtComponentProvider) {
CommonExceptionHandler.warn("Missing module MVN_URI definition: " + importType.getMODULE());
} else {
CommonExceptionHandler.error("Missing module MVN_URI definition: " + importType.getMODULE());
}
}
}
String msg = importType.getMESSAGE();
if (msg == null) {
msg = Messages.getString("modules.required"); //$NON-NLS-1$
@@ -702,7 +717,7 @@ public class ModulesNeededProvider {
if (!GlobalServiceRegister.getDefault().isServiceRegistered(ILibrariesService.class)) {
return null;
}
service = (ILibrariesService) GlobalServiceRegister.getDefault().getService(ILibrariesService.class);
service = GlobalServiceRegister.getDefault().getService(ILibrariesService.class);
if (importNeedsListForRoutes.isEmpty()) {
@@ -730,7 +745,7 @@ public class ModulesNeededProvider {
if (!GlobalServiceRegister.getDefault().isServiceRegistered(ILibrariesService.class)) {
return null;
}
service = (ILibrariesService) GlobalServiceRegister.getDefault().getService(ILibrariesService.class);
service = GlobalServiceRegister.getDefault().getService(ILibrariesService.class);
if (importNeedsListForCamelCore.isEmpty()) {
@@ -766,7 +781,7 @@ public class ModulesNeededProvider {
importType.setMODULEGROUP("esb-java-11-group");
importType.setREQUIRED(true);
collectModuleNeeded("tRESTClient", importType, importNeedsListForRoutes);
collectModuleNeeded("tRESTClient", importType, importNeedsListForRoutes, false);
}
/**
@@ -868,6 +883,16 @@ public class ModulesNeededProvider {
if (!StringUtils.isEmpty(mvn_rui)) {
module.setMavenUri(mvn_rui);
}
if (CommonsPlugin.isDebugMode() && StringUtils.isBlank(mvn_rui)) {
if (StringUtils.isNotBlank(module.getModuleName())) {
if (StringUtils.isNotBlank(context)) {
CommonExceptionHandler
.error("Missing module MVN_URI definition: " + context + ": " + module.getModuleName());
}
}
}
module.setMavenUri(mvn_rui);
String excludeDependencies = current.getAttribute(ExtensionModuleManager.EXCLUDE_DEPENDENCIES_ATTR);
module.setExcludeDependencies(Boolean.valueOf(excludeDependencies));

View File

@@ -202,6 +202,9 @@ public class JavaLibrariesService extends AbstractLibrariesService {
if (!repositoryBundleService.isInitialized()) {
// 2. Components libraries and libraries from extension
repositoryBundleService.createModulesIndexFromComponentAndExtension(monitorWrap);
} else {
//TUP-31721 & TUP-36231:Handle the custom components deployment when studio index is not re-generated.
repositoryBundleService.deployLibsFromCustomComponents();
}
repositoryBundleService.installModules(ModulesNeededProvider.getSystemRunningModules(), null);

View File

@@ -247,6 +247,7 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
}
}
@Override
public void guessMavenRUIFromIndex(File jarFile, Map<String, String> sourceAndMavenUri) {
guessMavenRUIFromIndex(jarFile, false, sourceAndMavenUri);
@@ -1301,6 +1302,7 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
buildModulesIndexFromComponentAndExtension(monitorWrap);
}
@Override
public Map<String, String> buildModulesIndexFromComponentAndExtension(IProgressMonitor... monitorWrap) {
// key: moduleName, value: platformURL
Map<String, String> platformURLMap = new HashMap<>();
@@ -1352,6 +1354,21 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
}
return mavenURIMap;
}
public void deployLibsFromCustomComponents() {
IComponentsService service = null;
if (GlobalServiceRegister.getDefault().isServiceRegistered(IComponentsService.class)) {
service = GlobalServiceRegister.getDefault().getService(IComponentsService.class);
}
if (service != null) {
Map<String, String> platformURLMap = new HashMap<>();
platformURLMap = LibrariesIndexManager.getInstance().getAllStudioLibsFromIndex();
// Need to read components first, otherwise FiltUtils.getFilesFromFolderByName() returns empty for custom
// component folder.
service.getComponentsFactory().readComponents();
deployLibsFromCustomComponents(service, platformURLMap);
}
}
/**
*
@@ -1400,7 +1417,7 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
}
}
private boolean isExtComponentProvider(String id) {
public static boolean isExtComponentProvider(String id) {
if ("org.talend.designer.components.model.UserComponentsProvider".equals(id)
|| "org.talend.designer.codegen.components.model.SharedStudioUserComponentProvider".equals(id)
|| "org.talend.designer.components.exchange.ExchangeComponentsProvider".equals(id)
@@ -1730,6 +1747,7 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
return isSameFile(jarFile, jarInLib);
}
@Override
public boolean isSameFile(File f1, File f2) {
if (f1 == null || f2 == null) {
return false;

View File

@@ -549,5 +549,5 @@ MetadataTalendTypeEditor.confirmMessage=Voulez-vous remplacer les param\u00E8tre
PromptDialog.title=Ex\u00E9cuter le contexte {0} avec les param\u00E8tres\u00A0:
PromptDialog.stringTip=Le texte d'entr\u00E9e doit \u00EAtre entour\u00E9 par des guillemets.
PromptDialog.choose.title=Choisissez un contexte
PromptDialog.promptGroup.name=Variables \u00E0 compl\u00E9ter
PromptDialog.variablePrompts.name=Variables
PromptDialog.context.environments.name=Environnement

View File

@@ -510,10 +510,12 @@ InegerCellEditorListener.NumeralMessage=\u5165\u529B\u5024\u304C\u7121\u52B9\u30
MetadataTalendTypeEditor.button.edit=\u7DE8\u96C6(&D)
MetadataTalendTypeEditor.button.export=\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8(&X)
MetadataTalendTypeEditor.button.import=\u30A4\u30F3\u30DD\u30FC\u30C8(&M)
MetadataTalendTypeEditor.button.restore=\u5FA9\u5143(&E)
MetadataTalendTypeEditor.column1.Name=\u30E1\u30BF\u30C7\u30FC\u30BF\u30DE\u30C3\u30D4\u30F3\u30B0\u30D5\u30A1\u30A4\u30EB
MetadataTalendTypeEditor.editMappingDialog.title=\u30DE\u30C3\u30D4\u30F3\u30B0\u30D5\u30A1\u30A4\u30EB\u3092\u7DE8\u96C6
MetadataTalendTypeEditor.error.message=\u30A8\u30E9\u30FC\u30E1\u30C3\u30BB\u30FC\u30B8
MetadataTalendTypeEditor.fileIsImported=\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u65E2\u306B\u30A4\u30F3\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u3059\u3002
MetadataTalendTypeEditor.fileOverwrite=\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u65E2\u306B\u5B58\u5728\u3057\u307E\u3059\u3002\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B?
MetadataTalendTypeEditor.fileIsInvalid=\u30A4\u30F3\u30DD\u30FC\u30C8\u3055\u308C\u305F\u30E1\u30BF\u30C7\u30FC\u30BF\u30D5\u30A1\u30A4\u30EB\u304C\u7121\u52B9\u3067\u3059\u3002
MetadataTalendTypeEditor.fileNameStartRule=\u30D5\u30A1\u30A4\u30EB\u540D\u306F 'mapping_' \u3067\u59CB\u3081\u3066\u304F\u3060\u3055\u3044\u3002
ContextModeSelectPage.contextModes=\u65B0\u898F\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u4F5C\u6210\u3059\u308B\u304B\u3001\u65E2\u5B58\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u518D\u4F7F\u7528

View File

@@ -510,10 +510,12 @@ InegerCellEditorListener.NumeralMessage=\u8F93\u5165\u503C\u65E0\u6548
MetadataTalendTypeEditor.button.edit=\u7F16\u8F91(&D)
MetadataTalendTypeEditor.button.export=\u5BFC\u51FA(&X)
MetadataTalendTypeEditor.button.import=\u5BFC\u5165 (&M)
MetadataTalendTypeEditor.button.restore=\u6062\u590D (&E)
MetadataTalendTypeEditor.column1.Name=\u5143\u6570\u636E\u6620\u5C04\u6587\u4EF6
MetadataTalendTypeEditor.editMappingDialog.title=\u7F16\u8F91\u6620\u5C04\u6587\u4EF6
MetadataTalendTypeEditor.error.message=\u9519\u8BEF\u6D88\u606F
MetadataTalendTypeEditor.fileIsImported=\u6B64\u6587\u4EF6\u5DF2\u88AB\u5BFC\u5165\u3002
MetadataTalendTypeEditor.fileOverwrite=\u6B64\u6587\u4EF6\u5DF2\u5B58\u5728\uFF0C\u8986\u76D6\u5417?
MetadataTalendTypeEditor.fileIsInvalid=\u5BFC\u5165\u7684\u5143\u6570\u636E\u6587\u4EF6\u65E0\u6548\u3002
MetadataTalendTypeEditor.fileNameStartRule=\u6587\u4EF6\u540D\u5FC5\u987B\u4EE5 'mapping_' \u5F00\u5934\u3002
ContextModeSelectPage.contextModes=\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u73AF\u5883\u6216\u91CD\u65B0\u4F7F\u7528\u73B0\u6709\u7684\u73AF\u5883

View File

@@ -116,6 +116,14 @@
name="sajdbc4-17.0.0.jar"
required="true">
</libraryNeeded>
<libraryNeeded
context="Microsoft wizard"
language="java"
message="Needed for create Microsoft connection"
mvn_uri="mvn:com.microsoft.sqlserver/mssql-jdbc/actual"
name="mssql-jdbc-actual.jar"
required="true">
</libraryNeeded>
<libraryNeeded
context="plugin:org.talend.metadata.managment"
language="java"

View File

@@ -67,7 +67,7 @@ public class TalendForgeRegistHelper {
IntroContentParser parser = new IntroContentParser(result);
Document dom = parser.getDocument();
if (dom != null) {
boolean cloud = IRemoteService.get().isCloudConnection();
boolean cloud = IRemoteService.get() != null && IRemoteService.get().isCloudConnection();
Element ele = dom.createElement("licensetype");
ele.setAttribute("id", "license_cloud");
ele.setAttribute("isCloud",""+cloud);

View File

@@ -17,5 +17,5 @@ repository.metadataGenericSchema=\u6C4E\u7528\u30B9\u30AD\u30FC\u30DE
repository.metadataGenericSchema.alias=GENERIC
repository.metadataDbConnection=DB\u63A5\u7D9A
repository.metadataConnections.alias=DB
repository.metadataFileDelimited=\u533A\u5207\u308A\u6587\u5B57\u4ED8\u304D\u30D5\u30A1\u30A4\u30EB
repository.metadataFileDelimited=\u533A\u5207\u308A\u4ED8\u304D\u30D5\u30A1\u30A4\u30EB
repository.metadataFileDelimited.alias=DELIM

View File

@@ -166,4 +166,20 @@ public class ModuleNeededTest {
Assert.assertEquals("mysql-connector-java-5.1.30-bin.jar", moduleNeeded.getModuleName());
}
@Test
public void testSetMavenUri() {
String moduleValue = "sajdbc4-17.0.0.jar";
String mavenURI = "mvn:sap.jdbc4.sqlanywhere/sajdbc4/17.0.0";
ModuleNeeded moduleNeeded = new ModuleNeeded(null, null, true, mavenURI);
moduleNeeded.setMavenUri(mavenURI);
Assert.assertEquals(moduleValue, moduleNeeded.getModuleName());
moduleValue = "talend-codegen-utils.jar";
mavenURI = "mvn:org.talend.libraries/talend-codegen-utils/0.31.0";
moduleNeeded = new ModuleNeeded(null, null, true, mavenURI);
moduleNeeded.setMavenUri(mavenURI);
Assert.assertEquals(moduleValue, moduleNeeded.getModuleName());
}
}

View File

@@ -13,6 +13,7 @@ import java.nio.file.Files;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
@@ -44,7 +45,7 @@ public class MetadataTalendTypeTest {
public void testGetProjectForderURLOfMappingsFile() throws SystemException {
URL url = MetadataTalendType.getProjectFolderURLOfMappingsFile();
String projectLabel = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel();
assertTrue(url.getFile().endsWith(projectLabel + "/.settings/mappings/"));
assertTrue(StringUtils.removeEnd(url.getFile(), "/").endsWith(projectLabel + "/.settings/mappings"));
}
@Test

View File

@@ -24,10 +24,23 @@ public class JSONObjectTest extends TestCase {
}
}
public class EvilBean {
public int id;
public int getId() {
//do something evil
return this.id;
}
public EvilBean(int id) {
this.id = id;
}
}
@Test
public void test() throws JSONException {
Bean bean = new Bean(1,"wangwei");
JSONObject object = new JSONObject(bean);
JSONObject object = new JSONObject(bean, Bean.class);
assertEquals(false, object.isNull("id"));
assertEquals(1, object.get("id"));
@@ -36,4 +49,15 @@ public class JSONObjectTest extends TestCase {
assertEquals(false, object.isNull("Name"));
assertEquals("wangwei", object.get("Name"));
}
@Test
public void testScriptInject() {
EvilBean evil = new EvilBean(1);
try {
new JSONObject(evil, Bean.class);
fail();
} catch(JSONException e) {
}
}
}