Compare commits

..

5 Commits

Author SHA1 Message Date
Zhiwei Xue
fae1ce455c feat(TUP-36683):Selective generateAllPoms (#5772)
* feat(TUP-36683):Selective generateAllPoms (#5753)

* feat(TUP-36683):Selective generateAllPoms (#5676)
2022-11-04 17:19:48 +08:00
sbliu
bbc391c7ab fix(TUP-36726) change tooltip message (#5729) 2022-10-21 11:11:34 +08:00
sbieliaievl
bbc7dffd22 fix(APPINT-34581) - fixed versions 2022-10-18 14:00:31 +02:00
Liu Xinquan
39f3b4d0f6 fix(TDQ-20751) tDqReportRun Snowflake Context (#5704) 2022-10-17 17:18:22 +08:00
Laurent BOURGEOIS
7893b956e6 fix(TBD-14263):Support MongoDB v4+ - Spark Batch 3.1+ - GA (#5686) 2022-10-14 15:09:33 +02:00
140 changed files with 1652 additions and 4247 deletions

View File

@@ -56,12 +56,5 @@
install-size="0"
version="0.0.0"
unpack="true"/>
<plugin
id="org.talend.signon.util"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View File

@@ -114,7 +114,6 @@ TableViewerCreator.Table.BeNull=la table est null.
TableViewerCreator.TableColumn.AssertMsg=La TableColumn de TableEditorColumn avec idProperty '{0}' n'a pas la bonne Table parente
TreeToTablesLinker.Type.Unsupported=Ce type de currentControl n'est pas support\u00E9
commons.error=Erreur
exception.message={0}\nConsultez le log pour plus de d\u00E9tails.
exception.errorOccured=Une erreur est survenue ({0}).\nConsultez le log pour plus de d\u00E9tails.
ModelSelectionDialog.Message=S\u00E9lectionnez une option ou annulez.
ModelSelectionDialog.Option=Option

View File

@@ -114,7 +114,6 @@ TableViewerCreator.Table.BeNull=\u30C6\u30FC\u30D6\u30EB\u304CNULL\u3067\u3059
TableViewerCreator.TableColumn.AssertMsg=idProperty'{0}'\u304C\u3042\u308BTableEditorColumn\u306ETableColumn\u306B\u306F\u3001\u6B63\u3057\u3044\u89AA\u30C6\u30FC\u30D6\u30EB\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093
TreeToTablesLinker.Type.Unsupported=currentControl\u306E\u3053\u306E\u30BF\u30A4\u30D7\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
commons.error=\u30A8\u30E9\u30FC
exception.message={0}\n\u8A73\u7D30\u306F\u30ED\u30B0\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
exception.errorOccured=\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F({0})\u3002\n\u8A73\u7D30\u306F\u30ED\u30B0\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
ModelSelectionDialog.Message=\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\uFF11\u3064\u9078\u629E\u3059\u308B\u304B\u3001\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002
ModelSelectionDialog.Option=\u30AA\u30D7\u30B7\u30E7\u30F3

View File

@@ -114,7 +114,6 @@ TableViewerCreator.Table.BeNull=\u8868\u4E3A null
TableViewerCreator.TableColumn.AssertMsg=TableEditorColumn \u7684 idProperty \u4E3A '{0}' \u7684 TableColumn \u6CA1\u6709\u6B63\u786E\u7684 Table \u7236\u9879
TreeToTablesLinker.Type.Unsupported=\u4E0D\u652F\u6301\u8FD9\u79CD\u7C7B\u578B\u7684 currentControl
commons.error=\u9519\u8BEF
exception.message={0}\n\u8BF7\u67E5\u770B\u65E5\u5FD7\u4EE5\u83B7\u53D6\u66F4\u591A\u8BE6\u7EC6\u4FE1\u606F\u3002
exception.errorOccured=\u51FA\u73B0\u9519\u8BEF ({0})\u3002\n\u8BF7\u67E5\u770B\u65E5\u5FD7\u4EE5\u83B7\u53D6\u66F4\u591A\u8BE6\u7EC6\u4FE1\u606F\u3002
ModelSelectionDialog.Message=\u8BF7\u9009\u62E9\u4E00\u4E2A\u9009\u9879\u6216\u53D6\u6D88\u3002
ModelSelectionDialog.Option=\u9009\u9879

View File

@@ -24,7 +24,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.JarOutputStream;
import org.apache.tools.zip.ZipEntry;
@@ -170,52 +169,8 @@ public class ZipFileUtils {
inputStream.close();
}
}
public static void unZipFileEntry(File destFile, java.util.zip.ZipFile zipFile, java.util.zip.ZipEntry entry) throws IOException {
InputStream inputStream;
FileOutputStream fileOut;
if (entry.isDirectory()) {
destFile.mkdirs();
} else {
File parent = destFile.getParentFile();
if (parent != null && !parent.exists()) {
parent.mkdirs();
}
inputStream = zipFile.getInputStream(entry);
fileOut = new FileOutputStream(destFile);
byte[] buf = new byte[bufSize];
int readedBytes;
while ((readedBytes = inputStream.read(buf)) > 0) {
fileOut.write(buf, 0, readedBytes);
}
fileOut.close();
inputStream.close();
}
}
public void setBufSize(int bufSize) {
ZipFileUtils.bufSize = bufSize;
}
public static boolean isValidJarFile(String moduleFilePath) {
if (moduleFilePath == null) {
return false;
}
if (!new File(moduleFilePath).exists()) {
return false;
}
try (JarFile zip = new JarFile(moduleFilePath)) {
zip.getManifest();
} catch (IOException e) {
return false;
}
return true;
}
}

View File

@@ -97,7 +97,7 @@
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>1.2.22</version>
<version>1.2.19</version>
</dependency>
</dependencies>

View File

@@ -120,7 +120,7 @@ public class NetworkUtil {
if (StringUtils.isNotBlank(customUrl)) {
return customUrl;
} else {
return "https://talend-update.talend.com/nexus/content/groups/studio-libraries/";
return "https://talend-update.talend.com/nexus/content/repositories/libraries/";
}
}

View File

@@ -12,8 +12,6 @@
// ============================================================================
package org.talend.commons.ui.swt.dialogs;
import java.util.Map;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.talend.commons.ui.utils.image.ColorUtils;
@@ -31,7 +29,5 @@ public interface IConfigModuleDialog {
public String getMavenURI();
public int open();
public Map<String, String> getModulesMVNUrls();
}

View File

@@ -56,7 +56,7 @@ PropertiesWizardPage.Locker=\u30ED\u30C3\u30AF\u4FDD\u6301\u8005
PropertiesWizardPage.Description=\u8AAC\u660E
PropertiesWizardPage.EmptyDescWarning=\u8AAC\u660E\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5165\u529B\u3092\u63A8\u5968\u3057\u307E\u3059\u3002
PropertiesWizardPage.EmptyPurposeWarning=\u76EE\u7684\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5165\u529B\u3092\u63A8\u5968\u3057\u307E\u3059
PropertiesWizardPage.ItemExistsError=\u9805\u76EE\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.ItemExistsError=\u30A2\u30A4\u30C6\u30E0\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.KeywordsError=\u540D\u524D\u304C\u6709\u52B9\u306AID\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
PropertiesWizardPage.Name=\u540D\u524D
PropertiesWizardPage.NameEmptyError=\u540D\u524D\u304C\u7A7A\u3067\u3059\u3002

View File

@@ -27,6 +27,10 @@ import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Level;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.ICoreService;
import org.talend.core.PluginChecker;
@@ -35,22 +39,22 @@ import org.talend.core.model.properties.RoutineItem;
import org.talend.core.model.properties.SQLPatternItem;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.pendo.AbstractPendoTrackManager;
import org.talend.core.pendo.PendoDataTrackFactory;
import org.talend.core.pendo.PendoItemSignatureUtil;
import org.talend.core.pendo.PendoItemSignatureUtil.SignatureStatus;
import org.talend.core.pendo.PendoItemSignatureUtil.TOSProdNameEnum;
import org.talend.core.pendo.PendoItemSignatureUtil.ValueEnum;
import org.talend.core.pendo.PendoTrackDataUtil;
import org.talend.core.pendo.TrackEvent;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.pendo.PendoTrackDataUtil.TrackEvent;
import org.talend.core.pendo.PendoTrackSender;
import org.talend.core.pendo.properties.PendoSignLogonProperties;
import org.talend.utils.migration.MigrationTokenUtil;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoItemSignatureManager extends AbstractPendoTrackManager {
public class PendoItemSignatureManager {
private PendoSignLogonProperties itemSignProperties = new PendoSignLogonProperties();
private static PendoItemSignatureManager manager;
@@ -59,7 +63,7 @@ public class PendoItemSignatureManager extends AbstractPendoTrackManager {
static {
manager = new PendoItemSignatureManager();
try {
isTrackAvailable = PluginChecker.isTIS() && PendoDataTrackFactory.getInstance().isTrackSendAvailable();
isTrackAvailable = PluginChecker.isTIS() && PendoTrackSender.getInstance().isTrackSendAvailable();
} catch (Exception e) {
ExceptionHandler.process(e, Level.WARN);
}
@@ -83,12 +87,11 @@ public class PendoItemSignatureManager extends AbstractPendoTrackManager {
}
}
public IPendoDataProperties collectProperties() {
public void collectProperties() {
ICoreService coreService = ICoreService.get();
if (coreService == null || !isTrackAvailable) {
return null;
return;
}
PendoSignLogonProperties itemSignProperties = new PendoSignLogonProperties();
try {
itemSignProperties.setSignByMigration(signByLoginMigrationItems.size());
@@ -185,7 +188,6 @@ public class PendoItemSignatureManager extends AbstractPendoTrackManager {
} catch (Exception e) {
ExceptionHandler.process(e, Level.WARN);
}
return itemSignProperties;
}
@@ -256,12 +258,23 @@ public class PendoItemSignatureManager extends AbstractPendoTrackManager {
if (!isTrackAvailable) {
return;
}
super.sendTrackToPendo();
}
Job job = new Job("send pendo track") {
@Override
public TrackEvent getTrackEvent() {
return TrackEvent.ITEM_SIGNATURE;
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
collectProperties();
PendoTrackSender.getInstance().sendTrackData(TrackEvent.ITEM_SIGNATURE, itemSignProperties);
} catch (Exception e) {
// warning only
ExceptionHandler.process(e, Level.WARN);
}
return Status.OK_STATUS;
}
};
job.setUser(false);
job.setPriority(Job.INTERACTIVE);
job.schedule();
}
}

View File

@@ -2380,12 +2380,10 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
String str[] = new String[] { getRepositoryContext().getUser() + "", projectManager.getCurrentProject() + "" }; //$NON-NLS-1$ //$NON-NLS-2$
log.info(Messages.getString("ProxyRepositoryFactory.log.loggedOn", str)); //$NON-NLS-1$
} catch (LoginException e) {
if (!LoginException.RESTART.equals(e.getKey())) {
try {
logOffProject();
} catch (Exception e1) {
ExceptionHandler.process(e1);
}
try {
logOffProject();
} catch (Exception e1) {
ExceptionHandler.process(e1);
}
throw e;
} catch (PersistenceException e) {
@@ -2563,6 +2561,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
public void logOffProject() {
// getRepositoryContext().setProject(null);
repositoryFactoryFromProvider.logOffProject();
if (!CommonsPlugin.isHeadless()) {
ProjectRepositoryNode root = ProjectRepositoryNode.getInstance();
if (root != null) {
@@ -2618,7 +2617,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
ReferenceProjectProvider.clearTacReferenceList();
ReferenceProjectProblemManager.getInstance().clearAll();
repositoryFactoryFromProvider.logOffProject();
fullLogonFinished = false;
}

View File

@@ -48,8 +48,6 @@ import org.talend.commons.runtime.model.emf.provider.EmfResourcesFactoryReader;
*/
public class TalendResourceSet extends ResourceSetImpl {
private boolean showLog;
public TalendResourceSet() {
super();
@@ -60,14 +58,6 @@ public class TalendResourceSet extends ResourceSetImpl {
getLoadOptions().put(XMLResource.OPTION_USE_DEPRECATED_METHODS, Boolean.FALSE);
}
public boolean isShowLog() {
return this.showLog;
}
public void setShowLog(boolean showLog) {
this.showLog = showLog;
}
/*
* (non-Javadoc)
*
@@ -93,13 +83,7 @@ public class TalendResourceSet extends ResourceSetImpl {
Resource resource = map.get(uri);
if (resource != null) {
if (loadOnDemand && !resource.isLoaded()) {
try {
demandLoadHelper(resource);
} catch (Exception e) {
if (showLog) {
throw new RuntimeException(e);
}
}
demandLoadHelper(resource);
}
return resource;
}
@@ -115,13 +99,7 @@ public class TalendResourceSet extends ResourceSetImpl {
}
if (theURIConverter.normalize(resource.getURI()).equals(normalizedURI)) {
if (loadOnDemand && !resource.isLoaded()) {
try {
demandLoadHelper(resource);
} catch (Exception e) {
if (showLog) {
throw new RuntimeException(e);
}
}
demandLoadHelper(resource);
}
if (map != null) {
@@ -147,13 +125,7 @@ public class TalendResourceSet extends ResourceSetImpl {
+ "'; a registered resource factory is needed");
}
try {
demandLoadHelper(resource);
} catch (Exception e) {
if (showLog) {
throw new RuntimeException(e);
}
}
demandLoadHelper(resource);
if (map != null) {
map.put(uri, resource);

View File

@@ -390,10 +390,6 @@ public class XmiResourceManager {
}
public Resource getItemResource(ResourceSet resourceSet, Item item, boolean forceLoad) {
return getItemResource(getResourceSet(), item, forceLoad, false);
}
public Resource getItemResource(ResourceSet resourceSet, Item item, boolean forceLoad, boolean showLog) {
if (item == null) {
return null;
}
@@ -406,23 +402,13 @@ public class XmiResourceManager {
} else {
itemResourceURI = getItemResourceURI(getItemURI(item));
}
Resource itemResource = null;
try {
if (resourceSet instanceof TalendResourceSet) {
((TalendResourceSet) resourceSet).setShowLog(showLog);
}
itemResource = resourceSet.getResource(itemResourceURI, false);
if (forceLoad && itemResource == null) {
if (item instanceof FileItem) {
itemResource = new ByteArrayResource(itemResourceURI);
resourceSet.getResources().add(itemResource);
}
itemResource = resourceSet.getResource(itemResourceURI, true);
}
} catch (Exception e) {
if (showLog) {
throw new RuntimeException(e);
Resource itemResource = resourceSet.getResource(itemResourceURI, false);
if (forceLoad && itemResource == null) {
if (item instanceof FileItem) {
itemResource = new ByteArrayResource(itemResourceURI);
resourceSet.getResources().add(itemResource);
}
itemResource = resourceSet.getResource(itemResourceURI, true);
}
return itemResource;
}
@@ -642,7 +628,7 @@ public class XmiResourceManager {
boolean isTestContainer = false;
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
ITestContainerProviderService testContainerService = GlobalServiceRegister
ITestContainerProviderService testContainerService = (ITestContainerProviderService) GlobalServiceRegister
.getDefault().getService(ITestContainerProviderService.class);
if (testContainerService != null) {
isTestContainer = testContainerService.isTestContainerItem(property.getItem());

View File

@@ -21,8 +21,7 @@ bin.includes = META-INF/,\
plugin_ja.properties,\
plugin_ru.properties,\
plugin_swtbot.properties,\
plugin_zh_CN.properties,\
resources/
plugin_zh_CN.properties
src.includes = META-INF/,\
mappingMetadataTypes.xml,\
mappings/,\

View File

@@ -1,59 +0,0 @@
# Component
tSnowflakeConnection=java.base/java.nio
tSnowflakeClose=java.base/java.nio
tSnowflakeCommit=java.base/java.nio
tSnowflakeInput=java.base/java.nio
tSnowflakeOutput=java.base/java.nio
tSnowflakeOutputBulk=java.base/java.nio
tSnowflakeOutputBulkExec=java.base/java.nio
tSnowflakeRow=java.base/java.nio
tSnowflakeBulkExec=java.base/java.nio
tSnowflakeRollback=java.base/java.nio
tCouchbaseInput=java.base/java.lang.invoke
tCouchbaseOutput=java.base/java.lang.invoke
tCouchbaseDCPInput=java.base/java.lang.invoke
tCouchbaseDCPOutput=java.base/java.lang.invoke
tWriteJSONField=java.xml/com.sun.org.apache.xerces.internal.parsers,java.xml/com.sun.org.apache.xerces.internal.util
tFTPClose=java.base/sun.security.ssl,java.base/sun.security.util
tFTPConnection=java.base/sun.security.ssl,java.base/sun.security.util
tFTPDelete=java.base/sun.security.ssl,java.base/sun.security.util
tFTPFileExist=java.base/sun.security.ssl,java.base/sun.security.util
tFTPFileList=java.base/sun.security.ssl,java.base/sun.security.util
tFTPFileProperties=java.base/sun.security.ssl,java.base/sun.security.util
tFTPGet=java.base/sun.security.ssl,java.base/sun.security.util
tFTPPut=java.base/sun.security.ssl,java.base/sun.security.util
tFTPRename=java.base/sun.security.ssl,java.base/sun.security.util
tFTPTruncate=java.base/sun.security.ssl,java.base/sun.security.util
tNeo4jBatchOutput=java.base/java.lang,java.base/sun.nio.ch
tNeo4jBatchOutputRelationship=java.base/java.lang,java.base/sun.nio.ch
tNeo4jBatchSchema=java.base/java.lang,java.base/sun.nio.ch
tNeo4jClose=java.base/java.lang,java.base/sun.nio.ch
tNeo4jConnection=java.base/java.lang,java.base/sun.nio.ch
tNeo4jImportTool=java.base/java.lang,java.base/sun.nio.ch
tNeo4jInput=java.base/java.lang,java.base/sun.nio.ch
tNeo4jRow=java.base/java.lang,java.base/sun.nio.ch
tMongoDBOutput=java.xml/com.sun.org.apache.xerces.internal.parsers,java.xml/com.sun.org.apache.xerces.internal.util
tCosmosDBOutput=java.xml/com.sun.org.apache.xerces.internal.parsers,java.xml/com.sun.org.apache.xerces.internal.util
tMatchGroup=java.base/java.io
tRuleSurvivorship=java.base/java.lang
tRecordMatching=java.base/java.io
tDqReportRun=java.base/java.lang,java.base/java.nio
tWebService=java.base/java.lang
tWebServiceInput=java.base/java.lang
# TCK framework
TCK_COMMON_ARGS=java.base/java.io,java.base/java.lang.invoke,java.base/java.lang.reflect,java.base/java.lang,java.base/java.net,java.base/java.nio,java.base/java.util,java.base/sun.nio.ch
# BigData distribution
SPARK_3_3_x=java.base/java.nio,java.base/sun.nio.ch,java.base/java.util,java.base/java.lang.invoke,java.base/sun.util.calendar
SPARK_3_2_x=java.base/java.nio,java.base/sun.nio.ch,java.base/java.util,java.base/java.lang.invoke,java.base/sun.util.calendar
SPARK_3_1_x=java.base/java.nio,java.base/sun.nio.ch,java.base/java.util,java.base/java.lang.invoke,java.base/sun.util.calendar
SPARK_2_4_x=java.base/java.nio,java.base/sun.nio.ch,java.base/java.util,java.base/java.lang.invoke,java.base/sun.util.calendar

View File

@@ -33,13 +33,6 @@ public class AnalysisReportRecorder extends ItemReportRecorder {
this.detailMessage = detailMessage;
}
public AnalysisReportRecorder(IItemAnalysisTask task, SeverityOption severity, String detailMessage) {
super();
this.task = task;
this.severity = severity;
this.detailMessage = detailMessage;
}
public String getTaskName() {
return task.getName();
}

View File

@@ -1,43 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.analysistask;
import java.util.List;
import java.util.Set;
import org.talend.core.model.properties.Item;
import org.talend.core.model.repository.ERepositoryObjectType;
/**
* created by hcyi on Oct 26, 2022
* Detailled comment
*
*/
public class DefaultItemsAnalysisTask extends AbstractItemAnalysisTask {
public DefaultItemsAnalysisTask() {
}
@Override
public Set<ERepositoryObjectType> getRepositoryObjectTypeScope() {
return null;
}
@Override
public List<AnalysisReportRecorder> execute(Item item) {
// TODO Auto-generated method stub
return null;
}
}

View File

@@ -20,7 +20,6 @@ import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -51,9 +50,7 @@ import org.talend.core.model.general.Project;
import org.talend.core.model.properties.Item;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.runtime.i18n.Messages;
import org.talend.designer.core.IDesignerCoreService;
import org.talend.repository.ProjectManager;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.IRepositoryService;
@@ -76,7 +73,7 @@ public class ItemAnalysisReportManager {
private AtomicBoolean inGenerating = new AtomicBoolean(false);
public List<AnalysisReportRecorder> executeAnalysisTask(Project project) {
IRepositoryService service = GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
IRepositoryService service = (IRepositoryService) GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
IProxyRepositoryFactory repFactory = service.getProxyRepositoryFactory();
List<AnalysisReportRecorder> analysisResultList = new ArrayList<AnalysisReportRecorder>();
List<IItemAnalysisTask> analysisTasks = ItemAnalysisTaskRegistryReader.getInstance().getItemAnalysisTasks();
@@ -108,16 +105,6 @@ public class ItemAnalysisReportManager {
}
}
}
//
ItemAnalysisTaskRegistryReader.getInstance().getAllItemURIsMap().clear();
ItemAnalysisTaskRegistryReader.getInstance().getDuplicatedItemURIsMap().clear();
IDesignerCoreService designerCoreService = CoreRuntimePlugin.getInstance().getDesignerCoreService();
if (designerCoreService != null) {
List<AnalysisReportRecorder> recorder = designerCoreService.analysis(project);
if (recorder != null && !recorder.isEmpty()) {
analysisResultList.addAll(recorder);
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
@@ -203,42 +190,6 @@ public class ItemAnalysisReportManager {
inGenerating.set(newValue);
}
public String getCompleteObjectTypePath(ERepositoryObjectType itemType) {
ERepositoryObjectType rootItemType = itemType;
if (ERepositoryObjectType.JDBC != null && ERepositoryObjectType.JDBC.equals(rootItemType)) {
rootItemType = ERepositoryObjectType.METADATA_CONNECTIONS;
}
List<String> typeLabels = new ArrayList<String>();
findOutCompleteTypePath(rootItemType, typeLabels);
if (ERepositoryObjectType.PROCESS != null && ERepositoryObjectType.PROCESS.equals(rootItemType)) {
IRepositoryService repositoryService = IRepositoryService.get();
if (repositoryService != null) {
String standardNodeLabel = repositoryService.getStandardNodeLabel();
if (StringUtils.isNotBlank(standardNodeLabel)) {
typeLabels.add(standardNodeLabel);
}
}
}
StringBuffer buffer = new StringBuffer();
if (!typeLabels.isEmpty()) {
for (int i = 0; i < typeLabels.size(); i++) {
if (i != 0) {
buffer.append("/");
}
buffer.append(typeLabels.get(i));
}
}
return buffer.toString();
}
public void findOutCompleteTypePath(ERepositoryObjectType type, List<String> typeLabels) {
ERepositoryObjectType parentType = ERepositoryObjectType.findParentType(type);
if (parentType != null) {
findOutCompleteTypePath(parentType, typeLabels);
}
typeLabels.add(type.getLabel());
}
}
class AnalysisReportAccessDialog extends Dialog {

View File

@@ -32,10 +32,6 @@ public class ItemAnalysisTaskRegistryReader extends RegistryReader {
private static final ItemAnalysisTaskRegistryReader INSTANCE = new ItemAnalysisTaskRegistryReader();
private Map<String, String> allItemURIsMap = new HashMap<String, String>();
private Map<String, List<String>> duplicatedItemURIsMap = new HashMap<String, List<String>>();
public static ItemAnalysisTaskRegistryReader getInstance() {
return INSTANCE;
}
@@ -85,17 +81,4 @@ public class ItemAnalysisTaskRegistryReader extends RegistryReader {
idItemAnalysisTaskMap.clear();
}
/**
* Getter for allItemURIsMap.
*
* @return the allItemURIsMap
*/
public Map<String, String> getAllItemURIsMap() {
return this.allItemURIsMap;
}
public Map<String, List<String>> getDuplicatedItemURIsMap() {
return this.duplicatedItemURIsMap;
}
}

View File

@@ -12,8 +12,10 @@
// ============================================================================
package org.talend.commons.report;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.talend.analysistask.ItemAnalysisReportManager;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.GlobalServiceRegister;
@@ -21,6 +23,7 @@ import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.Property;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.ui.ITestContainerCoreService;
import org.talend.repository.model.IRepositoryService;
/**
* DOC jding class global comment. Detailled comment
@@ -31,15 +34,8 @@ public class ItemReportRecorder {
protected String detailMessage;
protected String currentItemPath;
protected String currentItemType;
public String getItemType() {
String type = "";
if (item == null) {
return currentItemType;
}
ERepositoryObjectType itemType = ERepositoryObjectType.getItemType(item);
if (itemType != null) {
if (ERepositoryObjectType.getAllTypesOfTestContainer().contains(itemType)) {
@@ -47,7 +43,7 @@ public class ItemReportRecorder {
if (parentJobItem != null) {
ERepositoryObjectType parentJobType = ERepositoryObjectType.getItemType(parentJobItem);
if (parentJobType != null) {
String parentTypePath = ItemAnalysisReportManager.getInstance().getCompleteObjectTypePath(parentJobType);
String parentTypePath = getCompleteObjectTypePath(parentJobType);
if (StringUtils.isNotBlank(parentTypePath)) {
type = parentTypePath + "/";
}
@@ -55,7 +51,7 @@ public class ItemReportRecorder {
}
type += itemType;
} else {
type = ItemAnalysisReportManager.getInstance().getCompleteObjectTypePath(itemType);
type = getCompleteObjectTypePath(itemType);
}
}
return type;
@@ -63,9 +59,6 @@ public class ItemReportRecorder {
public String getItemPath() {
String path = "";
if (this.currentItemPath != null) {
return this.currentItemPath;
}
StringBuffer buffer = new StringBuffer();
ERepositoryObjectType itemType = ERepositoryObjectType.getItemType(item);
@@ -111,6 +104,42 @@ public class ItemReportRecorder {
return parentJobItem;
}
private String getCompleteObjectTypePath(ERepositoryObjectType itemType) {
ERepositoryObjectType rootItemType = itemType;
if (ERepositoryObjectType.JDBC != null && ERepositoryObjectType.JDBC.equals(rootItemType)) {
rootItemType = ERepositoryObjectType.METADATA_CONNECTIONS;
}
List<String> typeLabels = new ArrayList<String>();
findOutCompleteTypePath(rootItemType, typeLabels);
if (ERepositoryObjectType.PROCESS != null && ERepositoryObjectType.PROCESS.equals(rootItemType)) {
IRepositoryService repositoryService = IRepositoryService.get();
if (repositoryService != null) {
String standardNodeLabel = repositoryService.getStandardNodeLabel();
if (StringUtils.isNotBlank(standardNodeLabel)) {
typeLabels.add(standardNodeLabel);
}
}
}
StringBuffer buffer = new StringBuffer();
if (!typeLabels.isEmpty()) {
for (int i = 0; i < typeLabels.size(); i++) {
if (i != 0) {
buffer.append("/");
}
buffer.append(typeLabels.get(i));
}
}
return buffer.toString();
}
private void findOutCompleteTypePath(ERepositoryObjectType type, List<String> typeLabels) {
ERepositoryObjectType parentType = ERepositoryObjectType.findParentType(type);
if (parentType != null) {
findOutCompleteTypePath(parentType, typeLabels);
}
typeLabels.add(type.getLabel());
}
public Item getItem() {
return item;
}
@@ -119,22 +148,6 @@ public class ItemReportRecorder {
this.item = item;
}
public String getCurrentItemPath() {
return this.currentItemPath;
}
public void setCurrentPath(String currentItemPath) {
this.currentItemPath = currentItemPath;
}
public String getCurrentItemType() {
return this.currentItemType;
}
public void setCurrentItemType(String currentItemType) {
this.currentItemType = currentItemType;
}
public String getDetailMessage() {
return detailMessage;
}

View File

@@ -58,10 +58,6 @@ public final class JavaUtils {
public static final List<String> AVAILABLE_VERSIONS = Arrays.asList(JavaCore.VERSION_1_8 );
public static final String ALLOW_JAVA_INTERNAL_ACCESS = "allow.java.internal.access"; //$NON-NLS-1$
public static final String CUSTOM_ACCESS_SETTINGS = "custom.access.settings"; //$NON-NLS-1$
public static final String PROCESSOR_TYPE = "javaProcessor"; //$NON-NLS-1$
public static final String PATH_SEPARATOR = "/"; //$NON-NLS-1$

View File

@@ -53,5 +53,5 @@ public interface ILibraryManagerUIService extends IService {
public boolean confirmDialog(String originalJarFileName);
public IConfigModuleDialog getConfigModuleDialog(Shell parentShell, String initValue, boolean allowDetectDependencies);
public IConfigModuleDialog getConfigModuleDialog(Shell parentShell, String initValue);
}

View File

@@ -27,8 +27,8 @@ import org.talend.core.database.conn.DatabaseConnConstants;
public enum EDatabaseVersion4Drivers {
// access
ACCESS_JDBC(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, new String[] {
"jackcess-2.1.12.jar", "ucanaccess-2.0.9.5.jar", "commons-lang-2.6.jar", "commons-logging-1.1.3.jar", "hsqldb.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"jackcess-encrypt-2.1.4.jar", "bcprov-jdk15on-1.70.jar", "talend-ucanaccess-utils-1.0.0.jar" })),
"jackcess-2.1.0.jar", "ucanaccess-2.0.9.5.jar", "commons-lang-2.6.jar", "commons-logging-1.1.1.jar", "hsqldb.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"jackcess-encrypt-2.1.0.jar", "bcprov-jdk15on-1.51.jar", "talend-ucanaccess-utils-1.0.0.jar" })),
ACCESS_2003(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, "Access 2003", "Access_2003")), //$NON-NLS-1$ //$NON-NLS-2$
ACCESS_2007(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, "Access 2007", "Access_2007")), //$NON-NLS-1$ //$NON-NLS-2$
// oracle
@@ -69,9 +69,9 @@ public enum EDatabaseVersion4Drivers {
INFORMIX(new DbVersion4Drivers(EDatabaseTypeName.INFORMIX, "ifxjdbc.jar")), //$NON-NLS-1$
SAS_9_1(new DbVersion4Drivers(EDatabaseTypeName.SAS, "SAS 9.1", "SAS_9.1", new String[] { "sas.core.jar", //$NON-NLS-1$
"sas.intrnet.javatools.jar", "sas.svc.connection.jar", "reload4j-1.2.22.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
"sas.intrnet.javatools.jar", "sas.svc.connection.jar", "reload4j-1.2.19.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
SAS_9_2(new DbVersion4Drivers(EDatabaseTypeName.SAS,
"SAS 9.2", "SAS_9.2", new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar", "reload4j-1.2.22.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
"SAS 9.2", "SAS_9.2", new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar", "reload4j-1.2.19.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
SAPHana(new DbVersion4Drivers(EDatabaseTypeName.SAPHana, "HDB 1.0", "HDB_1_0", "ngdbc.jar")), //$NON-NLS-1$
// MYSQL, add for 9594
MYSQL_8(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 8", "MYSQL_8", "mysql-connector-java-8.0.18.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -83,9 +83,9 @@ 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.34.jar", "slf4j-reload4j-1.7.34.jar", "msal4j-1.11.0.jar", //$NON-NLS-1$
"oauth2-oidc-sdk-9.7.jar", "reload4j-1.2.22.jar", "jackson-core-2.13.4.jar",
"jackson-databind-2.13.4.2.jar", "jackson-annotations-2.13.4.jar", "jcip-annotations-1.0-1.jar",
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$
"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",
"content-type-2.1.jar", "lang-tag-1.5.jar" })),
@@ -153,8 +153,8 @@ public enum EDatabaseVersion4Drivers {
REDSHIFT(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT, "redshift", "REDSHIFT", //$NON-NLS-1$ //$NON-NLS-2$
new String[]{ "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
REDSHIFT_SSO(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT_SSO, "redshift sso", "REDSHIFT_SSO", //$NON-NLS-1$ //$NON-NLS-2$
new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar", "aws-java-sdk-1.11.848.jar", "jackson-core-2.13.4.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"jackson-databind-2.13.4.2.jar", "jackson-annotations-2.13.4.jar", "httpcore-4.4.13.jar", "httpclient-4.5.13.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar", "aws-java-sdk-1.11.848.jar", "jackson-core-2.11.4.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"jackson-databind-2.11.4.jar", "jackson-annotations-2.11.4.jar", "httpcore-4.4.13.jar", "httpclient-4.5.13.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
"joda-time-2.8.1.jar", "commons-logging-1.2.jar", "commons-codec-1.14.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
"aws-java-sdk-redshift-internal-1.12.x.jar" })), //$NON-NLS-1$

View File

@@ -38,10 +38,7 @@ public class HadoopClassLoaderFactory2 {
public static ClassLoader getHDFSClassLoader(String relatedClusterId, String distribution, String version, boolean useKrb) {
return getClassLoader(relatedClusterId, EHadoopCategory.HDFS, distribution, version, useKrb);
}
public static ClassLoader getHDFSKnoxClassLoader(String relatedClusterId, String distribution, String version, boolean useKrb) {
return HadoopClassLoaderFactory2.getClassLoader(relatedClusterId, EHadoopCategory.HDFS, distribution, version, useKrb,
IHadoopArgs.HDFS_ARG_KNOX);
}
public static ClassLoader getMRClassLoader(String relatedClusterId, String distribution, String version, boolean useKrb) {
return getClassLoader(relatedClusterId, EHadoopCategory.MAP_REDUCE, distribution, version, useKrb);
}

View File

@@ -22,6 +22,4 @@ public interface IHadoopArgs {
public static final String HIVE_ARG_STANDALONE = "STANDALONE"; //$NON-NLS-1$
public static final String HDFS_ARG_KNOX = "USE_KNOX"; //$NON-NLS-1$
}

View File

@@ -20,7 +20,7 @@ import org.apache.commons.lang.StringUtils;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.pendo.PendoDataTrackFactory;
import org.talend.core.pendo.PendoTrackSender;
import org.talend.core.runtime.i18n.Messages;
import org.talend.core.service.ICloudSignOnService;
import org.talend.repository.model.RepositoryConstants;
@@ -254,7 +254,7 @@ public class ConnectionBean implements Cloneable {
String user = conDetails.getString(USER);
if (isToken()) {
String url = getDynamicFields().get(RepositoryConstants.REPOSITORY_URL);
user = PendoDataTrackFactory.getInstance().getTmcUser(url, getPassword());
user = PendoTrackSender.getInstance().getTmcUser(url, getPassword());
if (StringUtils.isNotBlank(user)) {
setUser(user);
}

View File

@@ -19,8 +19,7 @@ public class SparkBatchMetadataTalendTypeFilter extends SparkMetadataTalendTypeF
"tJDBCInput",
"tJDBCOutput",
"tLogRow",
"tAvroInput",
"tMongoDBInput",
"tMongoDBInput",
"tMongoDBOutput",
"tSqlRow"
);

View File

@@ -85,7 +85,7 @@ public class TalendLibsServerManager {
public static final String TALEND_LIB_PASSWORD = "";//$NON-NLS-1$
public static final String TALEND_LIB_REPOSITORY = "studio-libraries";//$NON-NLS-1$
public static final String TALEND_LIB_REPOSITORY = "libraries";//$NON-NLS-1$
private static TalendLibsServerManager manager = null;

View File

@@ -1,73 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.pendo;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.service.IRemoteService;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoDataTrackFactory {
private static PendoDataTrackFactory instance;
private static IRemoteService remoteService;
static {
instance = new PendoDataTrackFactory();
remoteService = IRemoteService.get();
}
private PendoDataTrackFactory() {
}
public static PendoDataTrackFactory getInstance() {
return instance;
}
public boolean isTrackSendAvailable() throws Exception {
if (remoteService != null) {
return remoteService.isPendoTrackAvailable();
}
return false;
}
public void sendTrackData(TrackEvent event, IPendoDataProperties properties) throws Exception {
if (remoteService != null) {
remoteService.sendPendoTrackData(event, properties);
}
}
public void sendProjectLoginTrack() {
if (remoteService != null) {
AbstractPendoTrackManager pendoProjectLoginManager = remoteService.getPendoProjectLoginManager();
pendoProjectLoginManager.sendTrackToPendo();
}
}
public void sendGenericTrack(TrackEvent event, IPendoDataProperties properties) {
if (remoteService != null) {
AbstractPendoTrackManager genericManager = remoteService.getPendoGenericManager(event, properties);
genericManager.sendTrackToPendo();
}
}
public String getTmcUser(String url, String token) {
if (remoteService != null) {
return remoteService.getTmcUser(url, token);
}
return "";
}
}

View File

@@ -12,12 +12,26 @@
// ============================================================================
package org.talend.core.pendo;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.VersionUtils;
import org.talend.core.model.general.Project;
import org.talend.core.model.properties.ProjectReference;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.pendo.properties.PendoLoginProperties;
import org.talend.core.service.ICloudSignOnService;
import org.talend.core.service.IStudioLiteP2Service;
import org.talend.core.service.IStudioLiteP2Service.UpdateSiteConfig;
import org.talend.core.ui.IInstalledPatchService;
import org.talend.repository.ProjectManager;
import org.talend.utils.json.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -50,6 +64,47 @@ public class PendoTrackDataUtil {
return content;
}
public static IPendoDataProperties getLoginEventProperties() {
String studioPatch = getLatestPatchInstalledVersion();
PendoLoginProperties loginEvent = new PendoLoginProperties();
IStudioLiteP2Service studioLiteP2Service = IStudioLiteP2Service.get();
try {
if (studioLiteP2Service != null) {
List<String> enabledFeatures = new ArrayList<String>();
List<String> enabledFeaturesList = studioLiteP2Service.getCurrentProjectEnabledFeatures();
enabledFeaturesList.stream().forEach(feature -> {
String result = feature;
if (result.startsWith(FEATURE_PREFIX)) {
result = result.substring(FEATURE_PREFIX.toCharArray().length);
}
if (result.endsWith(FEATURE_TAIL)) {
result = result.substring(0, result.lastIndexOf(FEATURE_TAIL));
}
enabledFeatures.add(result);
});
loginEvent.setEnabledFeatures(enabledFeatures);
}
setUpRefProjectsStructure(loginEvent);
loginEvent.setIsOneClickLogin(Boolean.FALSE.toString());
if (ICloudSignOnService.get() != null && ICloudSignOnService.get().isSignViaCloud()) {
loginEvent.setIsOneClickLogin(Boolean.TRUE.toString());
}
loginEvent.setManagedUpdate(Boolean.FALSE.toString());
if (IStudioLiteP2Service.get() != null) {
IProgressMonitor monitor = new NullProgressMonitor();
UpdateSiteConfig config = IStudioLiteP2Service.get().getUpdateSiteConfig(monitor);
if (config.isEnableTmcUpdateSettings(monitor) && !config.isOverwriteTmcUpdateSettings(monitor)) {
loginEvent.setManagedUpdate(Boolean.TRUE.toString());
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
loginEvent.setStudioVersion(VersionUtils.getInternalMajorVersion());
loginEvent.setStudioPatch(studioPatch);
return loginEvent;
}
public static String getLatestPatchInstalledVersion() {
String studioPatch = "";
IInstalledPatchService installedPatchService = IInstalledPatchService.get();
@@ -59,6 +114,52 @@ public class PendoTrackDataUtil {
return studioPatch;
}
private static void setUpRefProjectsStructure(PendoLoginProperties loginEvent) {
ProjectManager projectManager = ProjectManager.getInstance();
Project currentProject = projectManager.getCurrentProject();
Map<String, Project> teclabelProjectMap = new HashMap<String, Project>();
List<Project> allReferencedProjects = projectManager.getAllReferencedProjects();
allReferencedProjects.forEach(refProject -> {
String technicalLabel = refProject.getTechnicalLabel();
if (StringUtils.isNotBlank(technicalLabel)) {
teclabelProjectMap.put(technicalLabel, refProject);
}
});
int[] refCount = new int[] {0};
List<String> resultList = new ArrayList<String>();
Map<String, String> desensitiveLabelMap = new HashMap<String, String>();
findReferencePorjectPath(currentProject, "Main", resultList, refCount, desensitiveLabelMap, teclabelProjectMap);
loginEvent.setRefProjectList(resultList);
loginEvent.setRefProjectCount(String.valueOf(desensitiveLabelMap.keySet().size()));
}
public static void findReferencePorjectPath(Project currentProject, String path, List<String> resultList, int[] refCount,
Map<String, String> desensitiveLabelMap, Map<String, Project> teclabelProjectMap) {
List<ProjectReference> projectReferenceList = currentProject.getProjectReferenceList();
for (ProjectReference projectReference : projectReferenceList) {
String structPath = path;
if (projectReference.getReferencedProject() == null) {
continue;
}
String technicalLabel = projectReference.getReferencedProject().getTechnicalLabel();
Project refProject = teclabelProjectMap.get(technicalLabel);
if (StringUtils.isBlank(technicalLabel) || refProject == null) {
continue;
}
String desensitiveLabel = desensitiveLabelMap.get(technicalLabel);
if (StringUtils.isBlank(desensitiveLabel)) {
refCount[0] = refCount[0] + 1;
desensitiveLabel = "Ref" + refCount[0];
desensitiveLabelMap.put(technicalLabel, desensitiveLabel);
}
structPath = structPath + "/" + desensitiveLabel;
resultList.add(structPath);
findReferencePorjectPath(refProject, structPath, resultList, refCount, desensitiveLabelMap, teclabelProjectMap);
}
}
public static String convertEntityJsonString(Object entity) {
ObjectMapper mapper = new ObjectMapper();
try {
@@ -72,4 +173,30 @@ public class PendoTrackDataUtil {
return "";
}
public enum TrackEvent {
PROJECT_LOGIN("Project Login"),
IMPORT_API_DEF("Import API Definition"),
UPDATE_API_DEF("Update API Definition"),
USE_API_DEF("Use API Definition"),
OPEN_IN_APIDesigner("Open in API Designer"),
OPEN_IN_APITester("Open in API Tester"),
OPEN_API_DOCUMENTATION("Open API Documentation"),
AUTOMAP("tMap Automap"),
TMAP("tMap"),
ITEM_IMPORT("Import items"),
ITEM_SIGNATURE("Item Signature");
private String event;
TrackEvent(String event) {
this.event = event;
}
public String getEvent() {
return event;
}
}
}

View File

@@ -0,0 +1,325 @@
// ============================================================================
//
// 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.core.pendo;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.StatusLine;
import org.apache.http.client.entity.EntityBuilder;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.entity.ContentType;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import org.apache.log4j.Level;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.network.IProxySelectorProvider;
import org.talend.commons.utils.network.NetworkUtil;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.context.Context;
import org.talend.core.context.RepositoryContext;
import org.talend.core.nexus.HttpClientTransport;
import org.talend.core.pendo.PendoTrackDataUtil.TrackEvent;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.service.IRemoteService;
import org.talend.repository.model.RepositoryConstants;
import org.talend.utils.json.JSONObject;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoTrackSender {
public static final String PROP_PENDO_LOCAL_CHECK = "talend.pendo.localDebug";
public static final String PROP_PENDO_LOG_DATA = "talend.pendo.logRuntimeData";
private static final String PREFIX_API = "api";
private static final String PENDO_INFO = "/monitoring/pendo/info";
private static final String PENDO_TRACK = "/monitoring/pendo/track";
private static final String HEAD_AUTHORIZATION = "Authorization";
private static final String HEAD_CONTENT_TYPE = "Content-Type";
private static final String HEAD_PENDO_KEY = "x-pendo-integration-key";
private static PendoTrackSender instance;
private static String adminUrl;
private static String apiBaseUrl;
private static String pendoInfo;
private PendoTrackSender() {
}
static {
instance = new PendoTrackSender();
RepositoryContext repositoryContext = getRepositoryContext();
if (repositoryContext != null) {
adminUrl = repositoryContext.getFields().get(RepositoryConstants.REPOSITORY_URL);
}
}
public static PendoTrackSender getInstance() {
if (StringUtils.isBlank(adminUrl)) {
RepositoryContext repositoryContext = getRepositoryContext();
if (repositoryContext != null) {
adminUrl = repositoryContext.getFields().get(RepositoryConstants.REPOSITORY_URL);
}
}
return instance;
}
public void sendToPendo(TrackEvent event, IPendoDataProperties properties) {
Job job = new Job("send pendo track") {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
if (isTrackSendAvailable()) {
sendTrackData(event, properties);
}
} catch (Exception e) {
// warning only
ExceptionHandler.process(e, Level.WARN);
}
return Status.OK_STATUS;
}
};
job.setUser(false);
job.setPriority(Job.INTERACTIVE);
job.schedule();
}
public void sendTrackData(TrackEvent event, IPendoDataProperties properties) throws Exception {
if (isPendoLocalDebug()) {
ExceptionHandler.log(event.getEvent() + ":" + PendoTrackDataUtil.convertEntityJsonString(properties));
return;
}
DefaultHttpClient client = null;
CloseableHttpResponse response = null;
IProxySelectorProvider proxySelectorProvider = null;
try {
String pendoInfo = getPendoInfo();
if (StringUtils.isBlank(pendoInfo)) {
throw new Exception("Pendo information is empty");
}
String pendoKey = getPendoKeyFromLicense();
if (StringUtils.isBlank(pendoKey)) {
throw new Exception("Pendo key is empty");
}
client = new DefaultHttpClient();
String url = getBaseUrl() + PENDO_TRACK;
HttpPost httpPost = new HttpPost(url);
httpPost.setHeader(HEAD_CONTENT_TYPE, ContentType.APPLICATION_JSON.getMimeType());
httpPost.setHeader(HEAD_PENDO_KEY, pendoKey);
proxySelectorProvider = HttpClientTransport.addProxy(client, new URI(url));
EntityBuilder entityBuilder = EntityBuilder.create();
String trackData = PendoTrackDataUtil.generateTrackData(pendoInfo, event, properties);
entityBuilder.setText(trackData).setContentType(ContentType.APPLICATION_JSON);
HttpEntity entity = entityBuilder.build();
httpPost.setEntity(entity);
response = client.execute(httpPost, HttpClientContext.create());
StatusLine statusLine = response.getStatusLine();
String responseStr = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
if (isLogPendoData()) {
ExceptionHandler.log(trackData);
}
if (HttpURLConnection.HTTP_OK != statusLine.getStatusCode()) {
throw new Exception(statusLine.toString() + ", server message: [" + responseStr + "]");
}
} finally {
HttpClientTransport.removeProxy(proxySelectorProvider);
client.getConnectionManager().shutdown();
if (response != null) {
try {
response.close();
} catch (Throwable e) {
ExceptionHandler.process(e);
}
}
if (client != null) {
try {
client.close();
} catch (Throwable e) {
ExceptionHandler.process(e);
}
}
}
}
public boolean isTrackSendAvailable() throws Exception {
if (isPendoLocalDebug() || checkTokenUsed(adminUrl) && NetworkUtil.isNetworkValid()) {
return true;
}
return false;
}
public boolean isPendoLocalDebug() {
return Boolean.TRUE.toString().equals(System.getProperty(PROP_PENDO_LOCAL_CHECK));
}
public boolean isLogPendoData() {
return Boolean.TRUE.toString().equals(System.getProperty(PROP_PENDO_LOG_DATA));
}
private String getPendoInfo() throws Exception {
if (StringUtils.isBlank(pendoInfo)) {
pendoInfo = getPendoInfo(getBaseUrl(), getToken());
}
return pendoInfo;
}
private String getPendoInfo(String baseUrl, String token) throws Exception {
DefaultHttpClient client = null;
CloseableHttpResponse response = null;
IProxySelectorProvider proxySelectorProvider = null;
try {
client = new DefaultHttpClient();
String url = baseUrl + PENDO_INFO;
HttpGet httpGet = new HttpGet(url);
httpGet.setHeader(HEAD_AUTHORIZATION, "Bearer " + token);
proxySelectorProvider = HttpClientTransport.addProxy(client, new URI(url));
response = client.execute(httpGet, HttpClientContext.create());
StatusLine statusLine = response.getStatusLine();
String responseStr = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
if (HttpURLConnection.HTTP_OK != statusLine.getStatusCode()) {
throw new Exception(statusLine.toString() + ", server message: [" + responseStr + "]");
}
return responseStr;
} finally {
HttpClientTransport.removeProxy(proxySelectorProvider);
client.getConnectionManager().shutdown();
if (response != null) {
try {
response.close();
} catch (Throwable e) {
ExceptionHandler.process(e);
}
}
if (client != null) {
try {
client.close();
} catch (Throwable e) {
ExceptionHandler.process(e);
}
}
}
}
private boolean checkTokenUsed(String adminUrl) throws Exception {
if (StringUtils.isNotBlank(adminUrl) && GlobalServiceRegister.getDefault().isServiceRegistered(IRemoteService.class)) {
IRemoteService service = GlobalServiceRegister.getDefault().getService(IRemoteService.class);
return service.isTokenUsed(adminUrl);
}
return false;
}
public String getBaseUrl() throws Exception {
return getBaseUrl(adminUrl, false);
}
public String getBaseUrl(String adminUrl, boolean token) throws Exception {
if (StringUtils.isNotBlank(apiBaseUrl) && !token) {
return apiBaseUrl;
}
try {
URL url = new URL(adminUrl);
// tmc.int.cloud.talend.com
String authority = url.getAuthority();
String regex = "(\\w*\\-*\\w*\\.?){2}\\.(talend.com)";
Pattern pattern= Pattern.compile(regex);
Matcher match = pattern.matcher(authority);
if (match.find()) {
// int.cloud.talend.com
authority = match.group(0);
URL apiURL = new URL(url.getProtocol(), PREFIX_API + "." + authority, "");
// https://api.int.cloud.talend.com
apiBaseUrl = apiURL.toString();
} else {
throw new Exception("Can't match pendo url from " + adminUrl);
}
} catch (MalformedURLException e) {
throw new Exception("Invalid url " + adminUrl, e.getCause());
}
return apiBaseUrl;
}
private String getToken() {
return getRepositoryContext().getClearPassword();
}
public String getTmcUser(String url, String token) {
try {
String pendoInfo = getPendoInfo(getBaseUrl(url, true), token);
if (StringUtils.isNotBlank(pendoInfo)) {
JSONObject infoJson = new JSONObject(pendoInfo);
return ((JSONObject) infoJson.get("visitor")).getString("id"); //$NON-NLS-1$ //$NON-NLS-2$
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
return ""; //$NON-NLS-1$
}
private String getPendoKeyFromLicense() throws Exception {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRemoteService.class)) {
IRemoteService service = GlobalServiceRegister.getDefault().getService(IRemoteService.class);
return service.getPendoKeyFromLicense();
}
return null;
}
private static RepositoryContext getRepositoryContext() {
RepositoryContext repositoryContext = (RepositoryContext) CoreRuntimePlugin.getInstance().getContext()
.getProperty(Context.REPOSITORY_CONTEXT_KEY);
return repositoryContext;
}
public void setAdminUrl(String adminUrl) {
PendoTrackSender.adminUrl = adminUrl;
}
public void setApiBaseUrl(String apiBaseUrl) {
PendoTrackSender.apiBaseUrl = apiBaseUrl;
}
}

View File

@@ -1,79 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.pendo;
/**
* DOC jding class global comment. Detailled comment
*/
public enum TrackEvent {
/**
* create by TUP-33421 update by TUP-34791, TUP-35523, TUP-36780
*/
PROJECT_LOGIN("Project Login"),
/**
* create by TUP-33990
*/
IMPORT_API_DEF("Import API Definition"),
/**
* create by TUP-33990
*/
UPDATE_API_DEF("Update API Definition"),
/**
* create by TUP-33990
*/
USE_API_DEF("Use API Definition"),
/**
* create by TUP-33990
*/
OPEN_IN_APIDesigner("Open in API Designer"),
/**
* create by TUP-33990
*/
OPEN_IN_APITester("Open in API Tester"),
/**
* create by TUP-33990
*/
OPEN_API_DOCUMENTATION("Open API Documentation"),
/**
* create by TUP-35644
*/
AUTOMAP("tMap Automap"),
/**
* create by TUP-35644 update by TUP-36710
*/
TMAP("tMap"),
/**
* create by TUP-35712 update by TUP-36893
*/
ITEM_IMPORT("Import items"),
/**
* create by TUP-35712
*/
ITEM_SIGNATURE("Item Signature");
private String event;
TrackEvent(String event) {
this.event = event;
}
public String getEvent() {
return event;
}
}

View File

@@ -10,7 +10,7 @@
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.pendo;
package org.talend.core.pendo.mapper;
import org.apache.log4j.Level;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -18,24 +18,16 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.pendo.PendoTrackDataUtil.TrackEvent;
import org.talend.core.pendo.PendoTrackSender;
import org.talend.core.pendo.properties.PendoTMapProperties;
/**
* DOC jding class global comment. Detailled comment
*/
public abstract class AbstractPendoTrackManager {
public abstract class AbstractPendoTMapManager {
public abstract TrackEvent getTrackEvent();
public abstract IPendoDataProperties collectProperties();
public boolean isTrackSendAvailable() throws Exception {
return PendoDataTrackFactory.getInstance().isTrackSendAvailable();
}
public void sendTrackData(TrackEvent event, IPendoDataProperties properties) throws Exception {
PendoDataTrackFactory.getInstance().sendTrackData(event, properties);
}
protected abstract PendoTMapProperties calculateProperties();
public void sendTrackToPendo() {
Job job = new Job("send pendo track") {
@@ -43,9 +35,9 @@ public abstract class AbstractPendoTrackManager {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
if (isTrackSendAvailable()) {
IPendoDataProperties properties = collectProperties();
sendTrackData(getTrackEvent(), properties);
if (PendoTrackSender.getInstance().isTrackSendAvailable()) {
PendoTMapProperties properties = calculateProperties();
PendoTrackSender.getInstance().sendTrackData(TrackEvent.TMAP, properties);
}
} catch (Exception e) {
// warning only

View File

@@ -12,9 +12,8 @@
// ============================================================================
package org.talend.core.pendo.mapper;
import org.talend.core.pendo.AbstractPendoTrackManager;
import org.talend.core.pendo.TrackEvent;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.pendo.PendoTrackDataUtil.TrackEvent;
import org.talend.core.pendo.PendoTrackSender;
import org.talend.core.pendo.properties.PendoAutoMapProperties;
/**
@@ -22,7 +21,7 @@ import org.talend.core.pendo.properties.PendoAutoMapProperties;
*
* DOC jding class global comment. Detailled comment
*/
public class PendoAutoMapManager extends AbstractPendoTrackManager {
public class PendoAutoMapManager {
private int mappingChangeCount = 0;
@@ -46,18 +45,9 @@ public class PendoAutoMapManager extends AbstractPendoTrackManager {
if (mappingChangeCount < 1) {
return;
}
super.sendTrackToPendo();
}
@Override
public TrackEvent getTrackEvent() {
return TrackEvent.AUTOMAP;
}
@Override
public IPendoDataProperties collectProperties() {
PendoAutoMapProperties properties = new PendoAutoMapProperties();
properties.setAutoMappings(mappingChangeCount);
return properties;
PendoTrackSender.getInstance().sendToPendo(TrackEvent.AUTOMAP, properties);
}
}

View File

@@ -0,0 +1,171 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.pendo.properties;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* DOC jding class global comment. Detailled comment
*/
public class PendoLoginProperties implements IPendoDataProperties {
@JsonProperty("studio_version")
private String studioVersion;
@JsonProperty("studio_patch")
private String studioPatch;
@JsonProperty("enabled_features")
private List<String> enabledFeatures;
@JsonProperty("referenced_project_number")
private String refProjectCount;
@JsonProperty("referenced_projects")
private List<String> refProjectList;
@JsonProperty("one_click_login")
private String isOneClickLogin;
@JsonProperty("managed_update")
private String managedUpdate;
/**
* Getter for studio_version.
*
* @return the studio_version
*/
public String getStudioVersion() {
return studioVersion;
}
/**
* Sets the studio_version.
*
* @param studio_version the studio_version to set
*/
public void setStudioVersion(String studioVersion) {
this.studioVersion = studioVersion;
}
/**
* Getter for studio_patch.
*
* @return the studio_patch
*/
public String getStudioPatch() {
return studioPatch;
}
/**
* Sets the studio_patch.
*
* @param studio_patch the studio_patch to set
*/
public void setStudioPatch(String studioPatch) {
this.studioPatch = studioPatch;
}
/**
* Getter for enabled_features.
*
* @return the enabled_features
*/
public List<String> getEnabledFeatures() {
return enabledFeatures;
}
/**
* Sets the enabled_features.
*
* @param enabled_features the enabled_features to set
*/
public void setEnabledFeatures(List<String> enabledFeatures) {
this.enabledFeatures = enabledFeatures;
}
/**
* Getter for refProjectCount.
*
* @return the refProjectCount
*/
public String getRefProjectCount() {
return refProjectCount;
}
/**
* Sets the refProjectCount.
*
* @param refProjectCount the refProjectCount to set
*/
public void setRefProjectCount(String refProjectCount) {
this.refProjectCount = refProjectCount;
}
/**
* Getter for refProjectList.
*
* @return the refProjectList
*/
public List<String> getRefProjectList() {
return refProjectList;
}
/**
* Sets the refProjectList.
*
* @param refProjectList the refProjectList to set
*/
public void setRefProjectList(List<String> refProjectList) {
this.refProjectList = refProjectList;
}
/**
* Getter for isOneClickLogin.
*
* @return the isOneClickLogin
*/
public String getIsOneClickLogin() {
return isOneClickLogin;
}
/**
* Sets the isOneClickLogin.
*
* @param isOneClickLogin the isOneClickLogin to set
*/
public void setIsOneClickLogin(String isOneClickLogin) {
this.isOneClickLogin = isOneClickLogin;
}
/**
* Getter for managedUpdate.
*
* @return the managedUpdate
*/
public String getManagedUpdate() {
return managedUpdate;
}
/**
* Sets the managedUpdate.
*
* @param managedUpdate the managedUpdate to set
*/
public void setManagedUpdate(String managedUpdate) {
this.managedUpdate = managedUpdate;
}
}

View File

@@ -203,12 +203,4 @@ public interface ITalendCorePrefConstants {
public static final boolean NEXUS_SHARE_LIBS_DEFAULT = false;
public static final String PERSPECTIVE_PERSIST_SCOPE = "PERSPECTIVE_PERSIST_SCOPE"; //$NON-NLS-1$
public static final String PERSPECTIVE_PERSIST_SCOPE_PROJECT_AND_BRANCH = "PROJECT_AND_BRANCH"; //$NON-NLS-1$
public static final String PERSPECTIVE_PERSIST_SCOPE_STUDIO = "STUDIO"; //$NON-NLS-1$
public static final String PERSPECTIVE_PERSIST_SCOPE_DEFAULT = PERSPECTIVE_PERSIST_SCOPE_PROJECT_AND_BRANCH;
}

View File

@@ -281,7 +281,7 @@ PropertiesWizardPage.Locker=\u30ED\u30C3\u30AF\u4FDD\u6301\u8005
PropertiesWizardPage.Description=\u8AAC\u660E
PropertiesWizardPage.EmptyDescWarning=\u8AAC\u660E\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5165\u529B\u3092\u63A8\u5968\u3057\u307E\u3059\u3002
PropertiesWizardPage.EmptyPurposeWarning=\u76EE\u7684\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5165\u529B\u3092\u63A8\u5968\u3057\u307E\u3059
PropertiesWizardPage.ItemExistsError=\u9805\u76EE\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.ItemExistsError=\u30A2\u30A4\u30C6\u30E0\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.KeywordsError=\u540D\u524D\u304C\u6709\u52B9\u306AID\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
PropertiesWizardPage.Name=\u540D\u524D
PropertiesWizardPage.NameEmptyError=\u540D\u524D\u304C\u7A7A\u3067\u3059\u3002

View File

@@ -231,9 +231,6 @@ public class ProjectPreferenceManager {
if (isCurrentProject) {
try {
Project currentProject = ProjectManager.getInstance().getCurrentProject();
if (qualifier == null) {
qualifier = "org.talend.designer.maven";
}
init(ResourceUtils.getProject(currentProject), qualifier);
} catch (PersistenceException e) {
ExceptionHandler.process(e);

View File

@@ -1,234 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.runtime.util;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Properties;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.util.EList;
import org.talend.commons.CommonsPlugin;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.generation.JavaUtils;
import org.talend.core.model.general.Project;
import org.talend.core.model.process.EParameterFieldType;
import org.talend.core.model.process.IProcess;
import org.talend.core.model.process.JobInfo;
import org.talend.core.model.properties.JobletProcessItem;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.Property;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.runprocess.IProcessor;
import org.talend.repository.ProjectManager;
public class ModuleAccessHelper {
private static final String FORMAT_ADD_OPPENS = "--add-opens=@=ALL-UNNAMED"; //$NON-NLS-1$
private static final String CLASS_PREVIEW_PROCESS = "org.talend.designer.component.preview.shadow.PreviewComponentDataProcess"; //$NON-NLS-1$
private static final String CLASS_GUESS_SCHEMA_PROCESS = "org.talend.designer.core.ui.editor.properties.controllers.AbstractGuessSchemaProcess"; //$NON-NLS-1$
private static Properties PROPS;
public static Properties getProperties() {
if (PROPS == null) {
PROPS = new Properties();
try (InputStream input = getConfigFileURL().openStream()) {
PROPS.load(input);
} catch (IOException e) {
ExceptionHandler.process(e);
}
Optional.ofNullable(System.getProperty("internal.custom.modules")).filter(StringUtils::isNotBlank)
.ifPresent(modules -> put("GLOBAL", modules));
List<Project> allProjects = new ArrayList<>();
allProjects.add(ProjectManager.getInstance().getCurrentProject());
allProjects.addAll(ProjectManager.getInstance().getAllReferencedProjects(true));
for (Project ref : allProjects) {
ProjectPreferenceManager prefManager = new ProjectPreferenceManager(ref, CoreRuntimePlugin.PLUGIN_ID, false);
String settings = prefManager.getValue(JavaUtils.CUSTOM_ACCESS_SETTINGS);
if (StringUtils.isNotBlank(settings)) {
Properties customProps = new Properties();
try {
customProps.load(new ByteArrayInputStream(settings.getBytes()));
customProps.entrySet().stream().filter(en -> StringUtils.isNotBlank((String) en.getValue()))
.forEach(en -> put((String) en.getKey(), (String) en.getValue()));
} catch (IOException e) {
ExceptionHandler.process(e);
}
}
}
}
return PROPS;
}
private static void put(String key, String value) {
PROPS.put(key, PROPS.containsKey(key) ? PROPS.getProperty(key) + "," + value : value);
}
public static URL getConfigFileURL() {
return Platform.getBundle(CoreRuntimePlugin.PLUGIN_ID).getEntry("resources/module_access.properties"); //$NON-NLS-1$
}
private static boolean containsKey(String key) {
return getProperties().containsKey(key);
}
private static Set<String> getModules(String key) {
String modules = getProperties().getProperty(key);
if (modules != null) {
return Stream.of(modules.split(",")).map(module -> FORMAT_ADD_OPPENS.replace("@", module.trim())) //$NON-NLS-1$ //$NON-NLS-2$
.collect(Collectors.toSet());
}
return Collections.emptySet();
}
private static boolean allowJavaInternalAcess(Property property) {
String allow = System.getProperty(JavaUtils.ALLOW_JAVA_INTERNAL_ACCESS);
if (allow != null) {
return Boolean.valueOf(allow);
}
if (CommonsPlugin.isTUJTest() || CommonsPlugin.isJUnitTest() || CommonsPlugin.isJunitWorking()) {
return true;
}
Project project;
if (property != null) {
project = ProjectManager.getInstance()
.getProjectFromProjectTechLabel(ProjectManager.getInstance().getProject(property).getTechnicalLabel());
} else {
project = ProjectManager.getInstance().getCurrentProject();
}
ProjectPreferenceManager preferenceManager = new ProjectPreferenceManager(project, CoreRuntimePlugin.PLUGIN_ID, false);
return preferenceManager.getBoolean(JavaUtils.ALLOW_JAVA_INTERNAL_ACCESS);
}
public static Set<String> getModuleAccessVMArgsForProcessor(IProcessor processor) {
Property property = processor.getProperty();
if (property == null) {
return Collections.emptySet();
}
if (isPreviewProcess(processor)) {
// add all for preview process
return getProperties().entrySet().stream().filter(en -> StringUtils.isNotBlank((String) en.getValue()))
.flatMap(en -> getModules((String) en.getKey()).stream()).collect(Collectors.toSet());
}
if (!allowJavaInternalAcess(property)) {
return Collections.emptySet();
}
ProcessItem mainJobItem = (ProcessItem) property.getItem();
Set<JobInfo> allJobInfos = new HashSet<>();
allJobInfos.add(new JobInfo(mainJobItem, mainJobItem.getProcess().getDefaultContext()));
allJobInfos.addAll(processor.getBuildChildrenJobsAndJoblets());
return ModuleAccessHelper.getModuleAccessVMArgs(property, allJobInfos);
}
@SuppressWarnings("unchecked")
public static Set<String> getModuleAccessVMArgs(Property property, Set<JobInfo> allJobInfos) {
if (property == null || property.getItem() == null || !allowJavaInternalAcess(property)) {
return Collections.emptySet();
}
Set<String> vmArgs = new HashSet<>();
boolean hasTck = false;
for (JobInfo info : allJobInfos) {
EList<NodeType> nodes = null;
EList<ElementParameterType> parameters = null;
if (info.getJobletProperty() != null) {
JobletProcessItem item = (JobletProcessItem) info.getJobletProperty().getItem();
if (item.getJobletProcess() != null) {
nodes = item.getJobletProcess().getNode();
if (item.getJobletProcess().getParameters() != null) {
parameters = item.getJobletProcess().getParameters().getElementParameter();
}
}
} else if (info.getProcessItem() != null && info.getProcessItem().getProcess() != null) {
nodes = info.getProcessItem().getProcess().getNode();
if (info.getProcessItem().getProcess().getParameters() != null) {
parameters = info.getProcessItem().getProcess().getParameters().getElementParameter();
}
}
if (nodes != null) {
nodes.stream().filter(node -> containsKey(node.getComponentName()))
.forEach(node -> vmArgs.addAll(getModules(node.getComponentName())));
}
if (parameters != null) {
// FIXME currently it depends on spark version, refine the condition if needed
Optional<ElementParameterType> optional = parameters.stream()
.filter(p -> "SUPPORTED_SPARK_VERSION".equals(p.getName()) && containsKey(p.getValue())).findFirst();
if (optional.isPresent()) {
vmArgs.addAll(getModules(optional.get().getValue()));
}
}
if (!hasTck) {
hasTck = nodes.stream()
.anyMatch(node -> node.getElementParameter().stream()
.anyMatch(p -> ((ElementParameterType) p).getField() != null
&& EParameterFieldType.TECHNICAL.getName().equals(((ElementParameterType) p).getField())
&& ((ElementParameterType) p).getName().equals("TACOKIT_COMPONENT_ID")));
}
}
if (hasTck) {
vmArgs.addAll(getModules("TCK_COMMON_ARGS"));
}
if (getProperties().containsKey("GLOBAL")) {
vmArgs.addAll(getModules("GLOBAL"));
}
return vmArgs;
}
public static void reset() {
PROPS = null;
}
private static boolean isPreviewProcess(IProcessor processor) {
IProcess process = processor.getProcess();
if (process == null) {
return false;
}
Property property = processor.getProperty();
if ("ID".equals(property.getId()) && "Mock_job_for_Guess_schema".equals(property.getLabel())) {
return true;
}
Class<?> clazz = process.getClass();
// preview process
if (CLASS_PREVIEW_PROCESS.equals(clazz.getName()) || CLASS_PREVIEW_PROCESS.equals(clazz.getSuperclass().getName())) {
return true;
}
// guess schema process
if (CLASS_GUESS_SCHEMA_PROCESS.equals(clazz.getSuperclass().getName())) {
return true;
}
return false;
}
}

View File

@@ -17,9 +17,6 @@ import org.talend.commons.exception.PersistenceException;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
import org.talend.core.nexus.ArtifactRepositoryBean;
import org.talend.core.pendo.AbstractPendoTrackManager;
import org.talend.core.pendo.TrackEvent;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.utils.json.JSONException;
import org.talend.utils.json.JSONObject;
@@ -38,17 +35,11 @@ public interface IRemoteService extends IService {
LoginException, JSONException;
boolean isAuthorized(String value);
boolean isTokenUsed(String adminUrl) throws Exception;
String getPendoKeyFromLicense() throws Exception;
boolean isPendoTrackAvailable() throws Exception;
void sendPendoTrackData(TrackEvent event, IPendoDataProperties properties) throws Exception;
AbstractPendoTrackManager getPendoProjectLoginManager();
AbstractPendoTrackManager getPendoGenericManager(TrackEvent event, IPendoDataProperties peoperties);
String getTmcUser(String url, String token);
public boolean isCloudConnection();
public static IRemoteService get() {

View File

@@ -81,8 +81,6 @@ public interface ITestContainerProviderService extends IService {
public List<ProcessItem> getAllTestContainers(ProcessItem item);
public List<ProcessItem> getAllTestContainers(ProcessItem item, boolean latest, boolean excludeDeleted);
public void copyDataSetFiles(IProcess process, IPath srcPath);
public String getTestDataValue(IProcess process, String instance, String testData);

View File

@@ -26,8 +26,6 @@ import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.part.MultiPageEditorPart;
import org.talend.analysistask.AnalysisReportRecorder;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.IService;
import org.talend.core.model.components.IComponent;
import org.talend.core.model.general.ModuleNeeded;
@@ -208,6 +206,4 @@ public interface IDesignerCoreService extends IService {
public IProcess getJobletProcessByItem(Item item);
public List<AnalysisReportRecorder> analysis(Project project) throws PersistenceException;
}

View File

@@ -208,7 +208,7 @@ PropertiesWizardPage.Locker=\u30ED\u30C3\u30AF\u4FDD\u6301\u8005
PropertiesWizardPage.Description=\u8AAC\u660E
PropertiesWizardPage.EmptyDescWarning=\u8AAC\u660E\u306E\u7A7A\u767D\u306F\u907F\u3051\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.EmptyPurposeWarning=\u76EE\u7684\u306E\u7A7A\u767D\u306F\u907F\u3051\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.ItemExistsError=\u9805\u76EE\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.ItemExistsError=\u30A2\u30A4\u30C6\u30E0\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
PropertiesWizardPage.KeywordsError=\u540D\u524D\u304C\u6709\u52B9\u306AID\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
PropertiesWizardPage.Name=\u540D\u524D
PropertiesWizardPage.NameEmptyError=\u540D\u524D\u304C\u7A7A\u3067\u3059\u3002

View File

@@ -167,7 +167,7 @@ public class ModuleListCellEditor extends DialogCellEditor {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ILibraryManagerUIService.class)) {
ILibraryManagerUIService libUiService = (ILibraryManagerUIService) GlobalServiceRegister.getDefault().getService(
ILibraryManagerUIService.class);
IConfigModuleDialog dialog = libUiService.getConfigModuleDialog(cellEditorWindow.getShell(), "\"newLine\"".equals(value) ? "" : value, false);
IConfigModuleDialog dialog = libUiService.getConfigModuleDialog(cellEditorWindow.getShell(), "\"newLine\"".equals(value) ? "" : value);
if (dialog.open() == IDialogConstants.OK_ID) {
String selecteModule = dialog.getMavenURI();
if (selecteModule != null && (value == null || !value.equals(selecteModule))) {

View File

@@ -1,13 +1,7 @@
package org.talend.core.ui.services;
import java.io.Serializable;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.codec.binary.StringUtils;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Composite;
@@ -34,16 +28,6 @@ public interface IGitUIProviderService extends IService {
public void openPushFailedDialog(Object pushResult);
boolean migrateOption(IProgressMonitor monitor, String newVersion, boolean hasUpdate) throws Exception;
boolean openSwitchGitModeDialog();
boolean canSwitchGitMode();
boolean canShowSwitchGitModePopup();
void showSwithGitModePopup();
List<ProjectBranchNode> getInvalidProjectBranchNodes();
public static IGitUIProviderService get() {
GlobalServiceRegister register = GlobalServiceRegister.getDefault();
@@ -53,80 +37,4 @@ public interface IGitUIProviderService extends IService {
return register.getService(IGitUIProviderService.class);
}
public static class ProjectBranchNode {
private String branch;
private String techLabel;
private ProjectBranchNode parent;
private Set<ProjectBranchNode> children = new HashSet<ProjectBranchNode>();
public ProjectBranchNode(String techLabel, String branch) {
this.branch = branch;
this.techLabel = techLabel;
}
/**
* @return the branch
*/
public String getBranch() {
return branch;
}
/**
* @return the techLabel
*/
public String getTechLabel() {
return techLabel;
}
/**
* @return the parent
*/
public ProjectBranchNode getParent() {
return parent;
}
/**
* @return the children
*/
public Collection<ProjectBranchNode> getChildren() {
return Collections.unmodifiableCollection(children);
}
public void addChild(ProjectBranchNode c) {
c.parent = this;
this.children.add(c);
}
public boolean hasChildren() {
return !this.children.isEmpty();
}
public int hashCode() {
int hash = 7;
hash = hash * 31 + this.techLabel.hashCode();
hash = hash * 31 + this.branch.hashCode();
return hash;
}
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof ProjectBranchNode)) {
return false;
}
ProjectBranchNode thatObj = (ProjectBranchNode) o;
if (!StringUtils.equals(techLabel, thatObj.getTechLabel())) {
return false;
}
return StringUtils.equals(this.branch, thatObj.getBranch());
}
}
}

View File

@@ -78,12 +78,5 @@
serviceId="ICoreService">
</Service>
</extension>
<extension
point="org.talend.core.runtime.service">
<Service
class="org.talend.core.services.NotificationService"
serviceId="INotificationService">
</Service>
</extension>
</plugin>

View File

@@ -99,8 +99,6 @@ public class CorePreferenceInitializer extends AbstractPreferenceInitializer {
CorePlugin.getDefault().getPreferenceStore()
.setDefault(ITalendCorePrefConstants.FORBIDDEN_MAPPING_LENGTH_PREC_LOGIC, false);
CorePlugin.getDefault().getPreferenceStore().setDefault(ITalendCorePrefConstants.PERSPECTIVE_PERSIST_SCOPE,
ITalendCorePrefConstants.PERSPECTIVE_PERSIST_SCOPE_DEFAULT);
}
}

View File

@@ -56,31 +56,6 @@ public interface IGITProviderService extends IService {
void createOrUpdateGitIgnoreFile(IProject eclipseProject) throws CoreException;
String getDefaultBranch(Project project);
/**
* Whether git mode is standard mode
* @return
*/
boolean isStandardMode();
/**
* Set git mode
* @param standardMode
*/
void setStandardMode(boolean standardMode);
String getProjectLocationKey(Project project) throws PersistenceException;
/**
* Get clean git repository url
* @param project project
* @return
*/
String getCleanGitRepositoryUrl(org.talend.core.model.properties.Project project);
boolean canShowSwitchGitModePopup();
void showSwithGitModePopup();
public static IGITProviderService get() {
GlobalServiceRegister register = GlobalServiceRegister.getDefault();

View File

@@ -1,34 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.services;
import org.eclipse.jface.window.WindowManager;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
/**
* @author bhe created on Oct 27, 2022
*
*/
public interface INotificationService extends IService {
WindowManager getNotificationWindowManager();
public static INotificationService get() {
GlobalServiceRegister register = GlobalServiceRegister.getDefault();
if (!register.isServiceRegistered(INotificationService.class)) {
return null;
}
return register.getService(INotificationService.class);
}
}

View File

@@ -1,30 +0,0 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.services;
import org.eclipse.jface.window.WindowManager;
/**
* @author bhe created on Oct 28, 2022
*
*/
public class NotificationService implements INotificationService {
private WindowManager manager = new WindowManager();
@Override
public WindowManager getNotificationWindowManager() {
return manager;
}
}

View File

@@ -15,7 +15,7 @@ _UI_DataType_type=\u6570\u636E\u7C7B\u578B
_UI_Package_type=\u5305
_UI_Subsystem_type=\u5B50\u7CFB\u7EDF
_UI_Model_type=\u6A21\u578B
_UI_Feature_type=\u7279\u6027
_UI_Feature_type=\u529F\u80FD
_UI_StructuralFeature_type=\u7ED3\u6784\u7279\u5F81
_UI_Constraint_type=\u7EA6\u675F
_UI_Dependency_type=\u4F9D\u8D56\u5173\u7CFB
@@ -27,7 +27,7 @@ _UI_MultiplicityRange_type=\u591A\u91CD\u6027\u8303\u56F4
_UI_Stereotype_type=\u6784\u9020\u578B
_UI_TaggedValue_type=\u6807\u8BB0\u503C
_UI_Argument_type=\u53C2\u6570
_UI_BehavioralFeature_type=\u7279\u6027
_UI_BehavioralFeature_type=\u529F\u80FD
_UI_CallAction_type=\u8C03\u7528\u64CD\u4F5C
_UI_Event_type=\u4E8B\u4EF6
_UI_Interface_type=\u754C\u9762
@@ -344,7 +344,7 @@ _UI_ModelElement_changeRequest_feature=\u66F4\u6539\u8BF7\u6C42
_UI_ModelElement_dasdlProperty_feature=Dasdl \u5C5E\u6027
_UI_Namespace_ownedElement_feature=\u62E5\u6709\u7684\u5143\u7D20
_UI_Classifier_isAbstract_feature=\u662F\u62BD\u8C61\u7684
_UI_Classifier_feature_feature=\u7279\u6027
_UI_Classifier_feature_feature=\u529F\u80FD
_UI_Classifier_structuralFeature_feature=\u7ED3\u6784\u7279\u5F81
_UI_Classifier_parameter_feature=\u53C2\u6570
_UI_Classifier_generalization_feature=\u6982\u62EC
@@ -425,7 +425,7 @@ _UI_Instance_valueSlot_feature=\u503C\u69FD
_UI_Instance_classifier_feature=\u5206\u7C7B\u5668
_UI_Slot_value_feature=\u503C
_UI_Slot_object_feature=\u5BF9\u8C61
_UI_Slot_feature_feature=\u7279\u6027
_UI_Slot_feature_feature=\u529F\u80FD
_UI_DataValue_value_feature=\u503C
_UI_Object_slot_feature=\u69FD
_UI_ResponsibleParty_responsibility_feature=\u8D23\u4EFB
@@ -470,19 +470,19 @@ _UI_ExpressionNode_type_feature=\u7C7B\u578B
_UI_ExpressionNode_featureNode_feature=\u7279\u5F81\u8282\u70B9
_UI_ConstantNode_value_feature=\u503C
_UI_ElementNode_modelElement_feature=\u6A21\u578B\u5143\u7D20
_UI_FeatureNode_feature_feature=\u7279\u6027
_UI_FeatureNode_feature_feature=\u529F\u80FD
_UI_FeatureNode_argument_feature=\u53C2\u6570
_UI_UniqueKey_feature_feature=\u7279\u6027
_UI_UniqueKey_feature_feature=\u529F\u80FD
_UI_UniqueKey_keyRelationship_feature=\u952E\u5173\u7CFB
_UI_Index_isPartitioning_feature=\u4E3A\u5206\u533A
_UI_Index_isSorted_feature=\u4E3A\u6392\u5E8F\u7684
_UI_Index_isUnique_feature=\u4E3A\u552F\u4E00\u7684
_UI_Index_indexedFeature_feature=\u7D22\u5F15\u529F\u80FD
_UI_Index_spannedClass_feature=\u8DE8\u7C7B
_UI_KeyRelationship_feature_feature=\u7279\u6027
_UI_KeyRelationship_feature_feature=\u529F\u80FD
_UI_KeyRelationship_uniqueKey_feature=\u552F\u4E00\u952E
_UI_IndexedFeature_isAscending_feature=\u4E3A\u5347\u5E8F
_UI_IndexedFeature_feature_feature=\u7279\u6027
_UI_IndexedFeature_feature_feature=\u529F\u80FD
_UI_IndexedFeature_index_feature=\u7D22\u5F15
_UI_Site_containingSite_feature=\u5305\u542B\u7F51\u7AD9
_UI_Site_containedSite_feature=\u5305\u542B\u7F51\u7AD9
@@ -647,7 +647,7 @@ _UI_ClassifierFeatureMap_functionDescription_feature=\u529F\u80FD\u63CF\u8FF0
_UI_ClassifierFeatureMap_classifierToFeature_feature=\u5206\u7C7B\u5668\u529F\u80FD
_UI_ClassifierFeatureMap_classifierMap_feature=\u5206\u7C7B\u5668\u6620\u5C04
_UI_ClassifierFeatureMap_classifier_feature=\u5206\u7C7B\u5668
_UI_ClassifierFeatureMap_feature_feature=\u7279\u6027
_UI_ClassifierFeatureMap_feature_feature=\u529F\u80FD
_UI_ContentMap_cubeDeployment_feature=\u591A\u7EF4\u6570\u636E\u96C6\u90E8\u7F72
_UI_Cube_isVirtual_feature=\u4E3A\u865A\u62DF\u7684
_UI_Cube_cubeDimensionAssociation_feature=\u591A\u7EF4\u6570\u636E\u96C6\u7EF4\u5EA6\u5173\u8054

View File

@@ -12,20 +12,9 @@
<properties>
<maven.resolver.version>1.3.1</maven.resolver.version>
<wagon.version>3.4.3</wagon.version>
<slf4j.version>1.7.34</slf4j.version>
</properties>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-api</artifactId>

View File

@@ -46,8 +46,6 @@ import org.talend.designer.maven.aether.util.TalendAetherProxySelector;
*/
public class RepositorySystemFactory {
private static Boolean ignoreArtifactDescriptorRepositories;
private static Map<LocalRepository, DefaultRepositorySystemSession> sessions = new HashMap<LocalRepository, DefaultRepositorySystemSession>();
private static DefaultRepositorySystemSession newRepositorySystemSession(String localRepositoryPath)
@@ -63,8 +61,6 @@ public class RepositorySystemFactory {
repositorySystemSession.setTransferListener(new ChainedTransferListener());
repositorySystemSession.setRepositoryListener(new ChainedRepositoryListener());
repositorySystemSession.setProxySelector(new TalendAetherProxySelector());
repositorySystemSession.setIgnoreArtifactDescriptorRepositories(
RepositorySystemFactory.isIgnoreArtifactDescriptorRepositories());
sessions.put(localRepo, repositorySystemSession);
}
@@ -161,13 +157,4 @@ public class RepositorySystemFactory {
doDeploy(content, pomFile, localRepository, repositoryId, repositoryUrl, userName, password, groupId, artifactId,
classifier, extension, version);
}
public static boolean isIgnoreArtifactDescriptorRepositories() {
if (ignoreArtifactDescriptorRepositories == null) {
ignoreArtifactDescriptorRepositories = Boolean.valueOf(
System.getProperty("talend.studio.aether.ignoreArtifactDescriptorRepositories", Boolean.TRUE.toString()));
}
return ignoreArtifactDescriptorRepositories;
}
}

View File

@@ -63,7 +63,6 @@ import org.eclipse.m2e.core.MavenPlugin;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.designer.maven.aether.DummyDynamicMonitor;
import org.talend.designer.maven.aether.IDynamicMonitor;
import org.talend.designer.maven.aether.RepositorySystemFactory;
import org.talend.designer.maven.aether.node.DependencyNode;
import org.talend.designer.maven.aether.node.ExclusionNode;
import org.talend.designer.maven.aether.selector.DynamicDependencySelector;
@@ -514,7 +513,6 @@ public class DynamicDistributionAetherUtils {
LocalRepository localRepo = new LocalRepository(repositoryPath);
session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo));
session.setProxySelector(new TalendAetherProxySelector());
session.setIgnoreArtifactDescriptorRepositories(RepositorySystemFactory.isIgnoreArtifactDescriptorRepositories());
updateDependencySelector(session, monitor);

View File

@@ -34,6 +34,7 @@ import org.codehaus.plexus.PlexusContainerException;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
import org.eclipse.aether.impl.DefaultServiceLocator;
@@ -59,7 +60,6 @@ import org.talend.core.nexus.ArtifactRepositoryBean;
import org.talend.core.nexus.NexusConstants;
import org.talend.core.nexus.TalendLibsServerManager;
import org.talend.core.runtime.maven.MavenArtifact;
import org.talend.designer.maven.aether.RepositorySystemFactory;
public class MavenLibraryResolverProvider {
@@ -292,7 +292,6 @@ public class MavenLibraryResolverProvider {
ExceptionHandler.process(e);
}
session.setProxySelector(new TalendAetherProxySelector());
session.setIgnoreArtifactDescriptorRepositories(RepositorySystemFactory.isIgnoreArtifactDescriptorRepositories());
return session;
}

View File

@@ -10,9 +10,9 @@
<artifactId>org.talend.designer.maven.repo.tck</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<jackson.version>2.13.4</jackson.version>
<jackson-databind.version>2.13.4.2</jackson-databind.version>
<slf4j.version>1.7.34</slf4j.version>
<jackson.version>2.13.2</jackson.version>
<jackson-databind.version>2.13.2.2</jackson-databind.version>
<slf4j.version>1.7.32</slf4j.version>
<tycho.buildtimestamp.format>${timestamp}</tycho.buildtimestamp.format>
</properties>
<repositories>

View File

@@ -1,473 +1,480 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.designer.maven.repo.tcksdk</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<tcomp.version>${component-runtime.version}</tcomp.version>
<cxf.version>3.5.2</cxf.version>
<geronimo.version>1.0.2</geronimo.version>
<jcache.version>1.0.5</jcache.version>
<jcache_spec.version>1.0-alpha-1</jcache_spec.version>
<johnzon.version>1.2.19</johnzon.version>
<meecrowave.version>1.2.14</meecrowave.version>
<microprofile.version>1.2.1</microprofile.version>
<owb.version>2.0.27</owb.version>
<slf4j.version>1.7.34</slf4j.version>
<tomcat.version>9.0.68</tomcat.version>
<xbean.version>4.20</xbean.version>
<reload4j.version>1.2.22</reload4j.version>
<log4j2.version>2.17.2</log4j2.version>
<tycho.buildtimestamp.format>${timestamp}</tycho.buildtimestamp.format>
</properties>
<repositories>
<repository>
<id>talend_open</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceRelease/</url>
</repository>
<repository>
<id>talend_open_snapshots</id>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceSnapshot/</url>
</repository>
<repository>
<id>sonatype_snapshots</id>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jul</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-web</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime</artifactId>
<version>${component-runtime.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-integration-cdi</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-security</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo</groupId>
<artifactId>geronimo-jcache-simple</artifactId>
<version>${jcache.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo</groupId>
<artifactId>geronimo-opentracing-common</artifactId>
<version>${geronimo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo</groupId>
<artifactId>geronimo-opentracing</artifactId>
<version>${geronimo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jcache_1.0_spec</artifactId>
<version>${jcache_spec.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-core</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-jaxrs</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-jsonb</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-mapper</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.meecrowave</groupId>
<artifactId>meecrowave-core</artifactId>
<version>${meecrowave.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-el22</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-impl</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-se</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-spi</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-web</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-coyote</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jaspic-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jni</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-juli</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util-scan</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-websocket-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-websocket</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-asm9-shaded</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-finder-shaded</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-finder</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-reflect</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.opentracing</groupId>
<artifactId>microprofile-opentracing-api</artifactId>
<version>${microprofile.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-api</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-design-extension</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-di</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-impl</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-manager</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server-api</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server-extension-api</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server-model</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-spi</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>container-core</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>slf4j-standard</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>vault-client</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>${reload4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.10.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>${project.basedir}/repository</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${project.basedir}/tmp</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies-jar</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/tmp</outputDirectory>
<includeScope>runtime</includeScope>
<useRepositoryLayout>true</useRepositoryLayout>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>zip-maven-repository</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<zip destfile="${project.basedir}/repository/maven_repository.zip" basedir="${project.basedir}/tmp/" />
<delete dir="${project.basedir}/tmp/" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.designer.maven.repo.tcksdk</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<tcomp.version>${component-runtime.version}</tcomp.version>
<cxf.version>3.5.2</cxf.version>
<geronimo.version>1.0.2</geronimo.version>
<jcache.version>1.0.5</jcache.version>
<jcache_spec.version>1.0-alpha-1</jcache_spec.version>
<johnzon.version>1.2.19</johnzon.version>
<meecrowave.version>1.2.14</meecrowave.version>
<microprofile.version>1.2.1</microprofile.version>
<owb.version>2.0.27</owb.version>
<slf4j.version>1.7.34</slf4j.version>
<tomcat.version>9.0.63</tomcat.version>
<xbean.version>4.20</xbean.version>
<reload4j.version>1.2.19</reload4j.version>
<log4j2.version>2.17.2</log4j2.version>
<tycho.buildtimestamp.format>${timestamp}</tycho.buildtimestamp.format>
</properties>
<repositories>
<repository>
<id>talend_open</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceRelease/</url>
</repository>
<repository>
<id>talend_open_snapshots</id>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceSnapshot/</url>
</repository>
<repository>
<id>sonatype_snapshots</id>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jul</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-web</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime</artifactId>
<version>${component-runtime.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-core</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-integration-cdi</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-security</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo</groupId>
<artifactId>geronimo-jcache-simple</artifactId>
<version>${jcache.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo</groupId>
<artifactId>geronimo-opentracing-common</artifactId>
<version>${geronimo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo</groupId>
<artifactId>geronimo-opentracing</artifactId>
<version>${geronimo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jcache_1.0_spec</artifactId>
<version>${jcache_spec.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-core</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-jaxrs</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-jsonb</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-mapper</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.meecrowave</groupId>
<artifactId>meecrowave-core</artifactId>
<version>${meecrowave.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-el22</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-impl</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-se</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-spi</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-web</artifactId>
<version>${owb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-coyote</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jaspic-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jni</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-juli</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util-scan</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-websocket-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-websocket</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-asm9-shaded</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-finder-shaded</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-finder</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-reflect</artifactId>
<version>${xbean.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.opentracing</groupId>
<artifactId>microprofile-opentracing-api</artifactId>
<version>${microprofile.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-api</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-design-extension</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-di</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-impl</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-runtime-manager</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server-api</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server-extension-api</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-server-model</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>component-spi</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>container-core</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>slf4j-standard</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.talend.sdk.component</groupId>
<artifactId>vault-client</artifactId>
<version>${component-runtime.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ch.qos.reload4j</groupId>
<artifactId>reload4j</artifactId>
<version>${reload4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-text -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>${project.basedir}/repository</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${project.basedir}/tmp</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies-jar</id>
<phase>generate-sources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/tmp</outputDirectory>
<includeScope>runtime</includeScope>
<useRepositoryLayout>true</useRepositoryLayout>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>zip-maven-repository</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<zip destfile="${project.basedir}/repository/maven_repository.zip" basedir="${project.basedir}/tmp/" />
<delete dir="${project.basedir}/tmp/" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -120,7 +120,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.34</version>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>junit</groupId>

View File

@@ -10,11 +10,6 @@
<artifactId>karaf-maven-plugin-4-2-10-tos</artifactId>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.34</version>
</dependency>
<dependency>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
@@ -57,7 +52,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.34</version>
<version>1.7.29</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
@@ -123,7 +118,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.4.2</version>
<version>2.13.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>

View File

@@ -17,11 +17,6 @@
</properties>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.34</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
@@ -94,7 +89,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.4.2</version>
<version>2.13.2.2</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>

View File

@@ -134,17 +134,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<exclusions>
<exclusion>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-cipher</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-cipher</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>

View File

@@ -56,8 +56,8 @@
<version>17</version>
<type>pom</type>
</dependency>
<!-- It fixes provided dependency scope to compile, because maven-dependency-plugin is setup to include
only compile and runtime scopes, but provided is also required. It's not possible to setup plugin to
<!-- It fixes provided dependency scope to compile, because maven-dependency-plugin is setup to include
only compile and runtime scopes, but provided is also required. It's not possible to setup plugin to
include all: compile, runtime and provided dependencies -->
<dependency>
<groupId>biz.aQute.bnd</groupId>
@@ -76,7 +76,7 @@
</dependencyManagement>
<dependencies>
<!-- Dependencies in provided scope should be explicitly added as dependency in this module,
<!-- Dependencies in provided scope should be explicitly added as dependency in this module,
because provided scope is not transitive -->
<dependency>
<groupId>org.osgi</groupId>
@@ -97,7 +97,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.34</version>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>junit</groupId>

View File

@@ -11,11 +11,6 @@
<packaging>pom</packaging>
<dependencies>
<!--add log4j dependency https://jira.talendforge.org/browse/TUP-29704 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.34</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>

View File

@@ -65,11 +65,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.34</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>

View File

@@ -50,7 +50,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.34</version>
<version>1.7.32</version>
</dependency>
</dependencies>
<build>

View File

@@ -11,9 +11,9 @@
<packaging>pom</packaging>
<properties>
<tcomp.version>1.51.2</tcomp.version>
<tcomp.version>1.49.1</tcomp.version>
<slf4j.version>1.7.34</slf4j.version>
<reload4j.version>1.2.22</reload4j.version>
<reload4j.version>1.2.19</reload4j.version>
</properties>
<repositories>
@@ -99,7 +99,7 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<exclusions>
<exclusion>

View File

@@ -43,7 +43,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.10.0</version>
<version>1.9</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
@@ -109,7 +109,6 @@
<patternset>
<exclude name="repository/org/apache/maven/maven-artifact-manager/2.0.9/"/>
<exclude name="repository/org/apache/maven/maven-artifact-manager/2.0.6/"/>
<exclude name="repository/ch/qos/reload4j/reload4j/1.2.19/"/>
</patternset>
</unzip>
</tasks>

View File

@@ -10,7 +10,6 @@ ProjectPomProjectSettingPage_ConfirmMessage=Will apply and update for project PO
ProjectPomProjectSettingPage_FilterPomLabel=Filter to use to generate poms:
ProjectPomProjectSettingPage_FilterErrorMessage=Filter is invalid.
ProjectPomProjectSettingPage.syncAllPomsButtonText=Force full re-synchronize POMs
ProjectPomProjectSettingPage.syncBuildTypesButtonText=Force full re-synchronize build types
AbstractPersistentProjectSettingPage.syncAllPoms=Do you want to update all poms? \n This operation might take long time depends on your project size.
MavenProjectSettingPage.filterExampleMessage=Filter examples:\nlabel=myJob \t\t\t\t=> Generate only the job named "myJob"\n!(label=myJob) \t\t\t\t=> Generate any job except the one named "myJob"\n(path=folder1/folder2) \t\t\t=> Generate any job in the folder "folder1/folder2"\n(path=folder1/folder2)or(label=myJob)\t=> Generate any job in the folder "folder1/folder2" or named "myJob"\n(label=myJob)and(version=0.2)\t\t=> Generate only the job named "myJob" with version 0.2\n!((label=myJob)and(version=0.1))\t\t=> Generate every jobs except the "myJob" version 0.1
MavenProjectSettingPage.refModuleText=Set reference project modules in profile
@@ -18,4 +17,3 @@ MavenProjectSettingPage.excludeDeletedItems=Exclude deleted items
MavenProjectSettingPage.syncAllPomsWarning=Click the Force full re-synchronize POMs button to apply the new settings.
MavenProjectSettingPage.skipFolders=Skip folders
BuildProjectSettingPage.allowRecursiveJobsJoblets=Allow recursive Jobs and Joblets (not supported - for compatibility only)
BuildProjectSettingPage.allowRecursiveJobs=Allow recursive jobs (Not recommended)

View File

@@ -10,7 +10,6 @@ ProjectPomProjectSettingPage_ConfirmMessage=Cela appliquera et mettra \u00E0 jou
ProjectPomProjectSettingPage_FilterPomLabel=Filtrer pour utiliser la g\u00E9n\u00E9ration des POM :
ProjectPomProjectSettingPage_FilterErrorMessage=Le filtre n'est pas valide.
ProjectPomProjectSettingPage.syncAllPomsButtonText=Forcer la resynchronisation compl\u00E8te des POM
ProjectPomProjectSettingPage.syncBuildTypesButtonText=Forcer la resynchronisation compl\u00E8te des types de build
AbstractPersistentProjectSettingPage.syncAllPoms=Mettre \u00E0 jour tous les POM ? \n Cette op\u00E9ration peut prendre un moment, selon la taille de votre projet.
MavenProjectSettingPage.filterExampleMessage=Exemples de filtres\u00A0:\nlibell\u00E9=monJob \t\t\t\t=> G\u00E9n\u00E9rer uniquement le Job nomm\u00E9 "monJob"\n!(libell\u00E9=monJob) \t\t\t\t=> G\u00E9n\u00E9rer tous les Jobs sauf celui nomm\u00E9 "monJob"\n(path=folder1/folder2) \t\t\t=> G\u00E9n\u00E9rer tous Jobs dans le dossier "dossier1/dossier2"\n(chemin=dossier1/dossier2)ou(libell\u00E9=monJob)\t=> G\u00E9n\u00E9rer tous Jobs dans le dossier "dossier1/dossier2" ou nomm\u00E9 "monJob"\n(libell\u00E9=monJob)et(version=0.2)\t\t=> G\u00E9n\u00E9rer uniquement le Job nomm\u00E9 "monJob" avec une version 0.2\n!((libell\u00E9=monJob)et(version=0.1))\t\t=> G\u00E9n\u00E9rer tous les Jobs sauf "monJob" version 0.1
MavenProjectSettingPage.refModuleText=Configurer les modules du projet de r\u00E9f\u00E9rence dans le profil
@@ -18,4 +17,3 @@ MavenProjectSettingPage.excludeDeletedItems=Exclure les \u00E9l\u00E9ments suppr
MavenProjectSettingPage.syncAllPomsWarning=Cliquez sur Forcer la nouvelle synchronisation compl\u00E8te des POM pour appliquer les nouveaux param\u00E8tres.
MavenProjectSettingPage.skipFolders=Ignorer les dossiers
BuildProjectSettingPage.allowRecursiveJobsJoblets=Autorise les Jobs et Joblets r\u00E9cursifs (non support\u00E9 - pour des raisons de compatibilit\u00E9)
BuildProjectSettingPage.allowRecursiveJobs=Autoriser les Jobs r\u00E9cursifs (non recommand\u00E9)

View File

@@ -10,7 +10,6 @@ ProjectPomProjectSettingPage_ConfirmMessage=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8
ProjectPomProjectSettingPage_FilterPomLabel=POM\u306E\u751F\u6210\u306B\u4F7F\u7528\u3059\u308B\u30D5\u30A3\u30EB\u30BF\u30FC:
ProjectPomProjectSettingPage_FilterErrorMessage=\u30D5\u30A3\u30EB\u30BF\u30FC\u304C\u7121\u52B9\u3067\u3059\u3002
ProjectPomProjectSettingPage.syncAllPomsButtonText=\u5B8C\u5168\u306A\u518D\u540C\u671FPOM\u3092\u5F37\u5236
ProjectPomProjectSettingPage.syncBuildTypesButtonText=\u5B8C\u5168\u306A\u518D\u540C\u671F\u30D3\u30EB\u30C9\u30BF\u30A4\u30D7\u3092\u5F37\u5236
AbstractPersistentProjectSettingPage.syncAllPoms=POM\u3092\u3059\u3079\u3066\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3057\u307E\u3059\u304B? \n \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30B5\u30A4\u30BA\u306B\u3088\u3063\u3066\u306F\u3053\u306E\u64CD\u4F5C\u3067\u9577\u3044\u6642\u9593\u304C\u304B\u304B\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\u3002
MavenProjectSettingPage.filterExampleMessage=\u30D5\u30A3\u30EB\u30BF\u30FC\u306E\u4F8B:\nlabel=myJob \t\t\t\t=> "myJob"\u3068\u3044\u3046\u540D\u524D\u306E\u30B8\u30E7\u30D6\u3060\u3051\u3092\u751F\u6210\n!(label=myJob) \t\t\t\t=> "myJob"\u3068\u3044\u3046\u540D\u524D\u4EE5\u5916\u306E\u30B8\u30E7\u30D6\u3092\u3059\u3079\u3066\u751F\u6210\n(path=folder1/folder2) \t\t\t=> "folder1/folder2"\u3068\u3044\u3046\u30D5\u30A3\u30EB\u30C0\u30FC\u306B\u3042\u308B\u30B8\u30E7\u30D6\u3092\u3059\u3079\u3066\u751F\u6210\n(path=folder1/folder2)or(label=myJob)\t=> "folder1/folder2"\u3068\u3044\u3046\u30D5\u30A9\u30EB\u30C0\u30FC\u306B\u3042\u308B\u3059\u3079\u3066\u306E\u30B8\u30E7\u30D6\u3001\u307E\u305F\u306F"myJob"\u3068\u3044\u3046\u540D\u524D\u306E\u30B8\u30E7\u30D6\u3092\u751F\u6210\n(label=myJob)and(version=0.2)\t\t=> \u30D0\u30FC\u30B8\u30E7\u30F30.2\u3067"myJob"\u3068\u3044\u3046\u540D\u524D\u306E\u30B8\u30E7\u30D6\u306E\u307F\u751F\u6210\n!((label=myJob)and(version=0.1))\t\t=> \u30D0\u30FC\u30B8\u30E7\u30F30.1\u3067"myJob"\u3068\u3044\u3046\u540D\u524D\u4EE5\u5916\u306E\u30B8\u30E7\u30D6\u3092\u3059\u3079\u3066\u751F\u6210
MavenProjectSettingPage.refModuleText=\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3067\u53C2\u7167\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u8A2D\u5B9A
@@ -18,4 +17,3 @@ MavenProjectSettingPage.excludeDeletedItems=\u524A\u9664\u3055\u308C\u305F\u30A2
MavenProjectSettingPage.syncAllPomsWarning=[\u5B8C\u5168\u306A\u518D\u540C\u671FPOM\u3092\u5F37\u5236]\u30DC\u30BF\u30F3\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u3001\u65B0\u3057\u3044\u8A2D\u5B9A\u3092\u9069\u7528\u3057\u307E\u3059\u3002
MavenProjectSettingPage.skipFolders=\u30D5\u30A9\u30EB\u30C0\u30FC\u3092\u30B9\u30AD\u30C3\u30D7
BuildProjectSettingPage.allowRecursiveJobsJoblets=\u518D\u5E30\u7684\u30B8\u30E7\u30D6\u3068\u30B8\u30E7\u30D6\u30EC\u30C3\u30C8\u3092\u8A31\u53EF(\u30B5\u30DD\u30FC\u30C8\u306A\u3057 - \u4E92\u63DB\u6027\u306E\u76EE\u7684\u306E\u307F)
BuildProjectSettingPage.allowRecursiveJobs=\u518D\u5E30\u7684\u30B8\u30E7\u30D6\u3092\u8A31\u53EF(\u975E\u63A8\u5968)

View File

@@ -10,7 +10,6 @@ ProjectPomProjectSettingPage_ConfirmMessage=\u5C06\u7ACB\u5373\u4E3A\u5DE5\u7A0B
ProjectPomProjectSettingPage_FilterPomLabel=\u7528\u4E8E\u751F\u6210 pom \u7684\u7B5B\u9009\u5668:
ProjectPomProjectSettingPage_FilterErrorMessage=\u7B5B\u9009\u5668\u65E0\u6548\u3002
ProjectPomProjectSettingPage.syncAllPomsButtonText=\u5F3A\u5236\u5B8C\u5168\u91CD\u65B0\u540C\u6B65 POM
ProjectPomProjectSettingPage.syncBuildTypesButtonText=\u5F3A\u5236\u91CD\u65B0\u540C\u6B65\u6784\u5EFA\u7C7B\u578B
AbstractPersistentProjectSettingPage.syncAllPoms=\u662F\u5426\u66F4\u65B0\u6240\u6709 POM \u6587\u4EF6? \n \u6B64\u64CD\u4F5C\u53EF\u80FD\u9700\u8981\u5F88\u957F\u65F6\u95F4\uFF0C\u5177\u4F53\u53D6\u51B3\u4E8E\u60A8\u7684\u5DE5\u7A0B\u5927\u5C0F\u3002
MavenProjectSettingPage.filterExampleMessage=\u7B5B\u9009\u5668\u793A\u4F8B\uFF1A\nlabel=myJob \t\t\t\t=> \u4EC5\u751F\u6210\u540D\u4E3A "myJob" \u7684\u4F5C\u4E1A\n!(label=myJob) \t\t\t\t=> \u751F\u6210\u540D\u4E3A "myJob" \u9664\u5916\u7684\u4EFB\u610F\u4F5C\u4E1A\n(path=folder1/folder2) \t\t\t=> \u751F\u6210\u6587\u4EF6\u5939 "folder1/folder2" \u4E2D\u4EFB\u610F\u4F5C\u4E1A\n(path=folder1/folder2)or(label=myJob)\t=> \u751F\u6210\u6587\u4EF6\u5939 "folder1/folder2" \u4E2D\u7684\u4EFB\u610F\u4F5C\u4E1A\u6216\u4EFB\u610F\u540D\u4E3A "myJob" \u7684\u4F5C\u4E1A\n(label=myJob)and(version=0.2)\t\t=> \u4EC5\u751F\u6210\u7248\u672C 0.2 \u4E14\u540D\u4E3A "myJob" \u7684\u4F5C\u4E1A\n!((label=myJob)and(version=0.1))\t\t=> \u751F\u6210\u4EFB\u610F\u540D\u79F0\u4E0D\u4E3A "myJob" \u4E14\u7248\u672C\u4E0D\u4E3A 0.1 \u7684\u4F5C\u4E1A
MavenProjectSettingPage.refModuleText=\u5728\u914D\u7F6E\u6587\u4EF6\u4E2D\u8BBE\u7F6E\u5F15\u7528\u5DE5\u7A0B\u6A21\u5757
@@ -18,4 +17,3 @@ MavenProjectSettingPage.excludeDeletedItems=\u6392\u9664\u5DF2\u5220\u9664\u9879
MavenProjectSettingPage.syncAllPomsWarning=\u5355\u51FB \u201C\u5F3A\u5236\u5B8C\u5168\u91CD\u65B0\u540C\u6B65 POM\u201D \u6309\u94AE\u4EE5\u5E94\u7528\u65B0\u7684\u8BBE\u7F6E\u3002
MavenProjectSettingPage.skipFolders=\u8DF3\u8FC7\u6587\u4EF6\u5939
BuildProjectSettingPage.allowRecursiveJobsJoblets=\u5141\u8BB8\u9012\u5F52\u4F5C\u4E1A\u548C\u5C0F\u4F5C\u4E1A (\u4E0D\u652F\u6301 - \u4EC5\u7528\u4E8E\u517C\u5BB9\u6027)
BuildProjectSettingPage.allowRecursiveJobs=\u5141\u8BB8\u9012\u5F52\u4F5C\u4E1A (\u4E0D\u63A8\u8350)

View File

@@ -26,7 +26,6 @@ import org.talend.core.runtime.maven.MavenConstants;
import org.talend.core.runtime.projectsetting.AbstractProjectSettingPage;
import org.talend.designer.maven.DesignerMavenPlugin;
import org.talend.designer.maven.tools.AggregatorPomsHelper;
import org.talend.designer.maven.tools.BuildTypeManager;
import org.talend.designer.maven.ui.i18n.Messages;
/**
@@ -86,25 +85,7 @@ public class MavenProjectSettingPage extends AbstractProjectSettingPage {
});
if (isSyncBuildTypeAllowed()) {
Button syncBuildTypes = new Button(parent, SWT.NONE);
syncBuildTypes.setText(Messages.getString("ProjectPomProjectSettingPage.syncBuildTypesButtonText")); //$NON-NLS-1$
syncBuildTypes.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
try {
new BuildTypeManager().syncBuildTypes(getCurrentPage());
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
});
}
}
}
private void addSyncWarning() {
setMessage(Messages.getString("MavenProjectSettingPage.syncAllPomsWarning"), IMessage.WARNING); //$NON-NLS-1$
@@ -119,12 +100,4 @@ public class MavenProjectSettingPage extends AbstractProjectSettingPage {
return ok;
}
private static boolean isSyncBuildTypeAllowed() {
return Boolean.getBoolean("talend.builtype.syncallowed");
}
private MavenProjectSettingPage getCurrentPage() {
return this;
}
}

View File

@@ -9,7 +9,6 @@
<properties>
<encoding>UTF-8</encoding>
<slf4j-api.version>1.7.34</slf4j-api.version>
</properties>
<build>
@@ -219,22 +218,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<dependencies>
<dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-sec-dispatcher</artifactId>
<version>1.3</version>
<exclusions>
<exclusion>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-cipher</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-cipher</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
@@ -250,21 +233,6 @@
<artifactId>maven-settings</artifactId>
<version>3.8.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j-api.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>${slf4j-api.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j-api.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>

View File

@@ -1,121 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.runtime.model.emf.EmfHelper;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.model.components.filters.IComponentFilter;
import org.talend.core.model.migration.AbstractItemMigrationTask;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.JobletProcessItem;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.repository.utils.ConvertJobsUtil;
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
import org.talend.migration.MigrationReportHelper;
import org.talend.migration.MigrationReportRecorder;
import org.talend.repository.model.IProxyRepositoryFactory;
import org.talend.repository.model.IRepositoryService;
public abstract class AbstractCorrectBuildItemMigrationTask extends AbstractItemMigrationTask implements ICorrectBuildTypeMigrationTask {
protected static final String BUILD_TYPE_PROPERTY = "BUILD_TYPE";
protected static final String BUILD_TYPE_STANDALONE = "STANDALONE";
protected static final String BUILD_TYPE_OSGI = "OSGI";
protected static final String BUILD_TYPE_ROUTE = "ROUTE";
protected static final String BUILD_TYPE_ROUTE_MICROSERVICE = "ROUTE_MICROSERVICE";
protected static final String REST_MS = "REST_MS";
protected static Map<String, String> migratedJobs = new HashMap<String, String>();
protected static void clearMigratedJobs () {
migratedJobs.clear();
}
protected static void skipMigrationForJob (String jobName, String migrationTask) {
migratedJobs.put(jobName, migrationTask);
}
protected static void storeMigratedJob (String jobName, String migrationTask) {
migratedJobs.put(jobName, migrationTask);
}
protected static boolean isJobMigrated (String jobName) {
return migratedJobs.containsKey(jobName);
}
protected static String getStoredJobMigraionTask (String jobName) {
return migratedJobs.get(jobName);
}
public void generateReportRecord(MigrationReportRecorder recorder) {
MigrationReportHelper.getInstance().addRecorder(recorder);
}
public static List<NodeType> searchComponent(ProcessType processType, IComponentFilter filter) {
List<NodeType> list = new ArrayList<NodeType>();
if (filter == null || processType == null) {
return list;
}
for (Object o : processType.getNode()) {
if (filter.accept((NodeType) o)) {
list.add((NodeType) o);
}
}
return list;
}
public void save(Item item) throws PersistenceException {
IRepositoryService service = (IRepositoryService) GlobalServiceRegister.getDefault()
.getService(IRepositoryService.class);
IProxyRepositoryFactory factory = service.getProxyRepositoryFactory();
factory.save(item, true);
}
public ProcessType getProcessType(Item item) {
ProcessType processType = null;
if (item instanceof ProcessItem) {
processType = ((ProcessItem) item).getProcess();
}
if (item instanceof JobletProcessItem) {
processType = ((JobletProcessItem) item).getJobletProcess();
}
if (processType != null) {
EmfHelper.visitChilds(processType);
ERepositoryObjectType itemType = ERepositoryObjectType.getItemType(item);
if (itemType == ERepositoryObjectType.TEST_CONTAINER
&& !ConvertJobsUtil.JobType.STANDARD.getDisplayName().equalsIgnoreCase(processType.getJobType())) {
return null;
}
}
return processType;
}
/**
* Find element parameter with a given parameter name
*
* @param paramName
* @param elementParameterTypes
* @return
*/
public static final ElementParameterType findElementParameterByName(String paramName, NodeType node) {
for (Object obj : node.getElementParameter()) {
ElementParameterType cpType = (ElementParameterType) obj;
if (paramName.equals(cpType.getName())) {
return cpType;
}
}
return null;
}
abstract public void clear ();
}

View File

@@ -1,17 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import java.util.ArrayList;
import java.util.List;
import org.talend.core.model.repository.ERepositoryObjectType;
public abstract class AbstractDataServiceJobMigrationTask extends AbstractCorrectBuildItemMigrationTask {
@Override
public List<ERepositoryObjectType> getTypes() {
List<ERepositoryObjectType> toReturn = new ArrayList<ERepositoryObjectType>();
toReturn.add(ERepositoryObjectType.PROCESS);
return toReturn;
}
}

View File

@@ -1,18 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import java.util.ArrayList;
import java.util.List;
import org.talend.core.model.repository.ERepositoryObjectType;
public abstract class AbstractRouteMigrationTask extends AbstractCorrectBuildItemMigrationTask {
@Override
public List<ERepositoryObjectType> getTypes() {
List<ERepositoryObjectType> toReturn = new ArrayList<ERepositoryObjectType>();
toReturn.add(ERepositoryObjectType.PROCESS_ROUTE);
toReturn.add(ERepositoryObjectType.PROCESS_ROUTE_MICROSERVICE);
return toReturn;
}
}

View File

@@ -1,268 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.model.components.filters.IComponentFilter;
import org.talend.core.model.components.filters.NameComponentFilter;
import org.talend.core.model.general.Project;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ProcessItem;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
import org.talend.designer.runprocess.ItemCacheManager;
import org.talend.migration.MigrationReportRecorder;
import org.talend.repository.ProjectManager;
/*
* If Job does not contain any of the following components: "tRouteInput", "tRESTClient", "tESBConsumer"
* then BUILD_TYPE must be STANDALONE
* Else (job contains one of "tRouteInput", "tRESTClient" or "tESBConsumer")
* If no BUILD_TYPE is set then default BUILD_TYPE must be STANDALONE
* Manage child jobs for jobs ( parent, target BUILD_TYPE = STANDALONE )
* If BUILD_TYPE is STANDALONE
* Manage child jobs for jobs ( parent, target BUILD_TYPE = STANDALONE )
* If BUILD_TYPE is ROUTE > EXCEPTION: need warning message! BUILD_TYPE was wrongly set to ROUTE from a previous migration task and has to be manually updated (all subjobs have to be checked manually). Value should be either STANDALONE (in most cases) or OSGI.
*/
public class CorrectBuildTypeForDIJobMigrationTask extends AbstractDataServiceJobMigrationTask {
private static final String[] ESB_COMPONENTS = { "tRouteInput", "tRESTClient", "tESBConsumer" };
private static final String T_RUB_JOB_COMPONENT = "tRunJob";
boolean failure = false;
/*
* (non-Javadoc)
*
* @see org.talend.migration.IMigrationTask#getOrder()
*/
@Override
public Date getOrder() {
GregorianCalendar gc = new GregorianCalendar(2021, 7, 25, 12, 0, 0);
return gc.getTime();
}
@SuppressWarnings("unchecked")
@Override
public ExecutionResult execute(Item item) {
final ProcessType processType = getProcessType(item);
String jobName = item.getProperty().getLabel();
/*
* Migrating remaining jobs only (which was not migrated previously)
*/
if (isJobMigrated(jobName)) {
return ExecutionResult.NOTHING_TO_DO;
}
Object originalBuildType = item.getProperty().getAdditionalProperties().get(BUILD_TYPE_PROPERTY);
/*
* If BUILD_TYPE is ROUTE > EXCEPTION: need warning message! BUILD_TYPE was
* wrongly set to ROUTE from a previous migration task and has to be manually
* updated (all subjobs have to be checked manually). Value should be either
* STANDALONE (in most cases) or OSGI.
*/
if (originalBuildType != null && BUILD_TYPE_ROUTE.equalsIgnoreCase((String) originalBuildType)) {
ExceptionHandler.process(new RuntimeException("Job [" + jobName + "] has incorrect BUILD_TYPE ["
+ BUILD_TYPE_ROUTE
+ "] which has to be manually updated (all subjobs have to be checked manually). Value should be either STANDALONE (in most cases) or OSGI"));
return ExecutionResult.FAILURE;
}
for (String name : ESB_COMPONENTS) {
boolean modified = false;
IComponentFilter filter = new NameComponentFilter(name);
List<NodeType> c = searchComponent(processType, filter);
if (!c.isEmpty()) {
/*
* job contains one of "tRouteInput", "tRESTClient" or "tESBConsumer") If no
* BUILD_TYPE is set then default BUILD_TYPE must be STANDALONE
*/
if (null == originalBuildType) {
item.getProperty().getAdditionalProperties().put(BUILD_TYPE_PROPERTY, BUILD_TYPE_STANDALONE);
try {
save(item);
modified |= true;
generateReportRecord(
new MigrationReportRecorder(this, MigrationReportRecorder.MigrationOperationType.MODIFY,
item, null, "Build Type", null, BUILD_TYPE_STANDALONE));
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
}
/*
* Manage child jobs for jobs ( parent, target BUILD_TYPE = STANDALONE )
*/
String currentParentJobBuildType = (String) item.getProperty().getAdditionalProperties()
.get(BUILD_TYPE_PROPERTY);
if (BUILD_TYPE_STANDALONE.equalsIgnoreCase(currentParentJobBuildType)) {
updateBuildTypeForSubJobs(item, currentParentJobBuildType);
}
if (failure) {
return ExecutionResult.FAILURE;
}
if (modified) {
return ExecutionResult.SUCCESS_NO_ALERT;
}
return ExecutionResult.NOTHING_TO_DO;
}
}
/*
* If Job does not contain any of the following components: "tRouteInput",
* "tRESTClient", "tESBConsumer" then BUILD_TYPE must be STANDALONE
* Manage child jobs for jobs ( parent, target BUILD_TYPE = STANDALONE )
*/
if (null == originalBuildType || !BUILD_TYPE_STANDALONE.equalsIgnoreCase(originalBuildType.toString())) {
item.getProperty().getAdditionalProperties().put(BUILD_TYPE_PROPERTY, BUILD_TYPE_STANDALONE);
boolean modified = false;
try {
save(item);
modified |= true;
generateReportRecord(new MigrationReportRecorder(this,
MigrationReportRecorder.MigrationOperationType.MODIFY, item, null, "Build Type",
(null == originalBuildType) ? null : originalBuildType.toString(), BUILD_TYPE_STANDALONE));
updateBuildTypeForSubJobs(item, BUILD_TYPE_STANDALONE);
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
if (failure) {
return ExecutionResult.FAILURE;
}
if (modified) {
return ExecutionResult.SUCCESS_NO_ALERT;
}
}
/*
* If Job does not contain any of the following components: "tRouteInput",
* "tRESTClient", "tESBConsumer" and BUILD_TYPE is STANDALONE
* Manage child jobs for jobs ( parent, target BUILD_TYPE = STANDALONE )
*/
if (BUILD_TYPE_STANDALONE.equalsIgnoreCase(originalBuildType.toString())) {
updateBuildTypeForSubJobs(item, BUILD_TYPE_STANDALONE);
if (failure) {
return ExecutionResult.FAILURE;
}
}
return ExecutionResult.NOTHING_TO_DO;
}
@Override
public String getDescription() {
return "Synchronize build types for DI jobs";
}
@Override
public void clear() {
clearMigratedJobs();
}
@SuppressWarnings("unchecked")
private void updateBuildTypeForSubJobs(Item parentJobItem, String parentJobBuiltType) {
IComponentFilter filter = new NameComponentFilter(T_RUB_JOB_COMPONENT);
ProcessType processType = getProcessType(parentJobItem);
List<NodeType> c = searchComponent(processType, filter);
if (!c.isEmpty()) {
for (NodeType tRunJobComponent : c) {
String processID = findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_PROCESS",
tRunJobComponent) == null ? null
: findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_PROCESS", tRunJobComponent)
.getValue();
if (processID == null) {
processID = findElementParameterByName("PROCESS:PROCESS_TYPE_PROCESS",
tRunJobComponent) == null ? null
: findElementParameterByName("PROCESS:PROCESS_TYPE_PROCESS", tRunJobComponent)
.getValue();
}
String processVersion = findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_VERSION",
tRunJobComponent) == null ? null
: findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_VERSION", tRunJobComponent)
.getValue();
if (processVersion == null) {
processVersion = findElementParameterByName("PROCESS:PROCESS_TYPE_VERSION",
tRunJobComponent) == null ? null
: findElementParameterByName("PROCESS:PROCESS_TYPE_VERSION", tRunJobComponent)
.getValue();
}
if (processID != null && processVersion != null) {
ProcessItem childItem = ItemCacheManager.getProcessItem(processID, processVersion);
Project childItemProject = ProjectManager.getInstance().getCurrentProject();
if (childItem == null) {
for (Project refProject : ProjectManager.getInstance().getAllReferencedProjects()) {
childItem = ItemCacheManager.getRefProcessItem(getProject(), processID);
if (childItem != null) {
childItemProject = refProject;
break;
}
}
}
if (childItem != null) {
Object currentChildBuildType = childItem.getProperty().getAdditionalProperties()
.get(BUILD_TYPE_PROPERTY);
// String jobID = childItem.getProperty().getLabel();
String currentChildBuildTypeStr = (null == currentChildBuildType) ? null
: (String) currentChildBuildType;
if (BUILD_TYPE_STANDALONE.equalsIgnoreCase(parentJobBuiltType)
&& !BUILD_TYPE_STANDALONE.equalsIgnoreCase(currentChildBuildTypeStr)) {
childItem.getProperty().getAdditionalProperties().put(BUILD_TYPE_PROPERTY,
BUILD_TYPE_STANDALONE);
try {
save(childItem);
generateReportRecord(new MigrationReportRecorder(this,
MigrationReportRecorder.MigrationOperationType.MODIFY, childItem, null,
"Build Type", currentChildBuildTypeStr, BUILD_TYPE_STANDALONE));
} catch (PersistenceException e) {
ExceptionHandler.process(e);
failure = true;
}
}
updateBuildTypeForSubJobs(childItem, parentJobBuiltType);
}
}
}
}
}
}

View File

@@ -1,107 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.model.components.filters.IComponentFilter;
import org.talend.core.model.components.filters.NameComponentFilter;
import org.talend.core.model.properties.Item;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
import org.talend.migration.MigrationReportRecorder;
/*
* (non-Javadoc)
* Data service REST (process) = Job with "tRESTRequest"
* If no BUILD_TYPE is set then default BUILD_TYPE must be OSGI
* If Job does not contain any of the following components: "tRouteInput", "tRESTClient", "tESBConsumer" then BUILD_TYPE must be STANDALONE
*/
public class CorrectBuildTypeForDsRestMigrationTask extends AbstractDataServiceJobMigrationTask {
private static final String T_REST_REQUEST = "tRESTRequest";
/*
* (non-Javadoc)
*
* @see org.talend.migration.IMigrationTask#getOrder()
*/
@Override
public Date getOrder() {
GregorianCalendar gc = new GregorianCalendar(2021, 7, 25, 12, 0, 0);
return gc.getTime();
}
/*
* (non-Javadoc)
*
* @see
* org.talend.core.model.migration.AbstractDataserviceMigrationTask#execute(org
* .talend.core.model.properties.Item)
*/
@SuppressWarnings("unchecked")
@Override
public ExecutionResult execute(Item item) {
final ProcessType processType = getProcessType(item);
boolean modified = false;
/*
* If no BUILD_TYPE is set then default BUILD_TYPE must be OSGI
*/
IComponentFilter filter = new NameComponentFilter(T_REST_REQUEST);
List<NodeType> c = searchComponent(processType, filter);
if (!c.isEmpty()) {
Object buildType = item.getProperty().getAdditionalProperties().get(BUILD_TYPE_PROPERTY);
if (null == buildType) {
item.getProperty().getAdditionalProperties().put(BUILD_TYPE_PROPERTY, BUILD_TYPE_OSGI);
try {
save(item);
modified |= true;
generateReportRecord(
new MigrationReportRecorder(this, MigrationReportRecorder.MigrationOperationType.MODIFY,
item, null, "Build Type", null, BUILD_TYPE_OSGI));
storeMigratedJob(item.getProperty().getLabel(), this.getClass().getName());
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
return ExecutionResult.SUCCESS_NO_ALERT;
} else if (BUILD_TYPE_OSGI.equalsIgnoreCase((String)buildType)){
// current job has correct build type
// skip this job during next migrations
skipMigrationForJob(item.getProperty().getLabel(), this.getClass().getName());
} else if (REST_MS.equalsIgnoreCase((String)buildType)){
// current job has correct build type
// skip this job during next migrations
skipMigrationForJob(item.getProperty().getLabel(), this.getClass().getName());
}
}
if (modified) {
return ExecutionResult.SUCCESS_NO_ALERT;
} else {
return ExecutionResult.NOTHING_TO_DO;
}
}
@Override
public String getDescription() {
return "Synchronize build types for DS Rest jobs";
}
@Override
public void clear () {
clearMigratedJobs();
}
}

View File

@@ -1,255 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.model.components.filters.IComponentFilter;
import org.talend.core.model.components.filters.NameComponentFilter;
import org.talend.core.model.general.Project;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.core.runtime.process.TalendProcessArgumentConstant;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
import org.talend.designer.runprocess.ItemCacheManager;
import org.talend.migration.MigrationReportRecorder;
import org.talend.repository.ProjectManager;
/*
* Routes
* If no BUILD_TYPE is set then Default BUILD_TYPE must be ROUTE
* - Manage child jobs for routes ( parent, target BUILD_TYPE = OSGI )
* Else if BUILD_TYPE is ROUTE
* - Manage child jobs for routes ( parent, target BUILD_TYPE = OSGI )
* Else if BUILD_TYPE is ROUTE_MICROSERVICE
* -Manage child jobs for jobs ( parent, target BUILD_TYPE = STANDALONE )
*/
public class CorrectBuildTypeForRoutesMigrationTask extends AbstractRouteMigrationTask {
private static final String C_TALEND_JOB = "cTalendJob";
protected Map<String, String> migratedChildJobs = new HashMap<String, String>();
/*
* (non-Javadoc)
*
* @see org.talend.migration.IMigrationTask#getOrder()
*/
@Override
public Date getOrder() {
GregorianCalendar gc = new GregorianCalendar(2021, 7, 25, 12, 0, 0);
return gc.getTime();
}
@SuppressWarnings("unchecked")
@Override
public ExecutionResult execute(Item item) {
final ProcessType processType = getProcessType(item);
boolean modified = false;
boolean migrationFailure = false;
/*
* If no BUILD_TYPE is set then default BUILD_TYPE must be ROUTE
*/
Object buildType = item.getProperty().getAdditionalProperties().get(BUILD_TYPE_PROPERTY);
if (null == buildType) {
item.getProperty().getAdditionalProperties().put(BUILD_TYPE_PROPERTY, BUILD_TYPE_ROUTE);
try {
save(item);
modified |= true;
generateReportRecord(
new MigrationReportRecorder(this, MigrationReportRecorder.MigrationOperationType.MODIFY, item,
null, "Build Type", "null", BUILD_TYPE_OSGI));
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
}
/*
* If no BUILD_TYPE is set then Default BUILD_TYPE must be ROUTE - Manage child
* jobs for routes ( parent, target BUILD_TYPE = OSGI ) Else if BUILD_TYPE is
* ROUTE - Manage child jobs for routes ( parent, target BUILD_TYPE = OSGI )
* Else if BUILD_TYPE is ROUTE_MICROSERVICE -Manage child jobs for jobs (
* parent, target BUILD_TYPE = STANDALONE )
*/
String currentRouteBuildType = (String) item.getProperty().getAdditionalProperties().get(BUILD_TYPE_PROPERTY);
String currentRouteID = item.getProperty().getLabel();
IComponentFilter filter = new NameComponentFilter(C_TALEND_JOB);
List<NodeType> c = searchComponent(processType, filter);
if (!c.isEmpty()) {
for (NodeType cTalendJobComponent : c) {
String processID = findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_PROCESS",
cTalendJobComponent) == null ? null
: findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_PROCESS",
cTalendJobComponent).getValue();
String processVersion = findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_VERSION",
cTalendJobComponent) == null ? null
: findElementParameterByName("SELECTED_JOB_NAME:PROCESS_TYPE_VERSION",
cTalendJobComponent).getValue();
if (processID != null && processVersion != null) {
ProcessItem childItem = ItemCacheManager.getProcessItem(processID, processVersion);
Project childItemProject = ProjectManager.getInstance().getCurrentProject();
if (childItem == null) {
for (Project refProject : ProjectManager.getInstance().getAllReferencedProjects()) {
childItem = ItemCacheManager.getRefProcessItem(getProject(), processID);
if (childItem != null) {
childItemProject = refProject;
break;
}
}
}
if (childItem != null) {
Object currentChildBuildType = childItem.getProperty().getAdditionalProperties()
.get(BUILD_TYPE_PROPERTY);
String jobID = childItem.getProperty().getLabel();
String currentChildBuildTypeStr = (null == currentChildBuildType) ? null
: (String) currentChildBuildType;
if (BUILD_TYPE_ROUTE.equalsIgnoreCase(currentRouteBuildType)
&& BUILD_TYPE_OSGI.equalsIgnoreCase(currentChildBuildTypeStr)) {
storeMigratedModel(jobID, currentRouteID);
}
if (BUILD_TYPE_ROUTE.equalsIgnoreCase(currentRouteBuildType)
&& !BUILD_TYPE_OSGI.equalsIgnoreCase(currentChildBuildTypeStr)) {
try {
if (isModelMigrated(jobID)) {
ExceptionHandler.process(new RuntimeException(
"Child Job is called by 2 or more different Routes which have different build types. Build type for child Job ["
+ jobID + "] was previously updated to [" + currentChildBuildTypeStr
+ "] to be compatible with parent Route ["
+ getStoredMigratedModelParentRoute(jobID)
+ "] which is not compatible with current parent Route ["
+ currentRouteID + "] with build type [" + currentRouteBuildType
+ "]. "));
migrationFailure = true;
continue;
} else {
childItem.getProperty().getAdditionalProperties()
.put(TalendProcessArgumentConstant.ARG_BUILD_TYPE, BUILD_TYPE_OSGI);
generateReportRecord(new MigrationReportRecorder(this,
MigrationReportRecorder.MigrationOperationType.MODIFY, childItem, null,
"Build Type", currentChildBuildTypeStr, BUILD_TYPE_OSGI));
ProxyRepositoryFactory.getInstance().save(childItemProject, childItem, true);
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
}
if (BUILD_TYPE_ROUTE_MICROSERVICE.equalsIgnoreCase(currentRouteBuildType)
&& !BUILD_TYPE_STANDALONE.equalsIgnoreCase(currentChildBuildTypeStr)) {
try {
if (isModelMigrated(jobID)) {
ExceptionHandler.process(new RuntimeException(
"Child Job is called by 2 or more different Routes which have different build types. Build type for child Job ["
+ jobID + "] was previously updated to [" + currentChildBuildTypeStr
+ "] to be compatible with parent Route ["
+ getStoredMigratedModelParentRoute(jobID)
+ "] which is not compatible with current parent Route ["
+ currentRouteID + "] with build type [" + currentRouteBuildType
+ "]. "));
migrationFailure = true;
continue;
} else {
childItem.getProperty().getAdditionalProperties()
.put(TalendProcessArgumentConstant.ARG_BUILD_TYPE, BUILD_TYPE_STANDALONE);
generateReportRecord(new MigrationReportRecorder(this,
MigrationReportRecorder.MigrationOperationType.MODIFY, childItem, null,
"Build Type", currentChildBuildTypeStr, BUILD_TYPE_STANDALONE));
ProxyRepositoryFactory.getInstance().save(childItemProject, childItem, true);
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
}
if(!isModelMigrated(jobID)) {
storeMigratedModel(jobID, currentRouteID);
}
}
}
}
}
if (migrationFailure) {
return ExecutionResult.FAILURE;
}
if (modified) {
return ExecutionResult.SUCCESS_NO_ALERT;
}
return ExecutionResult.NOTHING_TO_DO;
}
protected void clearMigratedChildJobs() {
migratedChildJobs.clear();
}
protected void storeMigratedModel(String jobName, String parentRouteName) {
migratedChildJobs.put(jobName, parentRouteName);
}
protected boolean isModelMigrated(String jobName) {
return migratedChildJobs.containsKey(jobName);
}
protected String getStoredMigratedModelParentRoute(String jobName) {
return migratedChildJobs.get(jobName);
}
@Override
public String getDescription() {
return "Synchronize build types for Routes (incuding child jobs)";
}
@Override
public void clear() {
clearMigratedChildJobs();
clearMigratedJobs();
}
}

View File

@@ -1,103 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.PersistenceException;
import org.talend.core.model.components.filters.IComponentFilter;
import org.talend.core.model.components.filters.NameComponentFilter;
import org.talend.core.model.properties.Item;
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
import org.talend.designer.core.model.utils.emf.talendfile.ProcessType;
import org.talend.migration.MigrationReportRecorder;
/*
* Data service SOAP = Job with "tESBProviderRequest"
* Set BUILD_TYPE as OSGI
* Manage child jobs for jobs ( parent job, target BUILD_TYPE = OSGI )
*/
public class CorrectBuildTypeForSOAPServiceJobMigrationTask extends AbstractDataServiceJobMigrationTask {
private static final String T_ESB_PROVIDER_REQUEST = "tESBProviderRequest";
private static final String BUILD_TYPE_PROPERTY = "BUILD_TYPE";
private static final String BUILD_TYPE_OSGI = "OSGI";
/*
* (non-Javadoc)
*
* @see org.talend.migration.IMigrationTask#getOrder()
*/
@Override
public Date getOrder() {
GregorianCalendar gc = new GregorianCalendar(2021, 7, 25, 12, 0, 0);
return gc.getTime();
}
/*
* (non-Javadoc)
*
* @see
* org.talend.core.model.migration.AbstractDataserviceMigrationTask#execute(org
* .talend.core.model.properties.Item)
*/
@SuppressWarnings("unchecked")
@Override
public ExecutionResult execute(Item item) {
final ProcessType processType = getProcessType(item);
boolean modified = false;
/*
* If no BUILD_TYPE is set then default BUILD_TYPE must be OSGI
*/
IComponentFilter filter = new NameComponentFilter(T_ESB_PROVIDER_REQUEST);
List<NodeType> c = searchComponent(processType, filter);
if (!c.isEmpty()) {
Object originalBuildType = item.getProperty().getAdditionalProperties().get(BUILD_TYPE_PROPERTY);
if (null == originalBuildType || !BUILD_TYPE_OSGI.equalsIgnoreCase(originalBuildType.toString())) {
item.getProperty().getAdditionalProperties().put(BUILD_TYPE_PROPERTY, BUILD_TYPE_OSGI);
try {
save(item);
modified |= true;
generateReportRecord(new MigrationReportRecorder(this,
MigrationReportRecorder.MigrationOperationType.MODIFY, item, null, "Build Type",
(null == originalBuildType) ? null : originalBuildType.toString(), BUILD_TYPE_OSGI));
storeMigratedJob(item.getProperty().getLabel(), this.getClass().getName());
} catch (PersistenceException e) {
ExceptionHandler.process(e);
return ExecutionResult.FAILURE;
}
return ExecutionResult.SUCCESS_NO_ALERT;
} else if (BUILD_TYPE_OSGI.equalsIgnoreCase((String)originalBuildType)){
// current job has correct build type
// skip this job during next migrations
skipMigrationForJob(item.getProperty().getLabel(), this.getClass().getName());
}
}
if (modified) {
return ExecutionResult.SUCCESS_NO_ALERT;
}
return ExecutionResult.NOTHING_TO_DO;
}
@Override
public String getDescription() {
return "Synchronize build types for SOAP service Jobs";
}
@Override
public void clear () {
clearMigratedJobs();
}
}

View File

@@ -1,7 +0,0 @@
package org.talend.designer.maven.migration.tasks;
import org.talend.migration.IProjectMigrationTask;
public interface ICorrectBuildTypeMigrationTask extends IProjectMigrationTask {
public void clear ();
}

View File

@@ -668,10 +668,7 @@ public class AggregatorPomsHelper {
Set<JobInfo> allJobInfos = ProcessorUtilities.getChildrenJobInfo(item, false, true);
allJobInfos.add(new JobInfo(item, item.getProcess().getDefaultContext()));
return allJobInfos.stream();
}).filter(info -> !info.isTestContainer() && ProjectManager.getInstance()
.isInCurrentMainProject(info.getJobletProperty() != null ? info.getJobletProperty() : info.getProcessItem()))
.distinct()
.map(info -> info.getJobletProperty() != null ? info.getJobletProperty().getItem() : info.getProcessItem())
}).map(info -> info.getJobletProperty() != null ? info.getJobletProperty().getItem() : info.getProcessItem())
.collect(Collectors.toSet());
} else {
allItems = objects.stream().map(object -> object.getProperty().getItem()).collect(Collectors.toSet());

View File

@@ -1,118 +0,0 @@
package org.talend.designer.maven.tools;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.swt.widgets.Display;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.model.general.Project;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.designer.maven.migration.tasks.CorrectBuildTypeForDIJobMigrationTask;
import org.talend.designer.maven.migration.tasks.CorrectBuildTypeForDsRestMigrationTask;
import org.talend.designer.maven.migration.tasks.CorrectBuildTypeForRoutesMigrationTask;
import org.talend.designer.maven.migration.tasks.CorrectBuildTypeForSOAPServiceJobMigrationTask;
import org.talend.designer.maven.migration.tasks.ICorrectBuildTypeMigrationTask;
import org.talend.migration.IMigrationTask;
import org.talend.migration.MigrationReportHelper;
import org.talend.repository.ProjectManager;
import org.talend.repository.RepositoryWorkUnit;
public class BuildTypeManager {
private ICorrectBuildTypeMigrationTask[] syncBuildTypeMigrationTasks = {
new CorrectBuildTypeForRoutesMigrationTask(), new CorrectBuildTypeForSOAPServiceJobMigrationTask(),
new CorrectBuildTypeForDsRestMigrationTask(), new CorrectBuildTypeForDIJobMigrationTask() };
private boolean hasErrors = false;
public void syncBuildTypes(FieldEditorPreferencePage page) throws Exception {
IRunnableWithProgress runnableWithProgress = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
RepositoryWorkUnit<Object> workUnit = new RepositoryWorkUnit<Object>("Synchronize all build types") { //$NON-NLS-1$
@Override
protected void run() {
final IWorkspaceRunnable op = new IWorkspaceRunnable() {
@Override
public void run(final IProgressMonitor monitor) throws CoreException {
try {
syncAllBuildTypesWithProgress(monitor, page);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
};
IWorkspace workspace = ResourcesPlugin.getWorkspace();
try {
ISchedulingRule schedulingRule = workspace.getRoot();
workspace.run(op, schedulingRule, IWorkspace.AVOID_UPDATE, monitor);
} catch (CoreException e) {
ExceptionHandler.process(e);
}
}
};
workUnit.setAvoidUnloadResources(true);
ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(workUnit);
}
};
hasErrors = false;
new ProgressMonitorDialog(Display.getDefault().getActiveShell()).run(true, true, runnableWithProgress);
if (hasErrors) {
page.setErrorMessage("Build types synchronization finished with errors. Check workspace logs for details.");
} else {
page.setErrorMessage(null);
}
}
public void syncAllBuildTypesWithProgress(IProgressMonitor monitor, FieldEditorPreferencePage page)
throws Exception {
Project project = ProjectManager.getInstance().getCurrentProject();
SubMonitor subMonitor = SubMonitor.convert(monitor, syncBuildTypeMigrationTasks.length);
for (ICorrectBuildTypeMigrationTask task : syncBuildTypeMigrationTasks) {
task.clear();
}
for (ICorrectBuildTypeMigrationTask task : syncBuildTypeMigrationTasks) {
subMonitor.beginTask(task.getDescription(), syncBuildTypeMigrationTasks.length);
IMigrationTask.ExecutionResult result = task.execute(project);
if (IMigrationTask.ExecutionResult.FAILURE.equals(result)) {
hasErrors = true;
}
subMonitor.worked(1);
}
subMonitor.beginTask("Generate migration report", syncBuildTypeMigrationTasks.length);
MigrationReportHelper.getInstance().generateMigrationReport(project.getTechnicalLabel());
monitor.done();
}
}

View File

@@ -59,6 +59,7 @@ import org.talend.core.model.process.IContext;
import org.talend.core.model.process.IProcess;
import org.talend.core.model.process.IProcess2;
import org.talend.core.model.process.JobInfo;
import org.talend.core.model.process.ProcessUtils;
import org.talend.core.model.properties.Item;
import org.talend.core.model.properties.ProcessItem;
import org.talend.core.model.properties.Project;
@@ -77,7 +78,6 @@ import org.talend.core.runtime.process.TalendProcessOptionConstants;
import org.talend.core.runtime.projectsetting.IProjectSettingPreferenceConstants;
import org.talend.core.runtime.projectsetting.IProjectSettingTemplateConstants;
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
import org.talend.core.runtime.util.ModuleAccessHelper;
import org.talend.core.services.IGITProviderService;
import org.talend.core.ui.ITestContainerProviderService;
import org.talend.core.utils.TemplateFileUtils;
@@ -202,9 +202,11 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
final IContext context = jProcessor.getContext();
Property property = jProcessor.getProperty();
if (ITestContainerProviderService.get() != null) {
ITestContainerProviderService testService = ITestContainerProviderService.get();
if (testService.isTestContainerProcess(process)) {
if (ProcessUtils.isTestContainer(process)) {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ITestContainerProviderService.class)) {
ITestContainerProviderService testService = (ITestContainerProviderService) GlobalServiceRegister
.getDefault()
.getService(ITestContainerProviderService.class);
try {
property = testService.getParentJobItem(property.getItem()).getProperty();
process = testService.getParentJobProcess(process);
@@ -212,21 +214,6 @@ public class CreateMavenJobPom extends AbstractMavenProcessorPom {
ExceptionHandler.process(e);
}
}
List<ProcessItem> testcaseItems = testService.getAllTestContainers((ProcessItem) property.getItem(), true, true);
testcaseItems.add((ProcessItem) property.getItem());
if (!testcaseItems.isEmpty()) {
Set<String> testVMArgs = testcaseItems.stream().flatMap(item -> {
Set<JobInfo> allInfos = new HashSet<>();
allInfos.add(new JobInfo(item, item.getProcess().getDefaultContext()));
allInfos.addAll(ProcessorUtilities.getChildrenJobInfo(item, false, true));
return ModuleAccessHelper.getModuleAccessVMArgs(item.getProperty(), allInfos).stream();
}).collect(Collectors.toSet());
if (testVMArgs != null && !testVMArgs.isEmpty()) {
StringBuilder vmArgsLine = new StringBuilder();
testVMArgs.forEach(arg -> vmArgsLine.append(arg + " "));
properties.setProperty("argLine", vmArgsLine.toString().trim());
}
}
}
Project project = ProjectManager.getInstance().getProject(property);

View File

@@ -302,16 +302,13 @@ public class PomIdsHelper {
private static String getPublishCloudVersion(String latestVersion) {
if (null == latestVersion) {
return null;
} else if (latestVersion.contains(MavenConstants.SNAPSHOT)) {
return latestVersion;
return "0.1.0";
} else {
latestVersion = VersionUtils.getPublishVersion(latestVersion);
int i = latestVersion.lastIndexOf('.') + 1;
return latestVersion.substring(0, i) + (Long.parseLong(latestVersion.substring(i)) + 1);
}
}
/**
* @return "<bundleVersion>".
*/
@@ -324,12 +321,12 @@ public class PomIdsHelper {
useSnapshot = property.getAdditionalProperties().containsKey(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
}
if(version == null) {
version = VersionUtils.getPublishVersion(bundleVersion);
version = bundleVersion;
}
if (version == null) {
version = VersionUtils.getPublishVersion(property.getVersion());
}
if (useSnapshot && version != null && !version.contains(MavenConstants.SNAPSHOT)) {
if (useSnapshot) {
version += MavenConstants.SNAPSHOT;
}
}
@@ -348,12 +345,12 @@ public class PomIdsHelper {
useSnapshot = property.getAdditionalProperties().containsKey(MavenConstants.NAME_PUBLISH_AS_SNAPSHOT);
}
if(version == null) {
version = VersionUtils.getPublishVersion(featureVersion);
version = featureVersion;
}
if (version == null) {
version = VersionUtils.getPublishVersion(property.getVersion());
}
if (useSnapshot && version != null && !version.contains(MavenConstants.SNAPSHOT)) {
if (useSnapshot) {
version += MavenConstants.SNAPSHOT;
}
}
@@ -377,7 +374,7 @@ public class PomIdsHelper {
if (version == null) {
version = VersionUtils.getPublishVersion(property.getVersion());
}
if (useSnapshot && version != null && !version.contains(MavenConstants.SNAPSHOT)) {
if (useSnapshot) {
version += MavenConstants.SNAPSHOT;
}
}
@@ -401,7 +398,7 @@ public class PomIdsHelper {
if (version == null) {
version = VersionUtils.getPublishVersion(property.getVersion());
}
if (useSnapshot && version != null && !version.contains(MavenConstants.SNAPSHOT)) {
if (useSnapshot) {
version += MavenConstants.SNAPSHOT;
}
}

View File

@@ -19,11 +19,9 @@ import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.security.SecureRandom;
import java.util.ArrayList;
@@ -1099,16 +1097,4 @@ public class PomUtil {
}
}
public static boolean isValidPomFile(String pomfile) {
if (pomfile != null) {
MavenModelManager modelManager = MavenPlugin.getMavenModelManager();
try (InputStream inputStream = new FileInputStream(new File(pomfile))) {
modelManager.readMavenModel(inputStream);
return true;
} catch (IOException | CoreException e) {
return false;
}
}
return false;
}
}

View File

@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/commons-text-1.10.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-io-2.10.0.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-pool2-2.4.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-validator-1.5.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-math3-3.3.jar"/>
@@ -10,5 +8,6 @@
<classpathentry exported="true" kind="lib" path="lib/commons-digester-2.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-cli-2.0-SNAPSHOT.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-codec-1.15.jar"/>
<classpathentry exported="true" kind="lib" path="lib/commons-text-1.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -10,7 +10,7 @@ Bundle-ClassPath: .,
lib/commons-math3-3.3.jar,
lib/commons-validator-1.5.1.jar,
lib/commons-pool2-2.4.2.jar,
lib/commons-text-1.10.0.jar,
lib/commons-text-1.1.jar,
lib/commons-io-2.10.0.jar
Export-Package: org.apache.commons.cli2,
org.apache.commons.cli2.builder,

View File

@@ -58,11 +58,6 @@
<artifactId>commons-pool2</artifactId>
<version>2.4.2</version>
</artifactItem>
<artifactItem>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.10.0</version>
</artifactItem>
<artifactItem>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>

View File

@@ -10,8 +10,8 @@
<artifactId>org.talend.libraries.apache</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<reload4j.version>1.2.22</reload4j.version>
<slf4j.version>1.7.34</slf4j.version>
<reload4j.version>1.2.19</reload4j.version>
<slf4j.version>1.7.29</slf4j.version>
<log4j2.version>2.17.1</log4j2.version>
</properties>
<dependencies>
@@ -22,7 +22,7 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<exclusions>
<exclusion>

View File

@@ -6,42 +6,9 @@ COPYRIGHTS AND LICENSES
ORIGINAL LICENSE (a.k.a. "hypersonic_lic.txt")
For work developed by the HSQL Development Group:
For content, code, and products originally developed by Thomas Mueller and the Hypersonic SQL Group:
Copyright (c) 2001-2022, The HSQL Development Group
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
Neither the name of the HSQL Development Group nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
For work originally developed by the Hypersonic SQL Group:
Copyright (c) 1995-2000, The Hypersonic SQL Group.
Copyright (c) 1995-2000 by the Hypersonic SQL Group.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -70,12 +37,12 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many individuals
on behalf of the Hypersonic SQL Group.
This software consists of voluntary contributions made by many individuals on behalf of the
Hypersonic SQL Group.
For work added by the HSQL Development Group (a.k.a. hsqldb_lic.txt):
Copyright (c) 2001-2022, The HSQL Development Group
Copyright (c) 2001-2005, The HSQL Development Group
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@@ -9,32 +9,4 @@
</parent>
<artifactId>org.talend.libraries.jdbc.hsql</artifactId>
<packaging>eclipse-plugin</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.7.1</version>
<outputDirectory>${project.basedir}/lib</outputDirectory>
<destFileName>hsqldb.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -126,8 +126,6 @@ ConfigModuleDialog.error.missingName=Please input a module name!
ConfigModuleDialog.error.missingModule=Please select a module!
ConfigModuleDialog.search.noModules=No modules found for search of: {0} !
ConfigModuleDialog.warn.artifactory=User libraries artifact repository can't be connected!
ConfigModuleDialog.btn.detectDependencies=Add direct dependencies
ConfigModuleDialog.btn.detectDependenciesTip=Add direct dependencies for selected module
ImportCustomSettingsAction.title=Import custom settings
ImportCustomSettingsAction.warning=Are you sure to overwrite the custom mvn uri settings with the selected file ?
ExportCustomSettingsAction.title=Export custom settings

View File

@@ -126,8 +126,6 @@ ConfigModuleDialog.error.missingName=Saisissez un nom de module.
ConfigModuleDialog.error.missingModule=S\u00E9lectionnez un module.
ConfigModuleDialog.search.noModules=Aucun module trouv\u00E9 pour la recherche de\u00A0: {0}.
ConfigModuleDialog.warn.artifactory=Impossible de connecter le r\u00E9f\u00E9rentiel d'artefacts des biblioth\u00E8ques utilisateur !
ConfigModuleDialog.btn.detectDependencies=Ajouter des d\u00E9pendances directes
ConfigModuleDialog.btn.detectDependenciesTip=Ajouter des d\u00E9pendances directes pour le module s\u00E9lectionn\u00E9
ImportCustomSettingsAction.title=Param\u00E8tres d'import personnalis\u00E9
ImportCustomSettingsAction.warning=\u00CAtes-vous s\u00FBr(e) de vouloir \u00E9craser les param\u00E8tres d'URI Maven personnalis\u00E9s par le fichier s\u00E9lectionn\u00E9 ?
ExportCustomSettingsAction.title=Param\u00E8tres d'export personnalis\u00E9

View File

@@ -114,7 +114,7 @@ ConfigModuleDialog.message=\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u9078\u629E\u305
ConfigModuleDialog.install.message=\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB: {0}
ConfigModuleDialog.platfromBtn=\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0
ConfigModuleDialog.repositoryBtn=\u30A2\u30FC\u30C6\u30A3\u30D5\u30A1\u30AF\u30C8\u30EA\u30DD\u30B8\u30C8\u30EA\u30FC(\u30ED\u30FC\u30AB\u30EBm2/nexus)
ConfigModuleDialog.installNewBtn=\u65B0\u3057\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB
ConfigModuleDialog.installNewBtn=\u65B0\u898F\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB
ConfigModuleDialog.findExistByNameBtn=\u540D\u524D\u3067\u691C\u7D22
ConfigModuleDialog.moduleName=\u30E2\u30B8\u30E5\u30FC\u30EB\u540D
ConfigModuleDialog.shareInfo=\u30EA\u30DD\u30B8\u30C8\u30EA\u30FC\u304C\u518D\u30C7\u30D7\u30ED\u30A4\u3092\u3057\u306A\u3044\u5834\u5408\u306F\u3001\u30E9\u30A4\u30D6\u30E9\u30EA\u30FC\u3092\u30EA\u30E2\u30FC\u30C8\u30A2\u30FC\u30C6\u30A3\u30D5\u30A1\u30AF\u30C8\u30EA\u30DD\u30B8\u30C8\u30EA\u30FC\u306B\u5171\u6709\u3067\u304D\u307E\u305B\u3093\u3002\u5171\u6709\u3092\u7D9A\u884C\u3057\u307E\u3059\u304B?
@@ -126,8 +126,6 @@ ConfigModuleDialog.error.missingName=\u30E2\u30B8\u30E5\u30FC\u30EB\u540D\u3092\
ConfigModuleDialog.error.missingModule=\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044!
ConfigModuleDialog.search.noModules={0}\u306E\u691C\u7D22\u3067\u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F!
ConfigModuleDialog.warn.artifactory=\u30E6\u30FC\u30B6\u30FC\u30E9\u30A4\u30D6\u30E9\u30EA\u30FC\u30A2\u30FC\u30C6\u30A3\u30D5\u30A1\u30AF\u30C8\u30EA\u30DD\u30B8\u30C8\u30EA\u30FC\u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093!
ConfigModuleDialog.btn.detectDependencies=\u76F4\u63A5\u4F9D\u5B58\u9805\u76EE\u3092\u8FFD\u52A0
ConfigModuleDialog.btn.detectDependenciesTip=\u9078\u629E\u3057\u305F\u30E2\u30B8\u30E5\u30FC\u30EB\u3067\u76F4\u63A5\u4F9D\u5B58\u9805\u76EE\u3092\u8FFD\u52A0
ImportCustomSettingsAction.title=\u30AB\u30B9\u30BF\u30E0\u8A2D\u5B9A\u3092\u30A4\u30F3\u30DD\u30FC\u30C8
ImportCustomSettingsAction.warning=\u9078\u629E\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3067\u30AB\u30B9\u30BF\u30E0mvn URI\u8A2D\u5B9A\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B?
ExportCustomSettingsAction.title=\u30AB\u30B9\u30BF\u30E0\u8A2D\u5B9A\u3092\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8

View File

@@ -126,8 +126,6 @@ ConfigModuleDialog.error.missingName=\u8BF7\u8F93\u5165\u6A21\u5757\u540D\u79F0!
ConfigModuleDialog.error.missingModule=\u8BF7\u9009\u62E9\u6A21\u5757!
ConfigModuleDialog.search.noModules=\u641C\u7D22 {0} \u672A\u53D1\u73B0\u6A21\u5757!
ConfigModuleDialog.warn.artifactory=\u7528\u6237\u4F9D\u8D56\u5305\u6784\u4EF6\u5E93\u65E0\u6CD5\u8FDE\u63A5!
ConfigModuleDialog.btn.detectDependencies=\u6DFB\u52A0\u76F4\u63A5\u4F9D\u8D56\u5305
ConfigModuleDialog.btn.detectDependenciesTip=\u4E3A\u6240\u9009\u6A21\u5757\u6DFB\u52A0\u76F4\u63A5\u4F9D\u8D56\u5305
ImportCustomSettingsAction.title=\u5BFC\u5165\u81EA\u5B9A\u4E49\u8BBE\u7F6E
ImportCustomSettingsAction.warning=\u662F\u5426\u786E\u5B9A\u4F7F\u7528\u6240\u9009\u6587\u4EF6\u6539\u5199\u81EA\u5B9A\u4E49 mvn uri \u8BBE\u7F6E\uFF1F
ExportCustomSettingsAction.title=\u5BFC\u51FA\u81EA\u5B9A\u4E49\u8BBE\u7F6E

View File

@@ -185,7 +185,7 @@ public class LibraryManagerUIService implements ILibraryManagerUIService {
"ArtifactsDeployer.uploadJarEncounterMvnRepositroySameName.MessageContent", originalJarFileName, mvnUrlForJarName));//$NON-NLS-1$
}
public IConfigModuleDialog getConfigModuleDialog(Shell parentShell, String initValue, boolean allowDetectDependencies) {
return new ConfigModuleDialog(parentShell, initValue, allowDetectDependencies);
public IConfigModuleDialog getConfigModuleDialog(Shell parentShell, String initValue) {
return new ConfigModuleDialog(parentShell, initValue);
}
}

View File

@@ -19,20 +19,15 @@ import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.TimeoutException;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -41,7 +36,6 @@ import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.fieldassist.AutoCompleteField;
import org.eclipse.jface.fieldassist.ComboContentAdapter;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -62,19 +56,13 @@ import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.ui.gmf.util.DisplayUtils;
import org.talend.commons.ui.runtime.image.EImage;
import org.talend.commons.ui.runtime.image.ImageProvider;
import org.talend.commons.ui.runtime.utils.ZipFileUtils;
import org.talend.commons.ui.swt.dialogs.IConfigModuleDialog;
import org.talend.core.language.ECodeLanguage;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.ModuleNeeded.ELibraryInstallStatus;
import org.talend.core.model.general.ModuleToInstall;
import org.talend.core.runtime.maven.MavenArtifact;
import org.talend.core.runtime.maven.MavenConstants;
import org.talend.core.runtime.maven.MavenUrlHelper;
import org.talend.designer.maven.utils.PomUtil;
import org.talend.librariesmanager.maven.MavenArtifactsHandler;
import org.talend.librariesmanager.model.ModulesNeededProvider;
import org.talend.librariesmanager.prefs.LibrariesManagerUtils;
import org.talend.librariesmanager.ui.LibManagerUiPlugin;
import org.talend.librariesmanager.ui.i18n.Messages;
import org.talend.librariesmanager.utils.ConfigModuleHelper;
@@ -144,13 +132,6 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
private Composite warningComposite;
private Button detectDepBtn;
private String moduleFilePath;
private boolean allowDetectDependencies = false;
private boolean detectDependencies = false;
/**
* DOC wchen InstallModuleDialog constructor comment.
*
@@ -161,13 +142,6 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
setShellStyle(SWT.CLOSE | SWT.MAX | SWT.TITLE | SWT.BORDER | SWT.APPLICATION_MODAL | SWT.RESIZE | getDefaultOrientation());
this.initValue = initValue;
}
public ConfigModuleDialog(Shell parentShell, String initValue, boolean allowDetectDependencies) {
super(parentShell);
setShellStyle(SWT.CLOSE | SWT.MAX | SWT.TITLE | SWT.BORDER | SWT.APPLICATION_MODAL | SWT.RESIZE | getDefaultOrientation());
this.initValue = initValue;
this.allowDetectDependencies = allowDetectDependencies;
}
@Override
protected void configureShell(Shell newShell) {
@@ -244,11 +218,6 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
GridData layoutData = new GridData(GridData.FILL_BOTH);
mvnContainer.setLayoutData(layoutData);
createMavenURIComposite(mvnContainer);
detectDepBtn = new Button(mvnContainer, SWT.CHECK);
detectDepBtn.setLayoutData(new GridData());
detectDepBtn.setText(Messages.getString("ConfigModuleDialog.btn.detectDependencies"));
detectDepBtn.setToolTipText(Messages.getString("ConfigModuleDialog.btn.detectDependenciesTip"));
detectDepBtn.setVisible(allowDetectDependencies());
}
@Override
@@ -288,7 +257,6 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
setPlatformGroupEnabled(true);
setInstallNewGroupEnabled(false);
setRepositoryGroupEnabled(false);
setDetectBtnEnabled();
if (validateInputFields()) {
setupMavenURIforPlatform();
}
@@ -344,7 +312,6 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
setPlatformGroupEnabled(false);
setInstallNewGroupEnabled(false);
setRepositoryGroupEnabled(true);
setDetectBtnEnabled();
}
});
@@ -682,12 +649,6 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
setMessage(Messages.getString("InstallModuleDialog.error.jarPath"), IMessageProvider.ERROR);
return false;
}
boolean validPomFile = PomUtil.isValidPomFile(jarPathTxt.getText());
if(!(validPomFile || ZipFileUtils.isValidJarFile(jarPathTxt.getText()))) {
return false;
}
String originalText = defaultUriTxt.getText().trim();
String customURIWithType = MavenUrlHelper.addTypeForMavenUri(customUriText.getText(), moduleName);
if (useCustomBtn.getSelection()) {
@@ -702,9 +663,7 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
return false;
}
} else if (StringUtils.isEmpty(originalText)) {
if(!validPomFile) {
return false;
}
return false;
}
setMessage(Messages.getString("InstallModuleDialog.message"), IMessageProvider.INFORMATION);
@@ -780,98 +739,83 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
customURI = MavenUrlHelper.addTypeForMavenUri(customUriText.getText().trim(), moduleName);
urlToUse = !StringUtils.isEmpty(customURI) ? customURI : defaultURI;
}
detectDependencies = allowDetectDependencies() && detectDepBtn.getSelection();
Map<String, File> mvnurl2Files = null;
if (platfromRadioBtn.getSelection()) {
moduleName2MVNUrls.put(moduleName, urlToUse);
moduleFilePath = calculatePath(urlToUse);// for platform jar
mvnurl2Files = detectDependencies();
} else if (installRadioBtn.getSelection()) {
if (installRadioBtn.getSelection()) {
File jarFile = new File(jarPathTxt.getText().trim());
moduleFilePath = jarFile.getAbsolutePath();
mvnurl2Files = detectDependencies();
if(ZipFileUtils.isValidJarFile(moduleFilePath)) {
MavenArtifact art = MavenUrlHelper.parseMvnUrl(urlToUse);
moduleName = art.getFileName();
moduleName2MVNUrls.put(moduleName, urlToUse);
String sha1New = ConfigModuleHelper.getSHA1(jarFile);
art.setSha1(sha1New);
// resolve jar locally
File localFile = ConfigModuleHelper.resolveLocal(urlToUse);
boolean install = false;
if (localFile != null && localFile.exists()) {
String sha1Local = ConfigModuleHelper.getSHA1(localFile);
// already installed with different jar
if (!sha1Local.equals(sha1New)) {
install = true;
}
} else {
// just install
MavenArtifact art = MavenUrlHelper.parseMvnUrl(urlToUse);
moduleName = art.getFileName();
String sha1New = ConfigModuleHelper.getSHA1(jarFile);
art.setSha1(sha1New);
// resolve jar locally
File localFile = ConfigModuleHelper.resolveLocal(urlToUse);
boolean install = false;
if (localFile != null && localFile.exists()) {
String sha1Local = ConfigModuleHelper.getSHA1(localFile);
// already installed with different jar
if (!sha1Local.equals(sha1New)) {
install = true;
}
if (install) {
final IRunnableWithProgress progress = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask("Install and share " + jarFile, 100);
monitor.worked(10);
DisplayUtils.getDisplay().syncExec(new Runnable() {
@Override
public void run() {
} else {
// just install
install = true;
}
if (install) {
final IRunnableWithProgress progress = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask("Install and share " + jarFile, 100);
monitor.worked(10);
DisplayUtils.getDisplay().syncExec(new Runnable() {
@Override
public void run() {
try {
boolean deploy = true;
// check remote
List<MavenArtifact> remoteArtifacts = null;
try {
boolean deploy = true;
// check remote
List<MavenArtifact> remoteArtifacts = null;
try {
remoteArtifacts = ConfigModuleHelper.searchRemoteArtifacts(art.getGroupId(),
art.getArtifactId(), null);
} catch (Exception e) {
ExceptionHandler.process(e);
}
if (remoteArtifacts != null && !remoteArtifacts.isEmpty()) {
if (ConfigModuleHelper.canFind(new HashSet<MavenArtifact>(remoteArtifacts), art)) {
deploy = false;
} else {
if (art.getVersion() != null
&& art.getVersion().endsWith(MavenUrlHelper.VERSION_SNAPSHOT)) {
// snapshot
deploy = true;
} else {
// popup and ask, reinstall?
deploy = MessageDialog.open(MessageDialog.CONFIRM, getShell(), "",
Messages.getString("ConfigModuleDialog.shareInfo"), SWT.NONE);
}
}
}
ConfigModuleHelper.install(jarFile, urlToUse, deploy);
updateIndex(urlToUse, moduleName);
remoteArtifacts = ConfigModuleHelper.searchRemoteArtifacts(art.getGroupId(),
art.getArtifactId(), null);
} catch (Exception e) {
ExceptionHandler.process(e);
}
if (remoteArtifacts != null && !remoteArtifacts.isEmpty()) {
if (ConfigModuleHelper.canFind(new HashSet<MavenArtifact>(remoteArtifacts), art)) {
deploy = false;
} else {
if (art.getVersion() != null
&& art.getVersion().endsWith(MavenUrlHelper.VERSION_SNAPSHOT)) {
// snapshot
deploy = true;
} else {
// popup and ask, reinstall?
deploy = MessageDialog.open(MessageDialog.CONFIRM, getShell(), "",
Messages.getString("ConfigModuleDialog.shareInfo"), SWT.NONE);
}
}
}
ConfigModuleHelper.install(jarFile, urlToUse, deploy);
updateIndex(urlToUse);
} catch (Exception e) {
ExceptionHandler.process(e);
}
});
monitor.done();
}
};
runProgress(progress);
}
}
});
monitor.done();
}
};
runProgress(progress);
}
} else if (repositoryRadioBtn.getSelection()) {
// resolve jar locally
File localFile = ConfigModuleHelper.resolveLocal(urlToUse);
if (localFile != null && localFile.exists()) {
moduleFilePath = localFile.getAbsolutePath();
moduleName2MVNUrls.put(moduleName, urlToUse);
mvnurl2Files = detectDependencies();
}
if (!isLocalSearch) {
boolean download = true;
// resolve jar locally
File localFile = ConfigModuleHelper.resolveLocal(urlToUse);
if (localFile != null && localFile.exists()) {
// check sha1
String sha1Local = ConfigModuleHelper.getSHA1(localFile);
@@ -901,77 +845,15 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
DownloadModuleRunnableWithLicenseDialog downloadModuleRunnable = new DownloadModuleRunnableWithLicenseDialog(
toInstall, getShell());
runProgress(downloadModuleRunnable);
this.updateIndex(defaultURI, moduleName);
localFile = ConfigModuleHelper.resolveLocal(urlToUse);
moduleFilePath = localFile.getAbsolutePath();
moduleName2MVNUrls.put(moduleName, urlToUse);
mvnurl2Files = detectDependencies();
this.updateIndex(defaultURI);
}
}
}
shareLibs(mvnurl2Files);
setReturnCode(OK);
close();
}
private void shareLibs(Map<String, File> mvnurl2Files) {
if(mvnurl2Files != null && mvnurl2Files.size() > 0) {
Job shareLibJob = new Job("") {
@Override
protected IStatus run(IProgressMonitor arg0) {
Iterator<Entry<String, File>> iterator = mvnurl2Files.entrySet().iterator();
MavenArtifactsHandler mavenArtifactsHandler = new MavenArtifactsHandler();
while(iterator.hasNext()) {
Entry<String, File> entry = iterator.next();
String mvnurl = entry.getKey();
MavenArtifact art = MavenUrlHelper.parseMvnUrl(mvnurl);
List<MavenArtifact> remoteArtifacts = null;
try {
remoteArtifacts = ConfigModuleHelper.searchRemoteArtifacts(art.getGroupId(),
art.getArtifactId(), null);
} catch (Exception e) {
ExceptionHandler.process(e);
}
if (remoteArtifacts != null && !remoteArtifacts.isEmpty()) {
if (ConfigModuleHelper.canFind(new HashSet<MavenArtifact>(remoteArtifacts), art)) {
continue;
}
}
try {
mavenArtifactsHandler.deploy(entry.getValue(), art);
} catch (Exception e) {
ExceptionHandler.process(e);
}
String generatedModuleName = MavenUrlHelper.generateModuleNameByMavenURI(mvnurl);
updateIndex(mvnurl, generatedModuleName);
}
return Status.OK_STATUS;
}
};
shareLibJob.schedule();
}
}
private Map<String, File> detectDependencies() {
Map<String, File> mvnurl2Files = new HashMap<String, File>();
if(detectDependencies) {
mvnurl2Files = ModuleMavenURIUtils.getDependencyModules(moduleFilePath, urlToUse);
mvnurl2Files.keySet().stream().forEach(mvnUrl-> {
String moduleName = MavenUrlHelper.generateModuleNameByMavenURI(mvnUrl);
moduleName2MVNUrls.put(moduleName, mvnUrl);
});
}
return mvnurl2Files;
}
@Override
public String getModuleName() {
return moduleName;
@@ -1037,10 +919,6 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
}
useCustomBtn.setSelection(false);
}
private void setDetectBtnEnabled() {
detectDepBtn.setEnabled(true);
}
private void setupMavenURIforInstall() throws Exception {
if (validateInputForInstallPre()) {
@@ -1054,32 +932,18 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
defaultUri = detectUri;
}
}
if(filePath.trim().endsWith("xml") || filePath.trim().endsWith("pom")) {
defaultUriTxt.setText("");
customUriText.setText("");
useCustomBtn.setEnabled(false);
if(allowDetectDependencies()) {
detectDepBtn.setSelection(true);
detectDepBtn.setEnabled(false);
}
} else {
defaultUriTxt.setText(defaultUri);
customUriText.setText(defaultUri);
if (!org.apache.commons.lang3.StringUtils.isEmpty(detectUri)
&& !ConfigModuleHelper.isSameUri(defaultUri, detectUri)) {
customUriText.setText(detectUri);
}
useCustomBtn.setEnabled(true);
if(allowDetectDependencies()) {
detectDepBtn.setEnabled(true);
}
defaultUriTxt.setText(defaultUri);
customUriText.setText(defaultUri);
if (!org.apache.commons.lang3.StringUtils.isEmpty(detectUri)
&& !ConfigModuleHelper.isSameUri(defaultUri, detectUri)) {
customUriText.setText(detectUri);
}
customUriText.setEnabled(false);
}
validateInputFields();
}
private void updateIndex(String urlToUse, String moduleName) {
private void updateIndex(String urlToUse) {
Set<String> modulesNeededNames = ModulesNeededProvider.getAllManagedModuleNames();
if (!modulesNeededNames.contains(moduleName)) {
@@ -1139,84 +1003,4 @@ public class ConfigModuleDialog extends TitleAreaDialog implements IConfigModule
platformComboField.setProposals(moduleValueArray);
}
private boolean allowDetectDependencies() {
return allowDetectDependencies;
}
private Map<String, String> moduleName2MVNUrls = new HashMap<String, String>();
@Override
public Map<String, String> getModulesMVNUrls() {
return moduleName2MVNUrls;
}
private String calculatePath(String mvnUrl) {
String moduleName = MavenUrlHelper.generateModuleNameByMavenURI(mvnUrl);
String filePath = null;
String librariesPath = LibrariesManagerUtils.getLibrariesPath(ECodeLanguage.JAVA);
File file = new File(librariesPath);
if(file.exists()) {
File[] list = file.listFiles((dir, name)->name.equals(moduleName));
if(list != null && list.length > 0) {
filePath = list[0].getAbsolutePath();
}
}
if(filePath == null) {
filePath = searchLocalM2(mvnUrl);
}
return filePath;
}
private String searchLocalM2(String mvnUrl) {
MavenArtifact parsedMvnArtifact = MavenUrlHelper.parseMvnUrl(mvnUrl);
String artifactPath = MavenUrlHelper.getArtifactPath(parsedMvnArtifact);
if (artifactPath == null) {
return null;
}
String filePath = null;
String LOCAL_M2 = MavenPlugin.getMaven().getLocalRepositoryPath();
if(MavenConstants.DEFAULT_LIB_GROUP_ID.equals(parsedMvnArtifact.getGroupId())) {
File m2Dir = new File(LOCAL_M2);
if (m2Dir.exists()) {
try {
String moduleName = MavenUrlHelper.generateModuleNameByMavenURI(mvnUrl);
filePath = searchWithFilename(m2Dir, moduleName);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}
if(filePath == null && new File(LOCAL_M2 + "/" + artifactPath).exists()) {
filePath = LOCAL_M2 + "/" + artifactPath;
}
return filePath;
}
private String searchWithFilename(File dir, String filename) throws Exception {
String file = null;
File[] fs = dir.listFiles();
if(fs != null) {
for (File f : fs) {
if (f.isDirectory()) {
file = searchWithFilename(f, filename);
if(file != null) {
break;
}
} else {
if (f.isFile() && f.getName().equals(filename)) {
file = f.getAbsolutePath();
break;
}
}
}
}
return file;
}
}

Some files were not shown because too many files have changed in this diff Show More