Compare commits

...

19 Commits

Author SHA1 Message Date
kjwang
89ac637904 Fix TUP-41299 Cannot connect to Oracle with patch R2023-11 (#6693) (#6711)
Fix TUP-41299 Cannot connect to Oracle with patch R2023-11
https://jira.talendforge.org/browse/TUP-41299
2024-01-09 10:33:54 +08:00
bhe-talendbj
6d8b1b51c7 fix(TUP-41391): initialized workspace location too early (#6690) 2024-01-03 16:46:10 +08:00
hcyi
e30b1a45d2 fix(TUP-41106):Track shared mode with data collector. (#6674)
* fix(TUP-41106):Track shared mode with data collector.

* fix(TUP-41106):Track Enable Java 17 compatibility with data collector.

* fix(TUP-41106):revert Track Enable Java 17 compatibility with data
collector.
2023-12-29 15:09:29 +08:00
Oleksandr Zhelezniak
e3e23006ed feat(TDI-50721): bump connectors 1.27.28 2023-12-28 15:12:16 +02:00
bhe-talendbj
0e04133323 fix(TUP-41250): clear builtinPluginsCache (#6652)
* fix(TUP-41250): add new method to reset cache

* fix(TUP-41250): fix clear cache

* fix(TUP-41250): fix cache clear
2023-12-27 17:57:02 +08:00
bhe-talendbj
a8f2e79338 chore(TUP-40916): Studio issues if Java version is > Java 17 (#6577)
* chore(TUP-40916): validate java version

* chore(TUP-40916): update version compare

* chore(TUP-40916): update version compare

* chore(TUP-40916): update version compare

* chore(TUP-40916): update version compare
2023-12-18 14:56:41 +08:00
bhe-talendbj
6950d5cf6a chore(TUP-41184): correct maven repository id (#6625) 2023-12-11 15:42:39 +08:00
jzhao
5d8dc7531f chore(TDI-50507): bump component-runtime to 1.38.12 (#6576) 2023-11-23 10:47:17 +08:00
Oleksandr Zhelezniak
8a6b2ab76a chore(TDI-50555): bump connectors 1.27.27 2023-11-20 18:51:50 +02:00
jzhao
5d277417ae fix(TDI-50399): Json:20230227 | CVE-2023-5072 (#6562) 2023-11-20 11:51:01 +08:00
msjian
c4c8ab5ba6 fix(TDQ-21531) : fix run match analysis get error when check "store on disk"(#6549) 2023-11-10 17:45:13 +08:00
Jill Yan
f660181adf APPINT-35965 downgrade plexus-io (#6508)
* APPINT-35965 downgrade plexus-io

* APPINT-35965 downgrade plexus-io
2023-10-30 08:30:00 +08:00
sbliu
46bb67ab7e add dependency to new version guava for maven-assembly-plugin plugin (#6501) 2023-10-26 14:35:09 +08:00
sbliu
22891b2e99 fix missing guava in junit (#6498) 2023-10-25 17:43:48 +08:00
jiezhang-tlnd
4b208e9fe4 fix junit (#6496) 2023-10-25 12:08:07 +08:00
sbliu
2387b83d0f fix(TUP-40275) upgrade guava to 32.0.1-jre (#6398)
* fix(TUP-40275) upgrade guava to 32.0.1-jre

* revert some changes
2023-10-24 10:09:45 +08:00
Jane Ding
aec62af46c fix(TUP-40439):In the ".sysConfig" of "support logs" that gather (#6451)
* fix(TUP-40439):In the ".sysConfig" of "support logs" that gather
"nexus.password" value is plain text
https://jira.talendforge.org/browse/TUP-40439

* fix(TUP-40439):In the ".sysConfig" of "support logs" that gather
"nexus.password" value is plain text
https://jira.talendforge.org/browse/TUP-40439
2023-10-20 11:29:32 +08:00
apoltavtsev
34a0e52678 APPINT-35122: Incorrect routelet module inside root pom is corrected (#6457) 2023-10-11 16:16:13 +02:00
apoltavtsev
274bfb2d40 APPINT-35949: [731] Compile error for CI+route+routelet (#6450)
* APPINT-35949: [731] Compile error for CI+route+routelet

* Update SyncChildrenSourceCodeProvider.java

* Update SyncChildrenTestReportsProvider.java

* Update SyncChildrenContextsResourcesProvider.java

* Update SyncChildrenSourceCodeProvider.java

* Update SyncChildrenContextsResourcesProvider.java

* Update SyncChildrenSourceCodeProvider.java

* Update SyncChildrenTestReportsProvider.java
2023-10-09 17:28:42 +02:00
30 changed files with 352 additions and 37 deletions

View File

@@ -46,7 +46,7 @@ public class MyURLClassLoader extends URLClassLoader {
private Map pclasses = new HashMap();
public MyURLClassLoader(String fileName) throws IOException {
this(new File(fileName).toURL());
this(new File(fileName).toURI().toURL());
}
public MyURLClassLoader(URL url) {

View File

@@ -85,6 +85,7 @@ 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.general.ILibrariesService;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.Project;
@@ -133,14 +134,15 @@ import org.talend.core.repository.utils.ProjectDataJsonProvider;
import org.talend.core.repository.utils.RepositoryPathProvider;
import org.talend.core.repository.utils.XmiResourceManager;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.runtime.hd.IDynamicDistributionManager;
import org.talend.core.runtime.repository.item.ItemProductKeys;
import org.talend.core.runtime.services.IGenericWizardService;
import org.talend.core.runtime.services.IMavenUIService;
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.service.IUpdateService;
import org.talend.core.utils.CodesJarResourceCache;
import org.talend.cwm.helper.SubItemHelper;
import org.talend.cwm.helper.TableHelper;
@@ -2449,6 +2451,15 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
runProcessService.clearProjectRelatedSettings();
}
if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopDistributionService.class)) {
IHadoopDistributionService hdService = GlobalServiceRegister.getDefault()
.getService(IHadoopDistributionService.class);
if (hdService != null) {
IDynamicDistributionManager dynamicDistrManager = hdService.getDynamicDistributionManager();
dynamicDistrManager.reset(null);
}
}
// clear detect CVE cache
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDetectCVEService.class)) {
IDetectCVEService detectCVESvc = GlobalServiceRegister.getDefault().getService(IDetectCVEService.class);

View File

@@ -39,6 +39,9 @@ import org.talend.core.GlobalServiceRegister;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
import org.talend.designer.runprocess.IRunProcessService;
import org.talend.utils.JavaVersion;
import org.talend.utils.StudioKeysFileCheck;
import org.talend.utils.VersionException;
/**
* Utilities around perl stuff. <br/>
@@ -280,6 +283,10 @@ public final class JavaUtils {
if (version == null) {
return defaultCompliance;
}
JavaVersion ver = new JavaVersion(version);
if (ver.getMajor() > 8) {
return String.valueOf(ver.getMajor());
}
if (version.startsWith(JavaCore.VERSION_1_8)) {
return JavaCore.VERSION_1_8;
}
@@ -361,4 +368,26 @@ public final class JavaUtils {
}
}
public static void validateJavaVersion() {
try {
// validate jvm which is used to start studio
StudioKeysFileCheck.validateJavaVersion();
// validate default complier's compliance level
IVMInstall install = JavaRuntime.getDefaultVMInstall();
String ver = getCompilerCompliance((IVMInstall2) install, JavaCore.VERSION_1_8);
if (new JavaVersion(ver).compareTo(new JavaVersion(StudioKeysFileCheck.JAVA_VERSION_MAXIMUM_STRING)) > 0) {
VersionException e = new VersionException(VersionException.ERR_JAVA_VERSION_NOT_SUPPORTED,
"The maximum Java version supported by Studio is " + StudioKeysFileCheck.JAVA_VERSION_MAXIMUM_STRING
+ ". Your compiler's compliance level is " + ver);
throw e;
}
} catch (Exception e1) {
if (e1 instanceof VersionException) {
throw e1;
}
ExceptionHandler.process(e1);
}
}
}

View File

@@ -31,6 +31,8 @@ public interface IDynamicDistributionManager {
public void reloadAllDynamicDistributions(IProgressMonitor monitor) throws Exception;
public void reset(IProgressMonitor monitor);
public boolean isLoaded();
public void load(IProgressMonitor monitor, boolean resetModulesCache) throws Exception;

View File

@@ -17,6 +17,7 @@ import org.eclipse.jface.preference.IPreferenceStore;
import org.talend.commons.utils.VersionUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.prefs.ITalendCorePrefConstants;
import org.talend.core.runtime.util.SharedStudioUtils;
import org.talend.core.ui.CoreUIPlugin;
import org.talend.core.ui.branding.IBrandingService;
import org.talend.daikon.token.TokenGenerator;
@@ -41,6 +42,8 @@ public class DefaultTokenCollector extends AbstractTokenCollector {
private static final TokenKey OS = new TokenKey("os"); //$NON-NLS-1$
private static final TokenKey SHARE_MODE = new TokenKey("share.mode"); //$NON-NLS-1$
public static final String COLLECTOR_SYNC_NB = "COLLECTOR_SYNC_NB"; //$NON-NLS-1$
public DefaultTokenCollector() {
@@ -70,7 +73,7 @@ public class DefaultTokenCollector extends AbstractTokenCollector {
// typeStudio
if (GlobalServiceRegister.getDefault().isServiceRegistered(IBrandingService.class)) {
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(
IBrandingService brandingService = GlobalServiceRegister.getDefault().getService(
IBrandingService.class);
tokenStudioObject.put(TYPE_STUDIO.getKey(), brandingService.getAcronym());
// tokenStudioObject.put(TYPE_STUDIO.getKey(), brandingService.getShortProductName());
@@ -92,6 +95,8 @@ public class DefaultTokenCollector extends AbstractTokenCollector {
tokenStudioObject.put(STOP_COLLECTOR.getKey(), "0"); //$NON-NLS-1$
}
// Share mode
tokenStudioObject.put(SHARE_MODE.getKey(), SharedStudioUtils.isSharedStudioMode());
return tokenStudioObject;
}
}

View File

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

View File

@@ -116,7 +116,17 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-io</artifactId>
<version>3.4.1</version>
<version>3.2.0</version>
<exclusions><!-- fix CVE to plexus-io:3.2.0-->
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
@@ -129,6 +139,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>

View File

@@ -25,6 +25,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>

View File

@@ -41,6 +41,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
@@ -111,7 +116,7 @@
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</exclusion>
</exclusion>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>

View File

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

View File

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

View File

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

View File

@@ -11,7 +11,7 @@
<packaging>pom</packaging>
<repositories>
<repository>
<id>Talend OpenSource Release</id>
<id>talend_open</id>
<url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceRelease/</url>
</repository>
</repositories>

View File

@@ -81,6 +81,11 @@
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
</dependencies>
</plugin>
<plugin>
@@ -103,6 +108,11 @@
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
</dependencies>
</plugin>
<plugin>
@@ -150,6 +160,11 @@
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
</dependencies>
<configuration>
<archive>
@@ -197,6 +212,11 @@
<artifactId>maven-core</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
</dependencies>
</plugin>
<plugin>
@@ -234,6 +254,11 @@
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.0.1-jre</version>
</dependency>
</dependencies>
</plugin>
<plugin>

View File

@@ -25,7 +25,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 +34,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;
@@ -1061,6 +1059,7 @@ public class AggregatorPomsHelper {
String routeCustomVersion = (String) routeProperty.getAdditionalProperties().get(MavenConstants.NAME_USER_VERSION);
boolean routeUseSnapshot = routeProperty.getAdditionalProperties().containsKey(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
IFile routePomFile = getItemPomFolder(item.getProperty()).getFile(TalendMavenConstants.POM_FILE_NAME);
// Inherit child job parameters from parent route
@@ -1083,7 +1082,9 @@ public class AggregatorPomsHelper {
runProcessService.generatePom(childJob.getProcessItem(), TalendProcessOptionConstants.GENERATE_POM_NO_FILTER);
IFile childPomFile = getItemPomFolder(childJobProperty).getFile(TalendMavenConstants.POM_FILE_NAME);
modules.add(getModulePath(childPomFile));
if (childPomFile.getProject().getName().equalsIgnoreCase(routePomFile.getProject().getName())) {
modules.add(getModulePath(childPomFile));
}
// restore original Job parameters
childJobProperty.setParentItem(null);

View File

@@ -10,4 +10,5 @@ bin.includes = META-INF/,\
templates/,\
lib/crypto-utils.jar,\
lib/slf4j-api-1.7.25.jar,\
distribution/license.json
distribution/license.json,\
lib/jboss-marshalling-2.0.12.Final.jar

View File

@@ -278,8 +278,8 @@ public class ModulesNeededProvider {
public static void reset() {
// clean the cache
ExtensionModuleManager.getInstance().clearCache();
getModulesNeeded().clear();
getAllManagedModules().clear();
componentImportNeedsList.clear();
allManagedModules.clear();
systemModules = null;
}

View File

@@ -229,7 +229,6 @@ public abstract class AbstractLibrariesService implements ILibrariesService {
public void resetModulesNeeded() {
ModulesNeededProvider.reset();
ModuleStatusProvider.reset();
ModulesNeededProvider.getModulesNeeded().clear();
checkLibraries();
}

View File

@@ -52,7 +52,7 @@ public class HotClassLoader extends URLClassLoader {
if (pathToAdd2 != null && pathToAdd2.length() > 0) {
try {
File pathToAdd = new File(pathToAdd2).getCanonicalFile();
addURL(pathToAdd.toURL());
addURL(pathToAdd.toURI().toURL());
} catch (IOException e) {
ExceptionHandler.process(e);
}

View File

@@ -122,4 +122,6 @@ DataTransferMessages.DataTransfer_browse=B&rowse...
DataTransferMessages.ArchiveExport_selectDestinationTitle=Export to Archive File
WorkbenchMessages.ShowView_errorTitle=Problems Showing View
ComponentsManager.form.install.dialog.restart.title=Restarting Studio
ComponentsManager.form.install.dialog.restart.message=We need to restart studio to finish the installation.\n\nDo you want to restart studio right now?
ComponentsManager.form.install.dialog.restart.message=We need to restart studio to finish the installation.\n\nDo you want to restart studio right now?
JavaVersion.CheckError=Java upgrade required, minimal required java version is {0}, current version is {1}.
JavaVersion.CheckError.notSupported=The maximum Java version supported by Studio is {0}. Your current version is {1}.

View File

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

View File

@@ -78,6 +78,7 @@ import org.talend.repository.ProjectManager;
import org.talend.repository.model.IRepositoryService;
import org.talend.repository.ui.login.LoginHelper;
import org.talend.utils.StudioKeysFileCheck;
import org.talend.utils.VersionException;
/**
* This class controls all aspects of the application's execution.
@@ -112,6 +113,23 @@ public class Application implements IApplication {
StudioKeysFileCheck.check(ConfigurationScope.INSTANCE.getLocation().toFile());
Display display = PlatformUI.createDisplay();
try {
StudioKeysFileCheck.validateJavaVersion();
} catch (Exception e) {
Shell shell = new Shell(display, SWT.NONE);
if (e instanceof VersionException) {
String msg = Messages.getString("JavaVersion.CheckError", StudioKeysFileCheck.JAVA_VERSION_MINIMAL_STRING,
StudioKeysFileCheck.getJavaVersion());
if (!((VersionException) e).requireUpgrade()) {
msg = Messages.getString("JavaVersion.CheckError.notSupported",
StudioKeysFileCheck.JAVA_VERSION_MAXIMUM_STRING, StudioKeysFileCheck.getJavaVersion());
}
MessageDialog.openError(shell, null, msg);
}
return IApplication.EXIT_OK;
}
try {
// TUP-5816 don't put any code ahead of this part unless you make sure it won't trigger workspace
// initialization.

View File

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

View File

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

View File

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

View File

@@ -2848,7 +2848,7 @@ public class DatabaseForm extends AbstractForm {
File file = new File(stringToFile);
if (file != null) {
try {
MyURLClassLoader cl = new MyURLClassLoader(file.toURL());
MyURLClassLoader cl = new MyURLClassLoader(new URL[] {file.toURI().toURL()},this.getClass().getClassLoader());
Class[] classes = cl.getAssignableClasses(Driver.class);
for (Class classe : classes) {
driverClassTxt.add(classe.getName());
@@ -6109,7 +6109,7 @@ public class DatabaseForm extends AbstractForm {
File file = new File(stringToFile);
if (file != null) {
try {
MyURLClassLoader cl = new MyURLClassLoader(file.toURL());
MyURLClassLoader cl = new MyURLClassLoader(new URL[] {file.toURI().toURL()},this.getClass().getClassLoader());
Class[] classes = cl.getAssignableClasses(Driver.class);
for (Class classe : classes) {
generalJdbcClassNameText.add(classe.getName());

View File

@@ -165,6 +165,14 @@
<overWrite>false</overWrite>
<outputDirectory>${project.basedir}/tmp/org/apache/maven/maven-bom/4.0.0-alpha-5</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-io</artifactId>
<version>3.2.0</version>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.basedir}/tmp/org/codehaus/plexus/plexus-io/3.2.0</outputDirectory>
</artifactItem>
</artifactItems>
<outputDirectory>${project.basedir}/tmp</outputDirectory>
</configuration>

View File

@@ -12,40 +12,106 @@
// ============================================================================
package org.talend.utils;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang3.StringUtils;
/*
* Created by bhe on Dec 24, 2019
*/
public class JavaVersion implements Comparable<JavaVersion> {
private int major, minor, security;
private static final Logger LOGGER = Logger.getLogger(JavaVersion.class.getCanonicalName());
private int major, minor, buildNumber, security;
public JavaVersion(String v) {
parseVersion(v);
}
/**
* @return the major
*/
public int getMajor() {
return major;
}
/**
* @return the minor
*/
public int getMinor() {
return minor;
}
/**
* @return the buildNumber
*/
public int getBuildNumber() {
return buildNumber;
}
/**
* @return the security
*/
public int getSecurity() {
return security;
}
@Override
public int compareTo(JavaVersion o) {
if (this.major - o.major == 0) {
if (this.minor - o.minor == 0) {
return this.security - o.security;
if (this.buildNumber - o.buildNumber == 0) {
return this.security - o.security;
}
return this.buildNumber - o.buildNumber;
}
return this.minor - o.minor;
}
return this.major - o.major;
}
private String normalizeVersion(String v) {
v = v.replaceAll("[^\\d._]", "");
if (v.isEmpty()) {
v = "0";
}
return v;
}
private void parseVersion(String v) {
if (v == null || v.isEmpty()) {
return;
}
String[] version = v.split("[\\._]");
this.major = Integer.parseInt(version[0]);
if (version.length > 1) {
this.minor = Integer.parseInt(version[1]);
try {
this.major = Integer.parseInt(normalizeVersion(version[0]));
} catch (Exception e) {
LOGGER.log(Level.WARNING, "Major version parse error of " + v, e);
}
if (version.length > 2) {
if (version.length > 1 && !StringUtils.isEmpty(version[1])) {
try {
this.minor = Integer.parseInt(normalizeVersion(version[1]));
} catch (Exception e) {
LOGGER.log(Level.WARNING, "Minor version parse error of " + v, e);
}
}
if (version.length > 2 && !StringUtils.isEmpty(version[2])) {
try {
this.buildNumber = Integer.parseInt(normalizeVersion(version[2]));
} catch (Exception e) {
LOGGER.log(Level.WARNING, "Build number parse error of " + v, e);
}
}
if (version.length > 3 && !StringUtils.isEmpty(version[3])) {
// strip non number part if any
String securityNumber = version[version.length - 1];
String securityNumber = version[3];
for (int i = 0; i < securityNumber.length(); i++) {
char c = securityNumber.charAt(i);
if (c > '9' || c < '0') {
@@ -53,8 +119,11 @@ public class JavaVersion implements Comparable<JavaVersion> {
break;
}
}
this.security = Integer.parseInt(securityNumber);
try {
this.security = Integer.parseInt(securityNumber);
} catch (Exception e) {
LOGGER.log(Level.WARNING, "Security version parse error of " + v, e);
}
}
}
@@ -63,6 +132,7 @@ public class JavaVersion implements Comparable<JavaVersion> {
int result = 1;
result = result * prime + this.major;
result = result * prime + this.minor;
result = result * prime + this.buildNumber;
result = result * prime + this.security;
return result;
}
@@ -84,10 +154,11 @@ public class JavaVersion implements Comparable<JavaVersion> {
sb.append(".");
sb.append(this.minor);
sb.append(".");
if (this.major == 1) {
sb.append("0_");
sb.append(this.buildNumber);
if (this.security > 0) {
sb.append("_");
sb.append(this.security);
}
sb.append(this.security);
return sb.toString();
}
}
}

View File

@@ -32,10 +32,14 @@ public class StudioKeysFileCheck {
private static final String JAVA_VERSION_PROP = "java.version";
private static final String JAVA_VERSION_MINIMAL_STRING = "1.8.0_161";
public static final String JAVA_VERSION_MINIMAL_STRING = "1.8.0_161";
private static final JavaVersion JAVA_VERSION_MINIMAL = new JavaVersion(JAVA_VERSION_MINIMAL_STRING);
public static final String JAVA_VERSION_MAXIMUM_STRING = "11";
private static final JavaVersion JAVA_VERSION_MAXIMUM = new JavaVersion(JAVA_VERSION_MAXIMUM_STRING);
private StudioKeysFileCheck() {
}
@@ -64,11 +68,24 @@ public class StudioKeysFileCheck {
String currentVersion = System.getProperty(JAVA_VERSION_PROP);
JavaVersion cv = new JavaVersion(currentVersion);
if (cv.compareTo(JAVA_VERSION_MINIMAL) < 0) {
RuntimeException e = new RuntimeException(
VersionException e = new VersionException(VersionException.ERR_JAVA_VERSION_UPGRADE_REQUIRED,
"Java upgrade required, minimal required java version is " + JAVA_VERSION_MINIMAL_STRING
+ ", current version is " + currentVersion);
LOGGER.error(e);
LOGGER.error(e.getMessage(), e);
throw e;
}
JavaVersion currentMajor = new JavaVersion(String.valueOf(cv.getMajor()));
if (currentMajor.compareTo(JAVA_VERSION_MAXIMUM) > 0) {
VersionException e = new VersionException(VersionException.ERR_JAVA_VERSION_NOT_SUPPORTED,
"The maximum Java version supported by Studio is " + JAVA_VERSION_MAXIMUM_STRING
+ ". Your current version is " + currentVersion);
LOGGER.error(e.getMessage(), e);
throw e;
}
}
public static String getJavaVersion() {
return System.getProperty(JAVA_VERSION_PROP);
}
}

View File

@@ -0,0 +1,45 @@
// ============================================================================
//
// Copyright (C) 2006-2023 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.utils;
/**
* @author PCW created on Nov 20, 2023
*
*/
@SuppressWarnings("serial")
public class VersionException extends RuntimeException {
public static final int ERR_JAVA_VERSION_UPGRADE_REQUIRED = 0;
public static final int ERR_JAVA_VERSION_NOT_SUPPORTED = 1;
private int errID;
public VersionException(String msg) {
super(msg);
}
public VersionException(int errID, String msg) {
this(msg);
this.errID = errID;
}
public int getErrID() {
return this.errID;
}
public boolean requireUpgrade() {
return this.errID == ERR_JAVA_VERSION_UPGRADE_REQUIRED;
}
}