Compare commits
15 Commits
release/7.
...
release/7.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cda76045af | ||
|
|
cae9f32122 | ||
|
|
c91dd79086 | ||
|
|
f59119005e | ||
|
|
b6ca94c99c | ||
|
|
5ed5767f6a | ||
|
|
616f84c03f | ||
|
|
4bc6c7e482 | ||
|
|
53e17d9001 | ||
|
|
c36560570b | ||
|
|
7d093c2ff1 | ||
|
|
ea88e43485 | ||
|
|
9c526715b1 | ||
|
|
16c0283679 | ||
|
|
41033edd3b |
@@ -6,7 +6,6 @@
|
||||
<license url="http://www.example.com/license">[Enter License Description here.]</license>
|
||||
<plugin id="org.talend.libraries.jdbc.access" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.as400" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.derby" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.exasol" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.h2" download-size="0" install-size="0" version="0.0.0"/>
|
||||
<plugin id="org.talend.libraries.jdbc.hsql" download-size="0" install-size="0" version="0.0.0"/>
|
||||
|
||||
@@ -111,7 +111,8 @@ public class CommonsPlugin implements BundleActivator {
|
||||
}
|
||||
|
||||
public static boolean isDebugMode() {
|
||||
return ArrayUtils.contains(Platform.getApplicationArgs(), TalendDebugHandler.TALEND_DEBUG);
|
||||
return Boolean.getBoolean("talendDebug") //$NON-NLS-1$
|
||||
|| ArrayUtils.contains(Platform.getApplicationArgs(), TalendDebugHandler.TALEND_DEBUG);
|
||||
}
|
||||
|
||||
public static boolean isJUnitTest() {
|
||||
|
||||
@@ -186,8 +186,7 @@ public class UpdatesHelper {
|
||||
}
|
||||
|
||||
private static void findUpdateBaseFile(Set<File> foundUpdateFiles, File baseFile) {
|
||||
if (isPlainUpdate(baseFile)
|
||||
|| isUpdateSite(baseFile) && !isComponentUpdateSite(baseFile)) {
|
||||
if (isPlainUpdate(baseFile) || isUpdateSite(baseFile)) {
|
||||
foundUpdateFiles.add(baseFile);
|
||||
} else if (baseFile.isDirectory()) {
|
||||
final File[] listFiles = baseFile.listFiles();
|
||||
|
||||
@@ -281,7 +281,8 @@ public class RecycleBinManager {
|
||||
resource = createRecycleBinResource(project);
|
||||
}
|
||||
resource.getContents().clear();
|
||||
recycleBin.setLastUpdate(new Date());
|
||||
// set date to null to avoid timezone conflict
|
||||
recycleBin.setLastUpdate(null);
|
||||
resource.getContents().add(recycleBin);
|
||||
EmfHelper.saveResource(resource);
|
||||
lastSavedRecycleBinMap.put(recycleBin, EcoreUtil.copy(recycleBin));
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<dbType type="SET" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TEXT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TIME" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="false" />
|
||||
<dbType type="TINYBLOB" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TINYINT" ignorePre="true" />
|
||||
<dbType type="TINYINT UNSIGNED" ignoreLen="true" ignorePre="true" />
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2020 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.model.process;
|
||||
|
||||
/**
|
||||
* DOC cmeng class global comment. Detailled comment
|
||||
*/
|
||||
public abstract class AbsJobletReplaceNodeHandler extends AbsReplaceNodeHandler implements IJobletReplaceNodeHandler {
|
||||
|
||||
public AbsJobletReplaceNodeHandler(String prefix) {
|
||||
super();
|
||||
this.setPrefix(prefix);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2020 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.model.process;
|
||||
|
||||
/**
|
||||
* DOC cmeng class global comment. Detailled comment
|
||||
*/
|
||||
public abstract class AbsReplaceNodeHandler implements IReplaceNodeHandler {
|
||||
|
||||
private String prefix;
|
||||
|
||||
@Override
|
||||
public String getPrefix() {
|
||||
return prefix;
|
||||
}
|
||||
|
||||
public void setPrefix(String prefix) {
|
||||
this.prefix = prefix;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -122,6 +122,8 @@ public abstract class AbstractNode implements INode {
|
||||
// for MR, tag this component is the ref(lookup) start node
|
||||
private boolean isRefNode = false;
|
||||
|
||||
private IReplaceNodeHandler replaceNodeHandler;
|
||||
|
||||
public String getComponentName() {
|
||||
return componentName;
|
||||
}
|
||||
@@ -1322,6 +1324,15 @@ public abstract class AbstractNode implements INode {
|
||||
return componentProperties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IReplaceNodeHandler getReplaceNodeHandler() {
|
||||
return replaceNodeHandler;
|
||||
}
|
||||
|
||||
public void setReplaceNodeHandler(IReplaceNodeHandler replaceNodeHandler) {
|
||||
this.replaceNodeHandler = replaceNodeHandler;
|
||||
}
|
||||
|
||||
public INode getRealGraphicalNode() {
|
||||
return realGraphicalNode;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2020 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.model.process;
|
||||
|
||||
/**
|
||||
* DOC cmeng class global comment. Detailled comment
|
||||
*/
|
||||
public interface IJobletReplaceNodeHandler extends IReplaceNodeHandler {
|
||||
|
||||
}
|
||||
@@ -312,6 +312,10 @@ public interface INode extends IElement {
|
||||
|
||||
public boolean isSubtreeStart();
|
||||
|
||||
default public IReplaceNodeHandler getReplaceNodeHandler() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setComponentProperties(ComponentProperties props);
|
||||
|
||||
public ComponentProperties getComponentProperties();
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2020 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.model.process;
|
||||
|
||||
/**
|
||||
* DOC cmeng class global comment. Detailled comment
|
||||
*/
|
||||
public interface IReplaceNodeHandler {
|
||||
|
||||
String getPrefix();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2020 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.model.process;
|
||||
|
||||
|
||||
/**
|
||||
* DOC cmeng class global comment. Detailled comment
|
||||
*/
|
||||
public class JobletReplaceNodeHandler extends AbsJobletReplaceNodeHandler {
|
||||
|
||||
public JobletReplaceNodeHandler(String prefix) {
|
||||
super(prefix);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -44,6 +44,8 @@ public interface MavenConstants {
|
||||
|
||||
static final String USE_PROFILE_MODULE = "USE_PROFILE_MODULE";
|
||||
|
||||
static final String EXCLUDE_DELETED_ITEMS = "EXCLUDE_DELETED_ITEMS";
|
||||
|
||||
/*
|
||||
* for lib
|
||||
*/
|
||||
|
||||
@@ -246,6 +246,8 @@ public interface IRunProcessService extends IService {
|
||||
|
||||
public boolean isCIMode();
|
||||
|
||||
public boolean isExcludeDeletedItems(Property property);
|
||||
|
||||
public static IRunProcessService get() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
return GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
|
||||
|
||||
@@ -116,6 +116,7 @@ import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
|
||||
import org.talend.core.runtime.repository.build.BuildExportManager;
|
||||
import org.talend.core.service.IResourcesDependenciesService;
|
||||
import org.talend.core.services.ICoreTisService;
|
||||
import org.talend.core.services.IGITProviderService;
|
||||
import org.talend.core.services.ISVNProviderService;
|
||||
import org.talend.core.ui.IJobletProviderService;
|
||||
import org.talend.core.ui.ITestContainerProviderService;
|
||||
@@ -1559,6 +1560,10 @@ public class ProcessorUtilities {
|
||||
List<ProcessItem> testsItems =
|
||||
testContainerService.getTestContainersByVersion(jobInfo.getProcessItem());
|
||||
for (ProcessItem testItem : testsItems) {
|
||||
if (testItem.getProperty().getItem().getState().isDeleted()
|
||||
&& IRunProcessService.get().isExcludeDeletedItems(testItem.getProperty())) {
|
||||
continue;
|
||||
}
|
||||
JobInfo subJobInfo = new JobInfo(testItem, testItem.getProcess().getDefaultContext());
|
||||
subJobInfo.setTestContainer(true);
|
||||
subJobInfo.setFatherJobInfo(jobInfo);
|
||||
@@ -1937,6 +1942,38 @@ public class ProcessorUtilities {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static boolean isRemoteProject() {
|
||||
ISVNProviderService svnService = null;
|
||||
if (PluginChecker.isSVNProviderPluginLoaded()) {
|
||||
svnService = GlobalServiceRegister.getDefault().getService(ISVNProviderService.class);
|
||||
}
|
||||
|
||||
|
||||
IGITProviderService gitService = null;
|
||||
if (PluginChecker.isGITProviderPluginLoaded()) {
|
||||
gitService = GlobalServiceRegister.getDefault().getService(IGITProviderService.class);
|
||||
}
|
||||
|
||||
if ((svnService != null && svnService.isProjectInSvnMode()) || (gitService != null && gitService.isProjectInGitMode()) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void updateCodeSources() throws ProcessorException {
|
||||
if (isRemoteProject()) {
|
||||
// TESB-29071
|
||||
try {
|
||||
ProxyRepositoryFactory.getInstance().initialize();
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
RepositoryManager.syncRoutineAndJoblet(ERepositoryObjectType.ROUTINES);
|
||||
RepositoryManager.syncRoutineAndJoblet(ERepositoryObjectType.BEANS);
|
||||
}
|
||||
}
|
||||
|
||||
public static IProcessor generateCode(ProcessItem process, String contextName, boolean statistics, boolean trace)
|
||||
throws ProcessorException {
|
||||
@@ -1953,13 +1990,7 @@ public class ProcessorUtilities {
|
||||
|
||||
public static IProcessor generateCode(IProcess process, IContext context, boolean statistics, boolean trace,
|
||||
boolean contextProperties, boolean applyToChildren) throws ProcessorException {
|
||||
ISVNProviderService service = null;
|
||||
if (PluginChecker.isSVNProviderPluginLoaded()) {
|
||||
service = GlobalServiceRegister.getDefault().getService(ISVNProviderService.class);
|
||||
}
|
||||
if (service != null && service.isProjectInSvnMode()) {
|
||||
RepositoryManager.syncRoutineAndJoblet(ERepositoryObjectType.ROUTINES);
|
||||
}
|
||||
updateCodeSources();
|
||||
// achen modify to fix 0006107
|
||||
ProcessItem pItem = null;
|
||||
|
||||
@@ -2003,14 +2034,7 @@ public class ProcessorUtilities {
|
||||
|
||||
public static IProcessor generateCode(IProcess process, IContext context, boolean statistics, boolean trace,
|
||||
boolean properties, IProgressMonitor progressMonitor) throws ProcessorException {
|
||||
// added by nma, to refresh routines when generating code in SVN mode. 10225.
|
||||
ISVNProviderService service = null;
|
||||
if (PluginChecker.isSVNProviderPluginLoaded()) {
|
||||
service = GlobalServiceRegister.getDefault().getService(ISVNProviderService.class);
|
||||
}
|
||||
if (service != null && service.isProjectInSvnMode()) {
|
||||
RepositoryManager.syncRoutineAndJoblet(ERepositoryObjectType.ROUTINES);
|
||||
}
|
||||
updateCodeSources();
|
||||
// achen modify to fix 0006107
|
||||
ProcessItem pItem = null;
|
||||
|
||||
@@ -2040,13 +2064,7 @@ public class ProcessorUtilities {
|
||||
public static IProcessor generateCode(IProcessor processor, IProcess process, IContext context, boolean statistics,
|
||||
boolean trace, boolean properties, IProgressMonitor progressMonitor) throws ProcessorException {
|
||||
|
||||
ISVNProviderService service = null;
|
||||
if (PluginChecker.isSVNProviderPluginLoaded()) {
|
||||
service = GlobalServiceRegister.getDefault().getService(ISVNProviderService.class);
|
||||
}
|
||||
if (service != null && service.isProjectInSvnMode()) {
|
||||
RepositoryManager.syncRoutineAndJoblet(ERepositoryObjectType.ROUTINES);
|
||||
}
|
||||
updateCodeSources();
|
||||
|
||||
CorePlugin.getDefault().getRunProcessService().buildCodesJavaProject(progressMonitor);
|
||||
|
||||
@@ -2096,14 +2114,7 @@ public class ProcessorUtilities {
|
||||
|
||||
public static IProcessor generateCode(IProcess process, IContext context, boolean statistics, boolean trace,
|
||||
boolean properties, int option) throws ProcessorException {
|
||||
// added by nma, to refresh routines when generating code in SVN mode. 10225.
|
||||
ISVNProviderService service = null;
|
||||
if (PluginChecker.isSVNProviderPluginLoaded()) {
|
||||
service = GlobalServiceRegister.getDefault().getService(ISVNProviderService.class);
|
||||
}
|
||||
if (service != null && service.isProjectInSvnMode()) {
|
||||
RepositoryManager.syncRoutineAndJoblet(ERepositoryObjectType.ROUTINES);
|
||||
}
|
||||
updateCodeSources();
|
||||
// achen modify to fix 0006107
|
||||
JobInfo jobInfo = new JobInfo(process, context);
|
||||
jobList.clear();
|
||||
|
||||
@@ -12,4 +12,6 @@ ProjectPomProjectSettingPage_FilterErrorMessage=Invalid filter: {0}
|
||||
ProjectPomProjectSettingPage.syncAllPomsButtonText=Force full re-synchronize poms
|
||||
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=> Generate only the job named "myJob" with version 0.2\n!((label=myJob)and(version=0.1)) \t=> Generate every jobs except the "myJob" version 0.1
|
||||
MavenProjectSettingPage.refModuleText=Set reference project modules in profile
|
||||
MavenProjectSettingPage.refModuleText=Set reference project modules in profile
|
||||
MavenProjectSettingPage.excludeDeletedItems=Exclude deleted items
|
||||
MavenProjectSettingPage.syncAllPomsWarning=Click the Force full re-synchronize poms button to apply the new settings.
|
||||
@@ -32,6 +32,7 @@ import org.talend.designer.maven.template.AbstractMavenTemplateManager;
|
||||
import org.talend.designer.maven.template.MavenTemplateManager;
|
||||
import org.talend.designer.maven.tools.extension.PomExtensionRegistry;
|
||||
import org.talend.designer.maven.ui.DesignerMavenUiPlugin;
|
||||
import org.talend.designer.maven.utils.PomUtil;
|
||||
|
||||
/**
|
||||
* DOC ggu class global comment. Detailled comment
|
||||
@@ -68,6 +69,7 @@ public class MavenScriptsProjectSettingInitializer extends AbstractProjectPrefer
|
||||
Model model = MavenPlugin.getMavenModelManager().readMavenModel(stream);
|
||||
PomExtensionRegistry.getInstance().updatePomTemplate(model);
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
PomUtil.sortModules(model);
|
||||
MavenPlugin.getMaven().writeModel(model, out);
|
||||
String content = out.toString(TalendMavenConstants.DEFAULT_ENCODING);
|
||||
if (content != null) {
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.ui.forms.IMessage;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.PluginChecker;
|
||||
@@ -52,6 +53,8 @@ public class MavenProjectSettingPage extends AbstractProjectSettingPage {
|
||||
|
||||
private Button useProfileModuleCheckbox;
|
||||
|
||||
private Button excludeDeletedItemsCheckbox;
|
||||
|
||||
public MavenProjectSettingPage() {
|
||||
noDefaultAndApplyButton();
|
||||
}
|
||||
@@ -89,12 +92,31 @@ public class MavenProjectSettingPage extends AbstractProjectSettingPage {
|
||||
useProfileModuleCheckbox = new Button(parent, SWT.CHECK);
|
||||
useProfileModuleCheckbox.setText(Messages.getString("MavenProjectSettingPage.refModuleText")); //$NON-NLS-1$
|
||||
useProfileModuleCheckbox.setSelection(preferenceStore.getBoolean(MavenConstants.USE_PROFILE_MODULE));
|
||||
useProfileModuleCheckbox.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
addSyncWarning();
|
||||
}
|
||||
});
|
||||
|
||||
excludeDeletedItemsCheckbox = new Button(parent, SWT.CHECK);
|
||||
excludeDeletedItemsCheckbox.setText(Messages.getString("MavenProjectSettingPage.excludeDeletedItems")); //$NON-NLS-1$
|
||||
excludeDeletedItemsCheckbox.setSelection(preferenceStore.getBoolean(MavenConstants.EXCLUDE_DELETED_ITEMS));
|
||||
excludeDeletedItemsCheckbox.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
addSyncWarning();
|
||||
}
|
||||
});
|
||||
|
||||
filterText.setText(filter);
|
||||
filterText.addModifyListener(new ModifyListener() {
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
addSyncWarning();
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IFilterService.class)) {
|
||||
IFilterService service = (IFilterService) GlobalServiceRegister.getDefault()
|
||||
.getService(IFilterService.class);
|
||||
@@ -122,6 +144,7 @@ public class MavenProjectSettingPage extends AbstractProjectSettingPage {
|
||||
try {
|
||||
preferenceStore.setValue(MavenConstants.POM_FILTER, getRealVersionFilter(filter));
|
||||
preferenceStore.setValue(MavenConstants.USE_PROFILE_MODULE, useProfileModuleCheckbox.getSelection());
|
||||
preferenceStore.setValue(MavenConstants.EXCLUDE_DELETED_ITEMS, excludeDeletedItemsCheckbox.getSelection());
|
||||
new AggregatorPomsHelper().syncAllPoms();
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
@@ -135,12 +158,17 @@ public class MavenProjectSettingPage extends AbstractProjectSettingPage {
|
||||
|
||||
}
|
||||
|
||||
private void addSyncWarning() {
|
||||
setMessage(Messages.getString("MavenProjectSettingPage.syncAllPomsWarning"), IMessage.WARNING); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean performOk() {
|
||||
boolean ok = super.performOk();
|
||||
if (preferenceStore != null) {
|
||||
preferenceStore.setValue(MavenConstants.POM_FILTER, getRealVersionFilter(filter));
|
||||
preferenceStore.setValue(MavenConstants.USE_PROFILE_MODULE, useProfileModuleCheckbox.getSelection());
|
||||
preferenceStore.setValue(MavenConstants.EXCLUDE_DELETED_ITEMS, excludeDeletedItemsCheckbox.getSelection());
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
@@ -810,6 +810,9 @@ public class AggregatorPomsHelper {
|
||||
}
|
||||
}
|
||||
if (object.getProperty() != null && object.getProperty().getItem() != null) {
|
||||
if (object.isDeleted() && PomIdsHelper.getIfExcludeDeletedItems()) {
|
||||
continue;
|
||||
}
|
||||
Item item = object.getProperty().getItem();
|
||||
if (ProjectManager.getInstance().isInCurrentMainProject(item)) {
|
||||
monitor.subTask("Synchronize job pom: " + item.getProperty().getLabel() //$NON-NLS-1$
|
||||
|
||||
@@ -266,6 +266,18 @@ public class PomIdsHelper {
|
||||
return manager.getBoolean(MavenConstants.USE_PROFILE_MODULE);
|
||||
}
|
||||
|
||||
public static boolean getIfExcludeDeletedItems() {
|
||||
String projectTechName = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel();
|
||||
ProjectPreferenceManager manager = getPreferenceManager(projectTechName);
|
||||
return manager.getBoolean(MavenConstants.EXCLUDE_DELETED_ITEMS);
|
||||
}
|
||||
|
||||
public static boolean getIfExcludeDeletedItems(Property property) {
|
||||
String projectTechName = ProjectManager.getInstance().getProject(property).getTechnicalLabel();
|
||||
ProjectPreferenceManager manager = getPreferenceManager(projectTechName);
|
||||
return manager.getBoolean(MavenConstants.EXCLUDE_DELETED_ITEMS);
|
||||
}
|
||||
|
||||
private static String getGroupId(String projectTechName, String baseName, Property property) {
|
||||
if (projectTechName == null) {
|
||||
projectTechName = ProjectManager.getInstance().getCurrentProject().getTechnicalLabel();
|
||||
@@ -330,6 +342,12 @@ public class PomIdsHelper {
|
||||
if (preferenceStore.getString(MavenConstants.POM_FILTER) == null) {
|
||||
preferenceStore.setValue(MavenConstants.POM_FILTER, "");
|
||||
}
|
||||
|
||||
if (!preferenceManager.exist()
|
||||
&& StringUtils.isBlank(preferenceStore.getString(MavenConstants.EXCLUDE_DELETED_ITEMS))) {
|
||||
// for new project, set EXCLUDE_DELETED_ITEMS=true as default
|
||||
preferenceStore.setValue(MavenConstants.EXCLUDE_DELETED_ITEMS, true);
|
||||
}
|
||||
preferenceManager.save();
|
||||
preferenceManagers.put(projectTechName, preferenceManager);
|
||||
return preferenceManager;
|
||||
|
||||
@@ -30,6 +30,7 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
@@ -140,6 +141,7 @@ public class PomUtil {
|
||||
* copied the codes from createMavenModel of MavenModelManager
|
||||
*/
|
||||
ByteArrayOutputStream buf = new ByteArrayOutputStream();
|
||||
sortModules(model);
|
||||
MavenPlugin.getMaven().writeModel(model, buf);
|
||||
|
||||
ByteArrayInputStream source = new ByteArrayInputStream(buf.toByteArray());
|
||||
@@ -161,6 +163,7 @@ public class PomUtil {
|
||||
properties.putAll(model.getProperties());
|
||||
model.setProperties(properties);
|
||||
ByteArrayOutputStream buf = new ByteArrayOutputStream();
|
||||
sortModules(model);
|
||||
MavenPlugin.getMaven().writeModel(model, buf);
|
||||
|
||||
ByteArrayInputStream source = new ByteArrayInputStream(buf.toByteArray());
|
||||
@@ -182,6 +185,17 @@ public class PomUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static void sortModules(Model model) {
|
||||
if (model != null) {
|
||||
List<String> modules = model.getModules();
|
||||
if (modules != null && !modules.isEmpty()) {
|
||||
List<String> sortedModules = new LinkedList<>(modules);
|
||||
Collections.sort(sortedModules);
|
||||
model.setModules(sortedModules);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void safeClose(Closeable stream) {
|
||||
try {
|
||||
if (stream != null) {
|
||||
@@ -669,7 +683,9 @@ public class PomUtil {
|
||||
File pomFile = new File(baseFolder, TalendMavenConstants.POM_FILE_NAME);
|
||||
|
||||
ByteArrayOutputStream buf = new ByteArrayOutputStream();
|
||||
MavenPlugin.getMaven().writeModel(createModel(artifact), buf);
|
||||
Model model = createModel(artifact);
|
||||
sortModules(model);
|
||||
MavenPlugin.getMaven().writeModel(model, buf);
|
||||
|
||||
DocumentBuilderFactory documentBuilderFactory = XmlUtils.getSecureDocumentBuilderFactory();
|
||||
documentBuilderFactory.setNamespaceAware(false);
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.talend.libraries.jdbc.derby</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -1,7 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Derby
|
||||
Bundle-SymbolicName: org.talend.libraries.jdbc.derby
|
||||
Bundle-Version: 7.4.1.qualifier
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Eclipse-BundleShape: dir
|
||||
@@ -1 +0,0 @@
|
||||
jarprocessor.exclude.children=true
|
||||
@@ -1,3 +0,0 @@
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
lib/
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,12 +0,0 @@
|
||||
<?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>7.4.1-SNAPSHOT</version>
|
||||
<relativePath>../../../</relativePath>
|
||||
</parent>
|
||||
<artifactId>org.talend.libraries.jdbc.derby</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
@@ -83,7 +83,7 @@
|
||||
<systemRoutine
|
||||
name="Document">
|
||||
<library
|
||||
name="dom4j-2.1.1.jar">
|
||||
name="dom4j-2.1.3.jar">
|
||||
<bundleId
|
||||
bundleId="org.apache.servicemix.bundles.dom4j">
|
||||
</bundleId>
|
||||
@@ -92,7 +92,7 @@
|
||||
<systemRoutine
|
||||
name="DocumentHelper">
|
||||
<library
|
||||
name="dom4j-2.1.1.jar">
|
||||
name="dom4j-2.1.3.jar">
|
||||
<bundleId
|
||||
bundleId="org.apache.servicemix.bundles.dom4j">
|
||||
</bundleId>
|
||||
@@ -101,7 +101,7 @@
|
||||
<systemRoutine
|
||||
name="DocumentToFlat">
|
||||
<library
|
||||
name="dom4j-2.1.1.jar">
|
||||
name="dom4j-2.1.3.jar">
|
||||
<bundleId
|
||||
bundleId="org.apache.servicemix.bundles.dom4j">
|
||||
</bundleId>
|
||||
@@ -110,7 +110,7 @@
|
||||
<systemRoutine
|
||||
name="NameSpaceTool">
|
||||
<library
|
||||
name="dom4j-2.1.1.jar">
|
||||
name="dom4j-2.1.3.jar">
|
||||
<bundleId
|
||||
bundleId="org.apache.servicemix.bundles.dom4j">
|
||||
</bundleId>
|
||||
@@ -119,7 +119,7 @@
|
||||
<systemRoutine
|
||||
name="ParserUtils">
|
||||
<library
|
||||
name="dom4j-2.1.1.jar">
|
||||
name="dom4j-2.1.3.jar">
|
||||
<bundleId
|
||||
bundleId="org.apache.servicemix.bundles.dom4j">
|
||||
</bundleId>
|
||||
@@ -128,7 +128,7 @@
|
||||
<systemRoutine
|
||||
name="TalendMDMJob">
|
||||
<library
|
||||
name="dom4j-2.1.1.jar">
|
||||
name="dom4j-2.1.3.jar">
|
||||
<bundleId
|
||||
bundleId="org.apache.servicemix.bundles.dom4j">
|
||||
</bundleId>
|
||||
|
||||
@@ -40,9 +40,7 @@ import org.eclipse.ui.PlatformUI;
|
||||
import org.osgi.service.prefs.BackingStoreException;
|
||||
import org.osgi.service.prefs.Preferences;
|
||||
import org.talend.commons.exception.BusinessException;
|
||||
import org.talend.commons.runtime.helper.LocalComponentInstallHelper;
|
||||
import org.talend.commons.runtime.helper.PatchComponentHelper;
|
||||
import org.talend.commons.runtime.service.ComponentsInstallComponent;
|
||||
import org.talend.commons.runtime.service.PatchComponent;
|
||||
import org.talend.commons.ui.runtime.update.PreferenceKeys;
|
||||
import org.talend.commons.ui.swt.dialogs.ErrorDialogWidthDetailArea;
|
||||
@@ -191,29 +189,6 @@ public class Application implements IApplication {
|
||||
}
|
||||
}
|
||||
|
||||
final ComponentsInstallComponent installComponent = LocalComponentInstallHelper.getComponent();
|
||||
if (installComponent != null) {
|
||||
try {
|
||||
// install component silently
|
||||
installComponent.setLogin(true);
|
||||
if (installComponent.install()) {
|
||||
final String installedMessages = installComponent.getInstalledMessages();
|
||||
if (installedMessages != null) {
|
||||
log.log(Level.INFO, installedMessages);
|
||||
MessageDialog.openInformation(Display.getDefault().getActiveShell(), "Installing Components",
|
||||
installedMessages);
|
||||
}
|
||||
if (installComponent.needRelaunch()) {
|
||||
needRelaunch = true;
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(installComponent.getFailureMessage())) {
|
||||
log.log(Level.ERROR, installComponent.getFailureMessage());
|
||||
}
|
||||
} finally {
|
||||
installComponent.setLogin(false);
|
||||
}
|
||||
}
|
||||
if (needRelaunch) {
|
||||
setRelaunchData();
|
||||
return IApplication.EXIT_RELAUNCH;
|
||||
|
||||
@@ -28,6 +28,7 @@ import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -907,6 +908,14 @@ public class LocalRepositoryFactory extends AbstractEMFRepositoryFactory impleme
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Avoid conflicts between different timezone
|
||||
*/
|
||||
Optional.ofNullable(project).map(p -> p.getEmfProject()).ifPresent(p -> {
|
||||
p.setCreationDate(null);
|
||||
p.setDeleteDate(null);
|
||||
});
|
||||
|
||||
xmiResourceManager.saveResource(projectResource);
|
||||
project.getEmfProject().getMigrationTask().addAll(realMigrationTaskList);
|
||||
|
||||
|
||||
@@ -45,8 +45,6 @@ import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.SashForm;
|
||||
import org.eclipse.swt.custom.ScrolledComposite;
|
||||
import org.eclipse.swt.events.ControlAdapter;
|
||||
import org.eclipse.swt.events.ControlEvent;
|
||||
import org.eclipse.swt.events.FocusEvent;
|
||||
import org.eclipse.swt.events.FocusListener;
|
||||
import org.eclipse.swt.events.KeyAdapter;
|
||||
@@ -905,13 +903,6 @@ public class DatabaseForm extends AbstractForm {
|
||||
|
||||
addCheckAndStandardButtons(width, compositeGroupDbSettings);
|
||||
|
||||
scrolledComposite.addControlListener(new ControlAdapter() {
|
||||
|
||||
@Override
|
||||
public void controlResized(ControlEvent e) {
|
||||
scrolledComposite.setMinSize(newParent.computeSize(SWT.DEFAULT, SWT.DEFAULT));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -13,14 +13,24 @@
|
||||
package org.talend.updates.runtime.maven;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.maven.model.Model;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.m2e.core.MavenPlugin;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.core.nexus.ArtifactRepositoryBean;
|
||||
import org.talend.core.nexus.IRepositoryArtifactHandler;
|
||||
import org.talend.core.nexus.RepositoryArtifactHandlerManager;
|
||||
import org.talend.core.nexus.TalendLibsServerManager;
|
||||
import org.talend.core.runtime.maven.MavenArtifact;
|
||||
import org.talend.core.runtime.maven.MavenUrlHelper;
|
||||
import org.talend.designer.maven.model.TalendMavenConstants;
|
||||
@@ -41,6 +51,8 @@ public class MavenRepoSynchronizer {
|
||||
|
||||
private boolean deployToRemote;
|
||||
|
||||
private static final String POM_EXT = '.' + TalendMavenConstants.PACKAGING_POM;
|
||||
|
||||
public MavenRepoSynchronizer(File sourceM2Root, boolean deployToRemote) {
|
||||
super();
|
||||
this.sourceM2Root = sourceM2Root;
|
||||
@@ -60,75 +72,200 @@ public class MavenRepoSynchronizer {
|
||||
}
|
||||
|
||||
protected void installM2RepositoryLibs(File parentFolder) {
|
||||
if (parentFolder != null && parentFolder.exists() && parentFolder.isDirectory()) {
|
||||
final File[] allFiles = parentFolder.listFiles();
|
||||
if (allFiles == null) {
|
||||
return;
|
||||
}
|
||||
List<File> pomFiles = new ArrayList<File>();
|
||||
List<File> subFiles = new ArrayList<File>();
|
||||
final String pomExt = '.' + TalendMavenConstants.PACKAGING_POM;
|
||||
for (File file : allFiles) {
|
||||
if (file.isDirectory()) {
|
||||
subFiles.add(file);
|
||||
} else if (file.isFile()) {
|
||||
if (file.getName().endsWith(pomExt)) {
|
||||
pomFiles.add(file);
|
||||
}
|
||||
|
||||
Set<File> allPomFiles = new HashSet<File>();
|
||||
|
||||
getAllPomFiles(allPomFiles, parentFolder);
|
||||
|
||||
Set<File> deployedPomFiles = getDeployedPomFiles(allPomFiles);
|
||||
|
||||
for (File pomFile : allPomFiles) {
|
||||
try {
|
||||
ExtendedMavenArtifact artifact = parseArtifact(pomFile);
|
||||
if (artifact == null || artifact.getArtifact() == null) {
|
||||
Exception e = new RuntimeException("Can not parse artifact from pomFile: " + pomFile);
|
||||
ExceptionHandler.process(e);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
for (File pomFile : pomFiles) {
|
||||
try {
|
||||
Model model = MavenPlugin.getMaven().readModel(pomFile);
|
||||
String packaging = model.getPackaging();
|
||||
if (packaging == null) {
|
||||
packaging = TalendMavenConstants.PACKAGING_JAR;
|
||||
}
|
||||
boolean isMavenPlugin = packaging.equals("maven-plugin"); //$NON-NLS-1$
|
||||
// use jar instead
|
||||
if (packaging.equals("bundle") || isMavenPlugin) { //$NON-NLS-1$
|
||||
packaging = TalendMavenConstants.PACKAGING_JAR;
|
||||
}
|
||||
final String groupId = (model.getGroupId() != null ? model.getGroupId() : model.getParent().getGroupId());
|
||||
final String artifactId = model.getArtifactId();
|
||||
final String version = (model.getVersion() != null ? model.getVersion() : model.getParent().getVersion());
|
||||
|
||||
final String mvnUrl = MavenUrlHelper.generateMvnUrl(groupId, artifactId, version, packaging, null);
|
||||
IPath libPath = new Path(pomFile.getAbsolutePath()).removeFileExtension()
|
||||
.addFileExtension(artifact.getArtifact().getType());
|
||||
final File libFile = libPath.toFile();
|
||||
if (libFile.exists()) {
|
||||
final File tempFolder = FileUtils.createTmpFolder("generate", "pom"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
try {
|
||||
|
||||
IPath libPath = new Path(pomFile.getAbsolutePath()).removeFileExtension().addFileExtension(packaging);
|
||||
final File libFile = libPath.toFile();
|
||||
if (libFile.exists()) {
|
||||
final File tempFolder = FileUtils.createTmpFolder("generate", "pom"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
try {
|
||||
MavenArtifact artifact = MavenUrlHelper.parseMvnUrl(mvnUrl);
|
||||
final String jarPath = libFile.getAbsolutePath();
|
||||
|
||||
final String jarPath = libFile.getAbsolutePath();
|
||||
|
||||
// final String pomPath=pomFile.getAbsolutePath();
|
||||
// TUP-17785, make sure generate new one always without any dependences, so null
|
||||
String pomPath;
|
||||
if (isMavenPlugin) {
|
||||
// use original pom to keep dependencies for maven plugins
|
||||
pomPath = pomFile.getAbsolutePath();
|
||||
} else {
|
||||
pomPath = PomUtil.generatePomInFolder(tempFolder, artifact);
|
||||
}
|
||||
deployer.install(mvnUrl, jarPath, pomPath, deployToRemote);
|
||||
} finally {
|
||||
if (tempFolder.exists()) {
|
||||
FilesUtils.deleteFolder(tempFolder, true);
|
||||
}
|
||||
// final String pomPath=pomFile.getAbsolutePath();
|
||||
// TUP-17785, make sure generate new one always without any dependences, so null
|
||||
String pomPath;
|
||||
if (artifact.isMavenPlugin()) {
|
||||
// use original pom to keep dependencies for maven plugins
|
||||
pomPath = pomFile.getAbsolutePath();
|
||||
} else {
|
||||
pomPath = PomUtil.generatePomInFolder(tempFolder, artifact.getArtifact());
|
||||
}
|
||||
boolean deploy = deployToRemote;
|
||||
if (deployedPomFiles.contains(pomFile)) {
|
||||
deploy = false;
|
||||
}
|
||||
deployer.install(artifact.getMvnUrl(), jarPath, pomPath, deploy);
|
||||
} finally {
|
||||
if (tempFolder.exists()) {
|
||||
FilesUtils.deleteFolder(tempFolder, true);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
// children folders
|
||||
for (File subFolder : subFiles) {
|
||||
installM2RepositoryLibs(subFolder);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void getAllPomFiles(Set<File> allPomsFiles, File parentFolder) {
|
||||
if (parentFolder != null && parentFolder.exists() && parentFolder.isDirectory()) {
|
||||
File[] allFiles = parentFolder.listFiles();
|
||||
if (allFiles == null || allFiles.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (File file : allFiles) {
|
||||
if (file.isDirectory()) {
|
||||
getAllPomFiles(allPomsFiles, file);
|
||||
} else if (file.isFile()) {
|
||||
if (file.getName().endsWith(POM_EXT)) {
|
||||
allPomsFiles.add(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static ExtendedMavenArtifact parseArtifact(File pomFile) {
|
||||
try {
|
||||
Model model = MavenPlugin.getMaven().readModel(pomFile);
|
||||
String packaging = model.getPackaging();
|
||||
if (packaging == null) {
|
||||
packaging = TalendMavenConstants.PACKAGING_JAR;
|
||||
}
|
||||
boolean isMavenPlugin = packaging.equals("maven-plugin"); //$NON-NLS-1$
|
||||
// use jar instead
|
||||
if (packaging.equals("bundle") || isMavenPlugin) { //$NON-NLS-1$
|
||||
packaging = TalendMavenConstants.PACKAGING_JAR;
|
||||
}
|
||||
final String groupId = (model.getGroupId() != null ? model.getGroupId() : model.getParent().getGroupId());
|
||||
final String artifactId = model.getArtifactId();
|
||||
final String version = (model.getVersion() != null ? model.getVersion() : model.getParent().getVersion());
|
||||
|
||||
final String mvnUrl = MavenUrlHelper.generateMvnUrl(groupId, artifactId, version, packaging, null);
|
||||
MavenArtifact artifact = MavenUrlHelper.parseMvnUrl(mvnUrl);
|
||||
return new ExtendedMavenArtifact(mvnUrl, artifact, isMavenPlugin);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Set<File> getDeployedPomFiles(Set<File> allPomFiles) {
|
||||
Set<File> ret = new HashSet<File>();
|
||||
|
||||
Map<MavenArtifact, File> artifact2Poms = new HashMap<MavenArtifact, File>();
|
||||
Set<String> releaseGroupIds = new HashSet<String>();
|
||||
Set<String> snapshotGroupIds = new HashSet<String>();
|
||||
for (File pomFile : allPomFiles) {
|
||||
ExtendedMavenArtifact eart = parseArtifact(pomFile);
|
||||
|
||||
if (eart != null && eart.getArtifact() != null) {
|
||||
MavenArtifact art = eart.getArtifact();
|
||||
artifact2Poms.put(art, pomFile);
|
||||
if (art.getVersion() != null && art.getVersion().toUpperCase().endsWith(MavenUrlHelper.VERSION_SNAPSHOT)) {
|
||||
if (art.getGroupId() != null) {
|
||||
snapshotGroupIds.add(art.getGroupId());
|
||||
}
|
||||
} else {
|
||||
if (art.getGroupId() != null) {
|
||||
releaseGroupIds.add(art.getGroupId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Set<MavenArtifact> deployedArts = new HashSet<MavenArtifact>();
|
||||
// search release repository of remote artifactory server
|
||||
ArtifactRepositoryBean artifactServer = TalendLibsServerManager.getInstance().getCustomNexusServer();
|
||||
IRepositoryArtifactHandler artifactHandler = RepositoryArtifactHandlerManager.getRepositoryHandler(artifactServer);
|
||||
if (artifactHandler != null) {
|
||||
try {
|
||||
for (String gid : releaseGroupIds) {
|
||||
List<MavenArtifact> searchResults = artifactHandler.search(gid, null, null, true, false);
|
||||
if (searchResults != null && !searchResults.isEmpty()) {
|
||||
deployedArts.addAll(searchResults);
|
||||
}
|
||||
}
|
||||
for (String gid : snapshotGroupIds) {
|
||||
List<MavenArtifact> searchResults = artifactHandler.search(gid, null, null, false, true);
|
||||
if (searchResults != null && !searchResults.isEmpty()) {
|
||||
deployedArts.addAll(searchResults);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
// check sha1
|
||||
for (MavenArtifact art : deployedArts) {
|
||||
File pomFile = artifact2Poms.get(art);
|
||||
if (pomFile != null) {
|
||||
IPath libPath = new Path(pomFile.getAbsolutePath()).removeFileExtension().addFileExtension(art.getType());
|
||||
final File libFile = libPath.toFile();
|
||||
if (libFile.exists()) {
|
||||
String sha1 = getSHA1(libFile);
|
||||
if (art.getSha1() != null && art.getSha1().equals(sha1)) {
|
||||
// already deployed
|
||||
ret.add(pomFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static String getSHA1(File f) {
|
||||
try (InputStream fi = new FileInputStream(f)) {
|
||||
return DigestUtils.shaHex(fi);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static class ExtendedMavenArtifact {
|
||||
|
||||
private MavenArtifact artifact;
|
||||
|
||||
private boolean isMavenPlugin;
|
||||
|
||||
private String mvnUrl;
|
||||
|
||||
public ExtendedMavenArtifact(String mvnUrl, MavenArtifact artifact, boolean isMavenPlugin) {
|
||||
this.artifact = artifact;
|
||||
this.isMavenPlugin = isMavenPlugin;
|
||||
this.mvnUrl = mvnUrl;
|
||||
}
|
||||
|
||||
public MavenArtifact getArtifact() {
|
||||
return artifact;
|
||||
}
|
||||
|
||||
public boolean isMavenPlugin() {
|
||||
return isMavenPlugin;
|
||||
}
|
||||
|
||||
public String getMvnUrl() {
|
||||
return mvnUrl;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,6 +298,9 @@ public class FileDirCleaner {
|
||||
if (checkFilter(fileDirJob)) {
|
||||
if (doAction) {
|
||||
org.apache.commons.io.FileUtils.deleteDirectory(fileDirJob);
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Deleted directory: " + fileDirJob);
|
||||
}
|
||||
} else {
|
||||
StringBuilder reason = new StringBuilder();
|
||||
String sep = "";
|
||||
@@ -322,6 +325,9 @@ public class FileDirCleaner {
|
||||
if (checkFilter(fileDirJob)) {
|
||||
if (doAction) {
|
||||
org.apache.commons.io.FileUtils.forceDelete(fileDirJob);
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Deleted file: " + fileDirJob);
|
||||
}
|
||||
} else {
|
||||
StringBuilder reason = new StringBuilder();
|
||||
String sep = "";
|
||||
|
||||
1
pom.xml
1
pom.xml
@@ -110,7 +110,6 @@
|
||||
<module>main/plugins/org.talend.libraries.javacsv</module>
|
||||
<module>main/plugins/org.talend.libraries.javacsv.jars</module>
|
||||
<module>main/plugins/org.talend.libraries.jdbc.as400</module>
|
||||
<module>main/plugins/org.talend.libraries.jdbc.derby</module>
|
||||
<module>main/plugins/org.talend.libraries.jdbc.exasol</module>
|
||||
<module>main/plugins/org.talend.libraries.jdbc.h2</module>
|
||||
<module>main/plugins/org.talend.libraries.jdbc.hsql</module>
|
||||
|
||||
Reference in New Issue
Block a user