Compare commits

...

8 Commits

Author SHA1 Message Date
jiezhang-tlnd
ae4cc4cdfd chore(TUP-35979)Adjust nimbus-jose-jwt-9.3.jar to (#5415)
nimbus-jose-jwt-9.22.jar
2022-06-30 12:08:37 +08:00
jiezhang-tlnd
909a8e4fb7 chore(TUP-35857)CVE: bsh-2.0b4.jar (#5381) 2022-06-30 09:47:42 +08:00
zyuan-talend
59d71296ce fix(TUP-31721): disable the warning in CI mode. (#5410) 2022-06-29 10:32:00 +08:00
bhe-talendbj
b80b862bcd chore(TUP-35849): add classifier support (#5408) (#5412) 2022-06-28 20:17:16 +08:00
Liu Xinquan
ed2b236467 fix(TDQ-20360) snowflake jdbc connection context mode issue (#5390) 2022-06-17 16:38:22 +08:00
Liu Xinquan
152a06856f fix(TDQ-20360) snowflake jdbc connection context mode issue (#5380) 2022-06-17 10:51:54 +08:00
sbliu
258be81901 chore(TUP-35708) upgrade maven-shared-utils to 3.3.3 (#5345) 2022-06-15 17:04:15 +08:00
zshen-talend
8c0bdc29bf fix(TDQ-20442):Split 'handelDQComponents()' so as to handle 2 DQ components(#5358) 2022-06-10 10:29:31 +08:00
9 changed files with 138 additions and 39 deletions

View File

@@ -88,7 +88,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-8.11.jar", "javax.mail-1.6.2.jar", "reload4j-1.2.19.jar",
"json-smart-2.4.7.jar", "nimbus-jose-jwt-9.22.jar", "javax.mail-1.6.2.jar", "reload4j-1.2.19.jar",
"accessors-smart-2.4.7.jar", "asm-9.1.jar", "content-type-2.1.jar" })),
VERTICA_9(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 9.X", "VERTICA_9_0", "vertica-jdbc-9.3.1-0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

View File

@@ -94,7 +94,11 @@ public interface IDetectCVEService extends IService {
if (art == null) {
return null;
}
return String.format("%s:%s:%s", art.getGroupId(), art.getArtifactId(), art.getVersion());
String gavc = String.format("%s:%s:%s", art.getGroupId(), art.getArtifactId(), art.getVersion());
if (!StringUtils.isEmpty(art.getClassifier())) {
gavc += ":" + art.getClassifier();
}
return gavc;
}
return null;
}
@@ -112,6 +116,8 @@ public interface IDetectCVEService extends IService {
private String a;
private String v;
private String c;
/**
* @return the g
@@ -155,8 +161,28 @@ public interface IDetectCVEService extends IService {
this.v = v;
}
/**
* @return the c
*/
public String getC() {
return c;
}
/**
* @param c the c to set
*/
public void setC(String c) {
this.c = c;
}
public String getGAVString() {
return String.format("%s:%s:%s", g, a, v);
String gav = String.format("%s:%s:%s", g, a, v);
if (!StringUtils.isEmpty(c)) {
gav += ":" + c;
}
return gav;
}
public String getGA() {
@@ -168,13 +194,16 @@ public interface IDetectCVEService extends IService {
return null;
}
String[] gavs = gav.split(":");
if (gavs.length != 3) {
if (gavs.length < 3) {
return null;
}
GAV ret = new GAV();
ret.setG(gavs[0]);
ret.setA(gavs[1]);
ret.setV(gavs[2]);
if (gavs.length > 3) {
ret.setC(gavs[3]);
}
return ret;
}
@@ -184,19 +213,7 @@ public interface IDetectCVEService extends IService {
}
String gav = mavenUri2GAV(mavenURI);
if (StringUtils.isEmpty(gav)) {
return null;
}
String[] gavs = gav.split(":");
if (gavs.length != 3) {
return null;
}
GAV ret = new GAV();
ret.setG(gavs[0]);
ret.setA(gavs[1]);
ret.setV(gavs[2]);
return ret;
return parseFromGAV(gav);
}
public GAV clone() throws CloneNotSupportedException {
@@ -224,6 +241,12 @@ public interface IDetectCVEService extends IService {
sb.append(v);
sb.append(",");
}
if (!StringUtils.isEmpty(c)) {
sb.append("c:");
sb.append(c);
sb.append(",");
}
if (sb.lastIndexOf(",") > 0) {
sb.deleteCharAt(sb.length() - 1);
@@ -245,6 +268,9 @@ public interface IDetectCVEService extends IService {
if (!StringUtils.isEmpty(v)) {
hash += hash * 31 + v.hashCode();
}
if (!StringUtils.isEmpty(c)) {
hash += hash * 31 + c.hashCode();
}
return hash;
}
@@ -267,8 +293,12 @@ public interface IDetectCVEService extends IService {
if (!StringUtils.equals(a, gav.getA())) {
return false;
}
if (!StringUtils.equals(v, gav.getV())) {
return false;
}
return StringUtils.equals(v, gav.getV());
return StringUtils.equals(c, gav.getC());
}

View File

@@ -706,6 +706,8 @@ 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.
@@ -721,7 +723,7 @@ public class ProcessorUtilities {
*/
generateBuildInfo(jobInfo, progressMonitor, isMainJob, currentProcess, currentJobName, processor, option);
handelDQComponents(selectedProcessItem, currentProcess);
checkNeedExportItemsForDQ(currentProcess);
copyDependenciedResources(currentProcess, progressMonitor);
@@ -1251,6 +1253,8 @@ public class ProcessorUtilities {
processor.setArguments(argumentsMap);
handelDQComponents(selectedProcessItem, currentProcess);
generateContextInfo(jobInfo, selectedContextName, statistics, trace, needContext, progressMonitor,
currentProcess, currentJobName, processor, isMainJob, codeGenerationNeeded);
@@ -1266,7 +1270,7 @@ public class ProcessorUtilities {
generateBuildInfo(jobInfo, progressMonitor, isMainJob, currentProcess, currentJobName, processor, option);
TimeMeasure.step(idTimer, "generateBuildInfo");
handelDQComponents(selectedProcessItem, currentProcess);
checkNeedExportItemsForDQ(currentProcess);
copyDependenciedResources(currentProcess, progressMonitor);
@@ -1355,10 +1359,34 @@ public class ProcessorUtilities {
}
/**
*
* 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'
* 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'
*
* @param processItem
*/
private static void handelDQComponents(ProcessItem processItem,IProcess currentProcess) {
@@ -1373,17 +1401,7 @@ public class ProcessorUtilities {
return;
}
try {
// 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
/* 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.
*/

View File

@@ -23,6 +23,10 @@
<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,7 +97,18 @@
<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

@@ -14,6 +14,17 @@
<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,6 +34,17 @@
<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>
@@ -127,6 +138,11 @@
<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

@@ -373,6 +373,10 @@ 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);
@@ -384,7 +388,10 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
ILibraryManagerUIService libUiService = GlobalServiceRegister.getDefault()
.getService(ILibraryManagerUIService.class);
libUiService.installModules(new String[] { jarNeeded });
// libUiService.installModules(new String[] { jarNeeded });
List<ModuleNeeded> moduleList = new ArrayList<ModuleNeeded>();
moduleList.add(module);
libUiService.installModules(moduleList);
}
jarFile = retrieveJarFromLocal(module);
if (jarFile == null) {
@@ -1347,7 +1354,7 @@ public class LocalLibraryManager implements ILibraryManagerService, IChangedLibr
if (path.equals(moduleLocation)) {
continue;
} else {
if (CommonsPlugin.isDebugMode()) {
if (CommonsPlugin.isDebugMode() && !CommonsPlugin.isHeadless()) {
CommonExceptionHandler
.warn(name + " is duplicated, locations:" + path + " and:" + moduleLocation);
}

View File

@@ -1075,8 +1075,10 @@ public class ExtractMetaDataUtils {
}
}
} else {
if (driverJarPathArg.startsWith(MavenUrlHelper.MVN_PROTOCOL)) {
setDriverPath(librairesManagerService, jarPathList, driverJarPathArg);
if (TalendQuoteUtils.removeQuotesIfExist(driverJarPathArg)
.startsWith(MavenUrlHelper.MVN_PROTOCOL)) {
setDriverPath(librairesManagerService, jarPathList,
TalendQuoteUtils.removeQuotesIfExist(driverJarPathArg));
} else {
String jarName = librairesManagerService.getJarNameFromMavenuri(driverJarPathArg);
if (jarName == null) {