From 12312084eba567ed3cb063dad6fe6ca5ede92922 Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Wed, 30 Oct 2024 16:36:46 +0200 Subject: [PATCH 01/24] started refactoring the code for ide-plugins-common v1.6.1 with build-info v2.29.0 --- bundle/pom.xml | 2 +- .../configuration/XrayServerConfigImpl.java | 4 ++-- .../ide/eclipse/scan/GradleScanManager.java | 10 +++++----- .../ide/eclipse/scan/MavenScanManager.java | 10 +++++----- .../jfrog/ide/eclipse/scan/ScanManager.java | 7 +++---- .../ide/eclipse/ui/ComponentDetails.java | 6 +++--- .../eclipse/ui/ScanTreeContentProvider.java | 10 +++++----- .../jfrog/ide/eclipse/ui/SearchableTree.java | 16 +++++++-------- .../ui/issues/ComponentIssueDetails.java | 4 ++-- .../ui/issues/ComponentIssueTable.java | 4 ++-- .../issues/IssueCountColumnLabelProvider.java | 4 ++-- .../ide/eclipse/ui/issues/IssuesTree.java | 20 +++++++++---------- .../issues/IssuesTreeColumnLabelProvider.java | 4 ++-- .../ui/licenses/ComponentLicenseDetails.java | 4 ++-- .../ide/eclipse/ui/licenses/LicensesTree.java | 14 ++++++------- .../jfrog/ide/eclipse/utils/ProjectsMap.java | 12 +++++------ 16 files changed, 65 insertions(+), 66 deletions(-) diff --git a/bundle/pom.xml b/bundle/pom.xml index ffdde27..65a53ba 100644 --- a/bundle/pom.xml +++ b/bundle/pom.xml @@ -23,7 +23,7 @@ - 1.1.1 + 1.5.2 diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java index 7a6400f..b41439e 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java @@ -13,13 +13,13 @@ import org.eclipse.core.runtime.preferences.IPreferencesService; import org.jfrog.client.http.model.ProxyConfig; -import com.jfrog.ide.common.configuration.XrayServerConfig; +import com.jfrog.ide.common.configuration.ServerConfig; /** * @author yahavi */ @SuppressWarnings("restriction") -public class XrayServerConfigImpl implements XrayServerConfig { +public class XrayServerConfigImpl implements ServerConfig { private static XrayServerConfigImpl instance; private IPreferencesService service = Platform.getPreferencesService(); diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java index 01171e8..8b5f557 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java @@ -23,7 +23,7 @@ import org.gradle.tooling.ProgressEvent; import org.gradle.tooling.ProgressListener; import org.gradle.tooling.ProjectConnection; -import org.jfrog.build.extractor.scan.DependenciesTree; +import org.jfrog.build.extractor.scan.DependencyTree; import org.jfrog.build.extractor.scan.GeneralInfo; import com.fasterxml.jackson.databind.ObjectMapper; @@ -80,7 +80,7 @@ void refreshDependencies(IProgressMonitor monitor) throws IOException { @Override void buildTree() { - DependenciesTree rootNode = new DependenciesTree(getProjectName()); + DependencyTree rootNode = new DependencyTree(getProjectName()); GeneralInfo generalInfo = new GeneralInfo(); generalInfo.groupId(gradleArtifact.getGroupId()).artifactId(gradleArtifact.getArtifactId()) .version(gradleArtifact.getVersion()); @@ -108,13 +108,13 @@ private String getComponentId(GradleArtifact gradleArtifact) { } /** - * Populate root modules DependenciesTree with issues, licenses and general info + * Populate root modules DependencyTree with issues, licenses and general info * from the scan cache. */ - private void populateDependenciesTree(DependenciesTree scanTreeNode, GradleArtifact[] gradleArtifacts) { + private void populateDependenciesTree(DependencyTree scanTreeNode, GradleArtifact[] gradleArtifacts) { for (GradleArtifact artifact : gradleArtifacts) { String componentId = getComponentId(artifact); - DependenciesTree child = new DependenciesTree(componentId); + DependencyTree child = new DependencyTree(componentId); child.setGeneralInfo(new GeneralInfo(componentId, "", "", "Maven")); scanTreeNode.add(child); populateDependenciesTree(child, artifact.getDependencies()); diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java index af2f77c..26fc9e3 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java @@ -16,7 +16,7 @@ import org.eclipse.m2e.core.project.IMavenProjectFacade; import org.eclipse.m2e.core.project.MavenProjectChangedEvent; import org.eclipse.swt.widgets.Composite; -import org.jfrog.build.extractor.scan.DependenciesTree; +import org.jfrog.build.extractor.scan.DependencyTree; import org.jfrog.build.extractor.scan.GeneralInfo; import com.jfrog.ide.common.scan.ComponentPrefix; @@ -67,7 +67,7 @@ void buildTree() throws CoreException { if (mavenProject == null) { return; } - DependenciesTree rootNode = new DependenciesTree(mavenProject.getName()); + DependencyTree rootNode = new DependencyTree(mavenProject.getName()); GeneralInfo generalInfo = new GeneralInfo().groupId(mavenProject.getGroupId()) .artifactId(mavenProject.getArtifactId()).version(mavenProject.getVersion()); rootNode.setGeneralInfo(generalInfo); @@ -76,13 +76,13 @@ void buildTree() throws CoreException { } /** - * Populate root modules DependenciesTree with issues, licenses and general info + * Populate root modules DependencyTree with issues, licenses and general info * from the scan cache. */ - private void populateScanTreeNode(DependenciesTree scanTreeNode, DependencyNode dependencyNode) { + private void populateScanTreeNode(DependencyTree scanTreeNode, DependencyNode dependencyNode) { dependencyNode.getChildren().forEach(dependencyChild -> { String componentId = getComponentId(dependencyChild); - DependenciesTree child = new DependenciesTree(componentId); + DependencyTree child = new DependencyTree(componentId); child.setGeneralInfo(new GeneralInfo(componentId, "", "", "Maven")); scanTreeNode.add(child); populateScanTreeNode(child, dependencyChild); diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java index bf3d5e6..ad01ba8 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java @@ -11,7 +11,7 @@ import org.eclipse.core.runtime.ICoreRunnable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.swt.widgets.Composite; -import org.jfrog.build.extractor.scan.DependenciesTree; +import org.jfrog.build.extractor.scan.DependencyTree; import com.fasterxml.jackson.core.JsonProcessingException; import com.jfrog.ide.common.filter.FilterManager; @@ -38,8 +38,7 @@ public abstract class ScanManager extends ScanManagerBase { IProject project; ScanManager(IProject project, ComponentPrefix prefix) throws IOException { - super(HOME_PATH.resolve("cache"), project.getName(), Logger.getInstance(), XrayServerConfigImpl.getInstance(), - prefix); + super(HOME_PATH.resolve("cache"), project.getName(), Logger.getInstance(), XrayServerConfigImpl.getInstance(), prefix); this.project = project; Files.createDirectories(HOME_PATH); } @@ -134,7 +133,7 @@ private void setScanResults() { if (!getScanResults().isLeaf()) { addFilterManagerLicenses(filterManager); } - DependenciesTree scanResults = getScanResults(); + DependencyTree scanResults = getScanResults(); issuesTree.addScanResults(getProjectName(), scanResults); licensesTree.addScanResults(getProjectName(), scanResults); if (isDisposed()) { diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/ComponentDetails.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/ComponentDetails.java index b4e6efe..16e879a 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/ComponentDetails.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/ComponentDetails.java @@ -22,7 +22,7 @@ import org.eclipse.ui.forms.events.HyperlinkAdapter; import org.eclipse.ui.forms.events.HyperlinkEvent; import org.eclipse.ui.forms.widgets.Hyperlink; -import org.jfrog.build.extractor.scan.DependenciesTree; +import org.jfrog.build.extractor.scan.DependencyTree; import org.jfrog.build.extractor.scan.GeneralInfo; import org.jfrog.build.extractor.scan.License; @@ -50,7 +50,7 @@ public ComponentDetails(Composite parent, String title) { recreateComponentDetails(); } - public abstract void createDetailsView(DependenciesTree node); + public abstract void createDetailsView(DependencyTree node); public void recreateComponentDetails() { if (isDisposed()) { @@ -110,7 +110,7 @@ protected void createComponentsPanel() { * * @param node - Extract the component information from this node. */ - protected void createCommonInfo(DependenciesTree node) { + protected void createCommonInfo(DependencyTree node) { for (Control control : componentDetailsPanel.getChildren()) { control.dispose(); } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/ScanTreeContentProvider.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/ScanTreeContentProvider.java index 7c19041..4f4861d 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/ScanTreeContentProvider.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/ScanTreeContentProvider.java @@ -1,7 +1,7 @@ package com.jfrog.ide.eclipse.ui; import org.eclipse.jface.viewers.ITreeContentProvider; -import org.jfrog.build.extractor.scan.DependenciesTree; +import org.jfrog.build.extractor.scan.DependencyTree; /** * Content provider for DependenciesTree. @@ -9,7 +9,7 @@ * @author yahavi */ public class ScanTreeContentProvider implements ITreeContentProvider { - private static final DependenciesTree[] EMPTY_NODE = new DependenciesTree[0]; + private static final DependencyTree[] EMPTY_NODE = new DependencyTree[0]; @Override public Object[] getElements(Object element) { @@ -18,16 +18,16 @@ public Object[] getElements(Object element) { @Override public Object[] getChildren(Object element) { - return (((DependenciesTree) element).getChildren()).toArray(EMPTY_NODE); + return (((DependencyTree) element).getChildren()).toArray(EMPTY_NODE); } @Override public Object getParent(Object element) { - return ((DependenciesTree) element).getParent(); + return ((DependencyTree) element).getParent(); } @Override public boolean hasChildren(Object element) { - return !((DependenciesTree) element).isLeaf(); + return !((DependencyTree) element).isLeaf(); } } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/SearchableTree.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/SearchableTree.java index f6fbf9a..ab1904b 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/SearchableTree.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/SearchableTree.java @@ -16,7 +16,7 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.ui.dialogs.FilteredTree; import org.eclipse.ui.dialogs.PatternFilter; -import org.jfrog.build.extractor.scan.DependenciesTree; +import org.jfrog.build.extractor.scan.DependencyTree; import com.google.common.collect.Lists; import com.jfrog.ide.eclipse.utils.ProjectsMap; @@ -68,7 +68,7 @@ public void selectionChanged(SelectionChangedEvent event) { if (event.getSelection().isEmpty()) { return; } - DependenciesTree selection = (DependenciesTree) treeViewer.getStructuredSelection().getFirstElement(); + DependencyTree selection = (DependencyTree) treeViewer.getStructuredSelection().getFirstElement(); onClick(selection); } }); @@ -78,7 +78,7 @@ public void setComponentDetails(ComponentDetails componentDetails) { this.componentDetails = componentDetails; } - protected abstract void onClick(DependenciesTree selection); + protected abstract void onClick(DependencyTree selection); private static PatternFilter createFilter() { PatternFilter patternFilter = new PatternFilter(); @@ -86,12 +86,12 @@ private static PatternFilter createFilter() { return patternFilter; } - public List getSelectedNodes() { - List selectedNodes = Lists.newArrayList(); + public List getSelectedNodes() { + List selectedNodes = Lists.newArrayList(); TreePath[] selectionPaths = treeViewer.getStructuredSelection().getPaths(); if (selectionPaths != null) { selectedNodes = Arrays.stream(selectionPaths) - .map(selectedPath -> (DependenciesTree) selectedPath.getLastSegment()).collect(Collectors.toList()); + .map(selectedPath -> (DependencyTree) selectedPath.getLastSegment()).collect(Collectors.toList()); } return selectedNodes; @@ -109,8 +109,8 @@ public void reset() { projects.clear(); } - public void addScanResults(String projectName, DependenciesTree dependenciesTree) { - projects.put(projectName, dependenciesTree); + public void addScanResults(String projectName, DependencyTree dependencyTree) { + projects.put(projectName, dependencyTree); } public abstract void applyFilters(ProjectsMap.ProjectKey projectName); diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueDetails.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueDetails.java index 1b42804..9be99ef 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueDetails.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueDetails.java @@ -2,7 +2,7 @@ import org.apache.commons.lang3.StringUtils; import org.eclipse.swt.widgets.Composite; -import org.jfrog.build.extractor.scan.DependenciesTree; +import org.jfrog.build.extractor.scan.DependencyTree; import org.jfrog.build.extractor.scan.Issue; import com.jfrog.ide.eclipse.ui.ComponentDetails; @@ -27,7 +27,7 @@ private ComponentIssueDetails(Composite parent) { } @Override - public void createDetailsView(DependenciesTree node) { + public void createDetailsView(DependencyTree node) { createCommonInfo(node); Issue topIssue = node.getTopIssue(); addSection("Top Issue Severity:", StringUtils.capitalize(topIssue.getSeverity().toString())); diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java index 7149eb4..4cefca5 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java @@ -21,7 +21,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; -import org.jfrog.build.extractor.scan.DependenciesTree; +import org.jfrog.build.extractor.scan.DependencyTree; import org.jfrog.build.extractor.scan.Issue; import org.jfrog.build.extractor.scan.Severity; @@ -123,7 +123,7 @@ private TableViewerColumn createTableViewerColumn(String title, int weight, Colu return viewerColumn; } - public void updateIssuesTable(List selectedNodes) { + public void updateIssuesTable(List selectedNodes) { Set issuesSet = Sets.newHashSet(); FilterManager filterManager = FilterManagerSingleton.getInstance(); ScanManagersFactory.getInstance().getScanManagers().forEach(scanManager -> { diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssueCountColumnLabelProvider.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssueCountColumnLabelProvider.java index a060243..93138d3 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssueCountColumnLabelProvider.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssueCountColumnLabelProvider.java @@ -5,7 +5,7 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.widgets.Composite; -import org.jfrog.build.extractor.scan.DependenciesTree; +import org.jfrog.build.extractor.scan.DependencyTree; /** * The issues count component in the issues tree. @@ -22,7 +22,7 @@ public IssueCountColumnLabelProvider(Composite parent) { @Override public String getText(Object element) { - int issueCount = ((DependenciesTree) element).getIssueCount(); + int issueCount = ((DependencyTree) element).getIssueCount(); return issueCount == 0 ? "" : "(" + issueCount + ")"; } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTree.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTree.java index 057e315..1629487 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTree.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTree.java @@ -5,7 +5,7 @@ import org.eclipse.jface.viewers.TreeViewerColumn; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; -import org.jfrog.build.extractor.scan.DependenciesTree; +import org.jfrog.build.extractor.scan.DependencyTree; import com.google.common.collect.Lists; import com.jfrog.ide.common.filter.FilterManager; @@ -20,7 +20,7 @@ public class IssuesTree extends SearchableTree { private static IssuesTree instance; - private DependenciesTree root = new DependenciesTree(); + private DependencyTree root = new DependencyTree(); private ComponentIssueTable componentIssueTable; private TreeViewerColumn issuesCountColumn; @@ -39,7 +39,7 @@ private IssuesTree(Composite parent) { } @Override - protected void onClick(DependenciesTree selection) { + protected void onClick(DependencyTree selection) { componentDetails.createDetailsView(selection); componentIssueTable.updateIssuesTable(getSelectedNodes()); } @@ -50,12 +50,12 @@ public void setComponentIssueTable(ComponentIssueTable componentIssueTable) { @Override public void applyFilters(ProjectKey projectKey) { - DependenciesTree project = projects.get(projectKey); + DependencyTree project = projects.get(projectKey); if (project != null) { - DependenciesTree filteredRoot = (DependenciesTree) project.clone(); + DependencyTree filteredRoot = (DependencyTree) project.clone(); filteredRoot.getIssues().clear(); FilterManager filterManager = FilterManagerSingleton.getInstance(); - filterManager.applyFilters(project, filteredRoot, new DependenciesTree()); + filterManager.applyFilters(project, filteredRoot, new DependencyTree()); filteredRoot.setIssues(filteredRoot.processTreeIssues()); root.add(filteredRoot); if (root.getChildCount() == 1) { @@ -64,15 +64,15 @@ public void applyFilters(ProjectKey projectKey) { } else { treeViewer.setInput(root); } - long totalIssues = root.getChildren().stream().mapToInt(DependenciesTree::getIssueCount).sum(); + long totalIssues = root.getChildren().stream().mapToInt(DependencyTree::getIssueCount).sum(); issuesCountColumn.getColumn().setText("Issues (" + totalIssues + ")"); } } @Override public void applyFiltersForAllProjects() { - root = new DependenciesTree(); - for (Entry entry : projects.entrySet()) { + root = new DependencyTree(); + for (Entry entry : projects.entrySet()) { applyFilters(entry.getKey()); } } @@ -82,7 +82,7 @@ public void reset() { super.reset(); componentIssueTable.updateIssuesTable(Lists.newArrayList()); issuesCountColumn.getColumn().setText("Issues (0)"); - root = new DependenciesTree(); + root = new DependencyTree(); treeViewer.setInput(root); } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTreeColumnLabelProvider.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTreeColumnLabelProvider.java index 77bf016..fa725a7 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTreeColumnLabelProvider.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTreeColumnLabelProvider.java @@ -2,7 +2,7 @@ import org.eclipse.jface.viewers.ColumnLabelProvider; import org.eclipse.swt.graphics.Image; -import org.jfrog.build.extractor.scan.DependenciesTree; +import org.jfrog.build.extractor.scan.DependencyTree; import org.jfrog.build.extractor.scan.Severity; import com.jfrog.ide.eclipse.ui.IconManager; @@ -15,7 +15,7 @@ public class IssuesTreeColumnLabelProvider extends ColumnLabelProvider { @Override public Image getImage(Object element) { - DependenciesTree scanTreeNode = (DependenciesTree) element; + DependencyTree scanTreeNode = (DependencyTree) element; Severity severity = scanTreeNode.getTopIssue().getSeverity(); return IconManager.load(severity.name().toLowerCase()); } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/ComponentLicenseDetails.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/ComponentLicenseDetails.java index 583803e..f4dd8f4 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/ComponentLicenseDetails.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/ComponentLicenseDetails.java @@ -1,7 +1,7 @@ package com.jfrog.ide.eclipse.ui.licenses; import org.eclipse.swt.widgets.Composite; -import org.jfrog.build.extractor.scan.DependenciesTree; +import org.jfrog.build.extractor.scan.DependencyTree; import com.jfrog.ide.eclipse.ui.ComponentDetails; /** @@ -25,7 +25,7 @@ private ComponentLicenseDetails(Composite parent) { } @Override - public void createDetailsView(DependenciesTree node) { + public void createDetailsView(DependencyTree node) { createCommonInfo(node); refreshPanel(); } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/LicensesTree.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/LicensesTree.java index f6be645..7fd0268 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/LicensesTree.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/LicensesTree.java @@ -4,7 +4,7 @@ import org.eclipse.jface.viewers.ColumnLabelProvider; import org.eclipse.swt.widgets.Composite; -import org.jfrog.build.extractor.scan.DependenciesTree; +import org.jfrog.build.extractor.scan.DependencyTree; import com.jfrog.ide.common.filter.FilterManager; import com.jfrog.ide.eclipse.ui.FilterManagerSingleton; @@ -17,7 +17,7 @@ public class LicensesTree extends SearchableTree { private static LicensesTree instance; - private DependenciesTree root = new DependenciesTree();; + private DependencyTree root = new DependencyTree();; public static void createLicensesTree(Composite parent) { instance = new LicensesTree(parent); @@ -33,17 +33,17 @@ private LicensesTree(Composite parent) { } @Override - protected void onClick(DependenciesTree selection) { + protected void onClick(DependencyTree selection) { componentDetails.createDetailsView(selection); } @Override public void applyFilters(ProjectsMap.ProjectKey projectName) { - DependenciesTree project = projects.get(projectName); + DependencyTree project = projects.get(projectName); if (project != null) { - DependenciesTree filteredRoot = (DependenciesTree) project.clone(); + DependencyTree filteredRoot = (DependencyTree) project.clone(); FilterManager filterManager = FilterManagerSingleton.getInstance(); - filterManager.applyFilters(project, new DependenciesTree(), filteredRoot); + filterManager.applyFilters(project, new DependencyTree(), filteredRoot); root.add(filteredRoot); if (root.getChildCount() == 1) { // If there is only one project - Show only its dependencies in the tree viewer. @@ -57,7 +57,7 @@ public void applyFilters(ProjectsMap.ProjectKey projectName) { @Override public void applyFiltersForAllProjects() { root.removeAllChildren(); - for (Entry entry : projects.entrySet()) { + for (Entry entry : projects.entrySet()) { applyFilters(entry.getKey()); } } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java b/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java index deb5099..49117f8 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java @@ -4,7 +4,7 @@ import java.util.TreeMap; import org.apache.commons.lang3.StringUtils; -import org.jfrog.build.extractor.scan.DependenciesTree; +import org.jfrog.build.extractor.scan.DependencyTree; import org.jfrog.build.extractor.scan.GeneralInfo; /** @@ -13,18 +13,18 @@ * * @author yahavi */ -public class ProjectsMap extends TreeMap { +public class ProjectsMap extends TreeMap { private static final long serialVersionUID = 1L; /** * Put a project in the map. * * @param projectName - The project name. - * @param dependenciesTree - The dependencies tree. - * @return dependenciesTree. + * @param dependencyTree - The dependencies tree. + * @return dependencyTree. */ - public DependenciesTree put(String projectName, DependenciesTree dependenciesTree) { - return super.put(createKey(projectName, dependenciesTree.getGeneralInfo()), dependenciesTree); + public DependencyTree put(String projectName, DependencyTree dependencyTree) { + return super.put(createKey(projectName, dependencyTree.getGeneralInfo()), dependencyTree); } public static ProjectKey createKey(String projectName, GeneralInfo generalInfo) { From 733f9ae09593384c65ab5fa1ee259a42cd4d67a5 Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Wed, 13 Nov 2024 09:50:12 +0200 Subject: [PATCH 02/24] progress in refactoring the code --- .idea/.name | 1 + .idea/misc.xml | 6 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 66 + .metadata/.lock | 0 .../.root/.indexes/history.version | 1 + .../.root/.indexes/properties.index | Bin 0 -> 57 bytes .../.root/.indexes/properties.version | 1 + .../org.eclipse.core.resources/.root/2.tree | Bin 0 -> 81 bytes .../.safetable/org.eclipse.core.resources | Bin 0 -> 440 bytes .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.jdt.ui.prefs | 9 + .../.settings/org.eclipse.m2e.discovery.prefs | 2 + .../.settings/org.eclipse.ui.ide.prefs | 5 + .../.settings/org.eclipse.ui.prefs | 2 + .../.settings/org.eclipse.ui.workbench.prefs | 3 + .../dialog_settings.xml | 10 + .../org.eclipse.e4.workbench/workbench.xmi | 1784 +++++++++++++++++ .../assumedExternalFilesCache | Bin 0 -> 4 bytes .../org.eclipse.jdt.core/externalFilesCache | Bin 0 -> 4 bytes .../org.eclipse.jdt.core/nonChainingJarsCache | Bin 0 -> 4 bytes .../variablesAndContainers.dat | Bin 0 -> 129 bytes .../org.eclipse.jdt.ui/OpenTypeHistory.xml | 2 + .../QualifiedTypeNameHistory.xml | 2 + .../dialog_settings.xml | 15 + .../org.eclipse.ui.workbench/workingsets.xml | 6 + .metadata/version.ini | 3 + bundle/.classpath | 14 +- bundle/pom.xml | 4 + .../configuration/XrayServerConfigImpl.java | 38 + .../ide/eclipse/scan/NpmScanManager.java | 2 +- jfrog-eclipse-plugin.iml | 9 + pom.xml | 2 +- 34 files changed, 1997 insertions(+), 6 deletions(-) create mode 100644 .idea/.name create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 .metadata/.lock create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/2.tree create mode 100644 .metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources create mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs create mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs create mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs create mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs create mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs create mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs create mode 100644 .metadata/.plugins/org.eclipse.e4.ui.workbench.swt/dialog_settings.xml create mode 100644 .metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi create mode 100644 .metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache create mode 100644 .metadata/.plugins/org.eclipse.jdt.core/externalFilesCache create mode 100644 .metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache create mode 100644 .metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat create mode 100644 .metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml create mode 100644 .metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml create mode 100644 .metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml create mode 100644 .metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml create mode 100644 .metadata/version.ini create mode 100644 jfrog-eclipse-plugin.iml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..3a8819b --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +bundle \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..cefb937 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..eff096c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..5096ad1 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1730633343811 + + + + + + + true + + \ No newline at end of file diff --git a/.metadata/.lock b/.metadata/.lock new file mode 100644 index 0000000..e69de29 diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version new file mode 100644 index 0000000..25cb955 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index new file mode 100644 index 0000000000000000000000000000000000000000..ed9b514964f6d401c82fa8fdb36ac30ac51534a7 GIT binary patch literal 57 zcmZQ%U|?WmVAN+|WMUA>FG|--P0qyJm CSO?Dl literal 0 HcmV?d00001 diff --git a/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources new file mode 100644 index 0000000000000000000000000000000000000000..d72ea31965f7fa604d96c865f74bcdd8ff6f9917 GIT binary patch literal 440 zcmZ?R*xjhShe1S2b=vdAllRFf=Oz}Hq!uZZBqrsg@^UGMWRxoSCzmJ~8!8wYTA3JI z8JH<}28SpZ85o)Ha_Q@p6s4xx8u4-^=cFbUxuoWlB*y0#rR$|8=VTTXr|PAoCY7e^ zCFd8V+NLGu6a!7fp)f0@1Vvd2$SBu}g3O}ClFa-(6hq-^4b6=WjLpo=EzB$|O?kNv VMEw2?_DkUBp6cD@#~g;S-vH7Wm`MNt literal 0 HcmV?d00001 diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..dffc6b5 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +version=1 diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..f0fce55 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,9 @@ +content_assist_proposals_background=255,255,255 +content_assist_proposals_foreground=0,0,0 +eclipse.preferences.version=1 +org.eclipse.jdt.internal.ui.navigator.layout=2 +org.eclipse.jdt.internal.ui.navigator.librariesnode=true +org.eclipse.jdt.ui.formatterprofiles.version=17 +spelling_locale_initialized=true +useAnnotationsPrefPage=true +useQuickDiffPrefPage=true diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs new file mode 100644 index 0000000..67b1d96 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.m2e.discovery.pref.projects= diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs new file mode 100644 index 0000000..e16d845 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs @@ -0,0 +1,5 @@ +TASKS_FILTERS_MIGRATE=true +eclipse.preferences.version=1 +platformState=1730367768667 +quickStart=false +tipsAndTricks=true diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs new file mode 100644 index 0000000..08076f2 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +showIntro=false diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs new file mode 100644 index 0000000..aa3dc02 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs @@ -0,0 +1,3 @@ +//org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false +PLUGINS_NOT_ACTIVATED_ON_STARTUP=;org.eclipse.m2e.discovery; +eclipse.preferences.version=1 diff --git a/.metadata/.plugins/org.eclipse.e4.ui.workbench.swt/dialog_settings.xml b/.metadata/.plugins/org.eclipse.e4.ui.workbench.swt/dialog_settings.xml new file mode 100644 index 0000000..23798ac --- /dev/null +++ b/.metadata/.plugins/org.eclipse.e4.ui.workbench.swt/dialog_settings.xml @@ -0,0 +1,10 @@ + +
+
+ + + + + +
+
diff --git a/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi new file mode 100644 index 0000000..445997b --- /dev/null +++ b/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi @@ -0,0 +1,1784 @@ + + + + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration + ModelMigrationProcessor.001 + + + + + + + + topLevel + + + Minimized + MinimizedByZoom + + + persp.actionSet:org.eclipse.ui.cheatsheets.actionSet + persp.actionSet:org.eclipse.search.searchActionSet + persp.actionSet:org.eclipse.text.quicksearch.actionSet + persp.actionSet:org.eclipse.ui.edit.text.actionSet.annotationNavigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.navigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo + persp.actionSet:org.eclipse.ui.externaltools.ExternalToolsSet + persp.actionSet:org.eclipse.ui.actionSet.keyBindings + persp.actionSet:org.eclipse.ui.actionSet.openFiles + persp.newWizSC:org.eclipse.ui.wizards.new.folder + persp.newWizSC:org.eclipse.ui.wizards.new.file + persp.viewSC:org.eclipse.ui.navigator.ProjectExplorer + persp.viewSC:org.eclipse.ui.views.BookmarkView + persp.viewSC:org.eclipse.ui.views.ContentOutline + persp.viewSC:org.eclipse.ui.views.PropertySheet + persp.viewSC:org.eclipse.ui.views.ProblemView + persp.viewSC:org.eclipse.ui.views.ProgressView + persp.viewSC:org.eclipse.ui.views.TaskList + persp.actionSet:org.eclipse.ui.NavigateActionSet + persp.viewSC:org.eclipse.pde.runtime.LogView + persp.newWizSC:org.eclipse.ui.editors.wizards.UntitledTextFileWizard + persp.showIn:org.eclipse.ui.navigator.ProjectExplorer + persp.perspSC:org.eclipse.team.ui.TeamSynchronizingPerspective + persp.showIn:org.eclipse.team.ui.GenericHistoryView + persp.perspSC:org.eclipse.wst.xml.ui.perspective + persp.perspSC:org.eclipse.jdt.ui.JavaPerspective + persp.perspSC:org.eclipse.jdt.ui.JavaBrowsingPerspective + persp.viewSC:org.eclipse.ant.ui.views.AntView + + + + org.eclipse.e4.primaryNavigationStack + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + + org.eclipse.e4.secondaryNavigationStack + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:Ant + + + + + + + org.eclipse.e4.secondaryDataStack + + View + categoryTag:General + + + + + + + + active + Maximized + + View + categoryTag:Help + + + View + categoryTag:General + + + View + categoryTag:Help + + + + + + + View + categoryTag:Help + + + + + + View + categoryTag:General + active + activeOnClose + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:Help + + + + org.eclipse.e4.primaryDataStack + EditorStack + + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:General + + + + + View + categoryTag:Ant + + + + toolbarSeparator + + + + Draggable + + + + toolbarSeparator + + + + Draggable + + + toolbarSeparator + + + + Draggable + + + Draggable + + + toolbarSeparator + + + + Draggable + + + + toolbarSeparator + + + + toolbarSeparator + + + + Draggable + + + stretch + SHOW_RESTORE_MENU + + + Draggable + HIDEABLE + SHOW_RESTORE_MENU + + + + + stretch + + + Draggable + + + Draggable + + + + + TrimStack + Draggable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Editor + removeOnHide + + + + + View + categoryTag:Ant + + + + + View + categoryTag:Gradle + + + + + View + categoryTag:Gradle + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Help + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java + + + + + View + categoryTag:General + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Maven + + + + + View + categoryTag:Maven + + + + + View + categoryTag:API Tools + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:Team + + + + + View + categoryTag:Team + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:Help + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:XML + + + + + View + categoryTag:XML + + + + glue + move_after:PerspectiveSpacer + SHOW_RESTORE_MENU + + + move_after:Spacer Glue + HIDEABLE + SHOW_RESTORE_MENU + + + glue + move_after:SearchField + SHOW_RESTORE_MENU + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache b/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache new file mode 100644 index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 GIT binary patch literal 4 LcmZQzU|;|M00aO5 literal 0 HcmV?d00001 diff --git a/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache b/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache new file mode 100644 index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 GIT binary patch literal 4 LcmZQzU|;|M00aO5 literal 0 HcmV?d00001 diff --git a/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache b/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache new file mode 100644 index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 GIT binary patch literal 4 LcmZQzU|;|M00aO5 literal 0 HcmV?d00001 diff --git a/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat b/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat new file mode 100644 index 0000000000000000000000000000000000000000..3de398e8f2856ff30f4c5dd9cf8cfd66b137fcc8 GIT binary patch literal 129 zcmX|&TMB?66hudR2o)`+B_tP8G)3*({qG_l;QblSnYjQs`iT}o2g*j>tPn$^7-S`m py>^9ybE%pMoBm#v^5ZO3G2cM$*bk0n6(Ils literal 0 HcmV?d00001 diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml b/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml new file mode 100644 index 0000000..a4ee3cb --- /dev/null +++ b/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml @@ -0,0 +1,2 @@ + + diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml b/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml new file mode 100644 index 0000000..9e390f5 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml @@ -0,0 +1,2 @@ + + diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml b/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml new file mode 100644 index 0000000..c7ed1df --- /dev/null +++ b/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml @@ -0,0 +1,15 @@ + +
+
+ + + + + + + + + + +
+
diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml b/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml new file mode 100644 index 0000000..2bb0a95 --- /dev/null +++ b/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.metadata/version.ini b/.metadata/version.ini new file mode 100644 index 0000000..c2fa041 --- /dev/null +++ b/.metadata/version.ini @@ -0,0 +1,3 @@ +#Thu Oct 31 11:42:50 IST 2024 +org.eclipse.core.runtime=2 +org.eclipse.platform=4.13.0.v20190916-1045 diff --git a/bundle/.classpath b/bundle/.classpath index 1e1847c..03dbd71 100644 --- a/bundle/.classpath +++ b/bundle/.classpath @@ -1,16 +1,22 @@ - + - + + + + + + + + + - - diff --git a/bundle/pom.xml b/bundle/pom.xml index 65a53ba..e257322 100644 --- a/bundle/pom.xml +++ b/bundle/pom.xml @@ -20,6 +20,10 @@ releases https://releases.jfrog.io/artifactory/oss-releases + + eclipse-p2-releases + https://download.eclipse.org/tools/tycho/releases/ + diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java index b41439e..22bfe8d 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java @@ -4,6 +4,8 @@ import java.net.URI; +import javax.net.ssl.SSLContext; + import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.eclipse.core.internal.net.ProxyManager; @@ -68,4 +70,40 @@ public ProxyConfig getProxyConfForTargetUrl(String xrayUrl) { } return proxyConfig; } + + @Override + public String getArtifactoryUrl() { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getConnectionRetries() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getConnectionTimeout() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public SSLContext getSslContext() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getXrayUrl() { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean isInsecureTls() { + // TODO Auto-generated method stub + return false; + } } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java index 9ea6d9d..e5857cc 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java @@ -20,7 +20,7 @@ public class NpmScanManager extends ScanManager { NpmScanManager(IProject project) throws IOException { super(project, ComponentPrefix.NPM); getLog().info("Found npm project: " + getProjectName()); - npmTreeBuilder = new NpmTreeBuilder(project.getFullPath().toFile().toPath()); + npmTreeBuilder = new NpmTreeBuilder(project.getFullPath().toFile().toPath(), System.getenv()); } @Override diff --git a/jfrog-eclipse-plugin.iml b/jfrog-eclipse-plugin.iml new file mode 100644 index 0000000..48426fc --- /dev/null +++ b/jfrog-eclipse-plugin.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 5a03e43..3dd15af 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ pom - 1.3.0 + 3.0.3 UTF-8 From 821bb1f207c5b2e828519572da8669672c3abcaf Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Sun, 24 Nov 2024 21:13:28 +0200 Subject: [PATCH 03/24] progress in code refactor --- .../configuration/TestConnectionButton.java | 5 +++-- .../configuration/XrayServerConfigImpl.java | 15 ++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java index 2a4c122..773c933 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java @@ -12,7 +12,8 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; -import org.jfrog.client.http.model.ProxyConfig; +//import org.jfrog.client.http.model.ProxyConfig; +import org.jfrog.build.client.ProxyConfiguration; import org.osgi.framework.FrameworkUtil; import com.jfrog.ide.common.utils.XrayConnectionUtils; @@ -86,7 +87,7 @@ public void widgetSelected(SelectionEvent e) { try { connectionResults.setText("Connecting to Xray..."); String url = urlEditor.getStringValue(); - ProxyConfig proxyConfig = XrayServerConfigImpl.getInstance().getProxyConfForTargetUrl(url); + ProxyConfiguration proxyConfig = XrayServerConfigImpl.getInstance().getProxyConfForTargetUrl(url); Xray xrayClient = XrayClient.create(url, usernameEditor.getStringValue(), passwordEditor.getStringValue(), USER_AGENT, false, proxyConfig); Version xrayVersion = xrayClient.system().version(); diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java index 22bfe8d..82d723d 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java @@ -13,7 +13,8 @@ import org.eclipse.core.net.proxy.IProxyService; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.preferences.IPreferencesService; -import org.jfrog.client.http.model.ProxyConfig; +import org.jfrog.build.client.ProxyConfiguration; +//import org.jfrog.client.http.model.ProxyConfig; import com.jfrog.ide.common.configuration.ServerConfig; @@ -53,7 +54,7 @@ private String getValue(String key) { } @Override - public ProxyConfig getProxyConfForTargetUrl(String xrayUrl) { + public ProxyConfiguration getProxyConfForTargetUrl(String xrayUrl) { xrayUrl = StringUtils.defaultIfBlank(xrayUrl, getUrl()); IProxyService service = ProxyManager.getProxyManager(); IProxyData[] proxyData = service.select(URI.create(xrayUrl)); @@ -61,12 +62,12 @@ public ProxyConfig getProxyConfForTargetUrl(String xrayUrl) { return null; } - ProxyConfig proxyConfig = new ProxyConfig(); - proxyConfig.setHost(trim(proxyData[0].getHost())); - proxyConfig.setPort(proxyData[0].getPort()); + ProxyConfiguration proxyConfig = new ProxyConfiguration(); + proxyConfig.host = trim(proxyData[0].getHost()); + proxyConfig.port = proxyData[0].getPort(); if (proxyData[0].isRequiresAuthentication()) { - proxyConfig.setUsername(trim(proxyData[0].getUserId())); - proxyConfig.setPassword(proxyData[0].getPassword()); + proxyConfig.username = trim(proxyData[0].getUserId()); + proxyConfig.password = proxyData[0].getPassword(); } return proxyConfig; } From 43c2aebdfbe3031a95fb2cdcd18ecff3ece0c52d Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Mon, 25 Nov 2024 17:52:18 +0200 Subject: [PATCH 04/24] refactor - progress - changed implementation --- .../configuration/TestConnectionButton.java | 23 ++++++++++++++++--- .../jfrog/ide/eclipse/scan/ScanManager.java | 7 ++++-- .../ui/issues/ComponentIssueTable.java | 12 ++++++++++ .../ide/eclipse/ui/issues/IssuesTree.java | 6 ++--- .../ide/eclipse/ui/licenses/LicensesTree.java | 4 ++-- 5 files changed, 42 insertions(+), 10 deletions(-) diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java index 773c933..b89542d 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java @@ -12,13 +12,14 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; -//import org.jfrog.client.http.model.ProxyConfig; +//import org.jfrog.client.http.model.ProxyConfig; TODO: delete if works import org.jfrog.build.client.ProxyConfiguration; import org.osgi.framework.FrameworkUtil; import com.jfrog.ide.common.utils.XrayConnectionUtils; import com.jfrog.xray.client.Xray; import com.jfrog.xray.client.impl.XrayClient; +import com.jfrog.xray.client.impl.XrayClientBuilder; import com.jfrog.xray.client.services.system.Version; /** @@ -80,14 +81,30 @@ protected void doStore() { public int getNumberOfControls() { return 1; } + + private Xray createXrayClient() { + String url = urlEditor.getStringValue(); + ProxyConfiguration proxyConfig = XrayServerConfigImpl.getInstance().getProxyConfForTargetUrl(url); + return (Xray) new XrayClientBuilder() + .setUrl(url) + .setUserName(usernameEditor.getStringValue()) + .setPassword(passwordEditor.getStringValue()) + .setUserAgent(USER_AGENT) + .setInsecureTls(false) + .setSslContext(serverConfig.getSslContext()) + .setProxyConfiguration(proxyConfig) + .setLog(Logger.getInstance()) + .build(); + } private class ButtonSelection extends SelectionAdapter { @Override public void widgetSelected(SelectionEvent e) { try { connectionResults.setText("Connecting to Xray..."); - String url = urlEditor.getStringValue(); - ProxyConfiguration proxyConfig = XrayServerConfigImpl.getInstance().getProxyConfForTargetUrl(url); +// String url = urlEditor.getStringValue(); +// ProxyConfiguration proxyConfig = XrayServerConfigImpl.getInstance().getProxyConfForTargetUrl(url); + Xray xrayClient = XrayClient.create(url, usernameEditor.getStringValue(), passwordEditor.getStringValue(), USER_AGENT, false, proxyConfig); Version xrayVersion = xrayClient.system().version(); diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java index ad01ba8..7583332 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java @@ -130,10 +130,13 @@ public void run(IProgressMonitor monitor) throws CoreException { private void setScanResults() { FilterManager filterManager = FilterManagerSingleton.getInstance(); + DependencyTree scanResults = getScanResults(); + if (!getScanResults().isLeaf()) { - addFilterManagerLicenses(filterManager); + filterManager.collectsFiltersInformation(scanResults); +// addFilterManagerLicenses(filterManager); TODO: delete if code works } - DependencyTree scanResults = getScanResults(); + issuesTree.addScanResults(getProjectName(), scanResults); licensesTree.addScanResults(getProjectName(), scanResults); if (isDisposed()) { diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java index 4cefca5..106ef43 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java @@ -135,3 +135,15 @@ public void updateIssuesTable(List selectedNodes) { .collect(Collectors.toList())); } } + +/** + * Return filtered issues according to the selected component and user filters. + * + * @param selectedNodes - Selected tree nodes that the user chose from the ui. + * @return filtered issues according to the selected component and user filters. + */ +public Set getFilteredScanIssues(FilterManager filterManager, List selectedNodes) { + Set filteredIssues = Sets.newHashSet(); + selectedNodes.forEach(node -> filteredIssues.addAll(filterManager.filterIssues(node.getIssues()))); + return filteredIssues; +} \ No newline at end of file diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTree.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTree.java index 1629487..e7c0627 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTree.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTree.java @@ -52,10 +52,10 @@ public void setComponentIssueTable(ComponentIssueTable componentIssueTable) { public void applyFilters(ProjectKey projectKey) { DependencyTree project = projects.get(projectKey); if (project != null) { - DependencyTree filteredRoot = (DependencyTree) project.clone(); - filteredRoot.getIssues().clear(); +// DependencyTree filteredRoot = (DependencyTree) project.clone(); TODO: delete if code works +// filteredRoot.getIssues().clear(); FilterManager filterManager = FilterManagerSingleton.getInstance(); - filterManager.applyFilters(project, filteredRoot, new DependencyTree()); + DependencyTree filteredRoot = filterManager.applyFilters(project); filteredRoot.setIssues(filteredRoot.processTreeIssues()); root.add(filteredRoot); if (root.getChildCount() == 1) { diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/LicensesTree.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/LicensesTree.java index 7fd0268..8ec7853 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/LicensesTree.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/LicensesTree.java @@ -41,9 +41,9 @@ protected void onClick(DependencyTree selection) { public void applyFilters(ProjectsMap.ProjectKey projectName) { DependencyTree project = projects.get(projectName); if (project != null) { - DependencyTree filteredRoot = (DependencyTree) project.clone(); +// DependencyTree filteredRoot = (DependencyTree) project.clone(); TODO: delete if code works FilterManager filterManager = FilterManagerSingleton.getInstance(); - filterManager.applyFilters(project, new DependencyTree(), filteredRoot); + DependencyTree filteredRoot = filterManager.applyFilters(project); root.add(filteredRoot); if (root.getChildCount() == 1) { // If there is only one project - Show only its dependencies in the tree viewer. From 589d27db2482997cb4c32c131d4b87fa99b26a64 Mon Sep 17 00:00:00 2001 From: Keren Reshef Date: Tue, 26 Nov 2024 09:41:54 +0200 Subject: [PATCH 05/24] Delete .metadata directory --- .metadata/.lock | 0 .../.root/.indexes/history.version | 1 - .../.root/.indexes/properties.index | Bin 57 -> 0 bytes .../.root/.indexes/properties.version | 1 - .../org.eclipse.core.resources/.root/2.tree | Bin 81 -> 0 bytes .../.safetable/org.eclipse.core.resources | Bin 440 -> 0 bytes .../org.eclipse.core.resources.prefs | 2 - .../.settings/org.eclipse.jdt.ui.prefs | 9 - .../.settings/org.eclipse.m2e.discovery.prefs | 2 - .../.settings/org.eclipse.ui.ide.prefs | 5 - .../.settings/org.eclipse.ui.prefs | 2 - .../.settings/org.eclipse.ui.workbench.prefs | 3 - .../dialog_settings.xml | 10 - .../org.eclipse.e4.workbench/workbench.xmi | 1784 ----------------- .../assumedExternalFilesCache | Bin 4 -> 0 bytes .../org.eclipse.jdt.core/externalFilesCache | Bin 4 -> 0 bytes .../org.eclipse.jdt.core/nonChainingJarsCache | Bin 4 -> 0 bytes .../variablesAndContainers.dat | Bin 129 -> 0 bytes .../org.eclipse.jdt.ui/OpenTypeHistory.xml | 2 - .../QualifiedTypeNameHistory.xml | 2 - .../dialog_settings.xml | 15 - .../org.eclipse.ui.workbench/workingsets.xml | 6 - .metadata/version.ini | 3 - 23 files changed, 1847 deletions(-) delete mode 100644 .metadata/.lock delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.root/2.tree delete mode 100644 .metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources delete mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs delete mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs delete mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs delete mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs delete mode 100644 .metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs delete mode 100644 .metadata/.plugins/org.eclipse.e4.ui.workbench.swt/dialog_settings.xml delete mode 100644 .metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi delete mode 100644 .metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache delete mode 100644 .metadata/.plugins/org.eclipse.jdt.core/externalFilesCache delete mode 100644 .metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache delete mode 100644 .metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat delete mode 100644 .metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml delete mode 100644 .metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml delete mode 100644 .metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml delete mode 100644 .metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml delete mode 100644 .metadata/version.ini diff --git a/.metadata/.lock b/.metadata/.lock deleted file mode 100644 index e69de29..0000000 diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version deleted file mode 100644 index 25cb955..0000000 --- a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index deleted file mode 100644 index ed9b514964f6d401c82fa8fdb36ac30ac51534a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 57 zcmZQ%U|?WmVAN+|WMUA>FG|--P0qyJm CSO?Dl diff --git a/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources deleted file mode 100644 index d72ea31965f7fa604d96c865f74bcdd8ff6f9917..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 440 zcmZ?R*xjhShe1S2b=vdAllRFf=Oz}Hq!uZZBqrsg@^UGMWRxoSCzmJ~8!8wYTA3JI z8JH<}28SpZ85o)Ha_Q@p6s4xx8u4-^=cFbUxuoWlB*y0#rR$|8=VTTXr|PAoCY7e^ zCFd8V+NLGu6a!7fp)f0@1Vvd2$SBu}g3O}ClFa-(6hq-^4b6=WjLpo=EzB$|O?kNv VMEw2?_DkUBp6cD@#~g;S-vH7Wm`MNt diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index dffc6b5..0000000 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -version=1 diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index f0fce55..0000000 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,9 +0,0 @@ -content_assist_proposals_background=255,255,255 -content_assist_proposals_foreground=0,0,0 -eclipse.preferences.version=1 -org.eclipse.jdt.internal.ui.navigator.layout=2 -org.eclipse.jdt.internal.ui.navigator.librariesnode=true -org.eclipse.jdt.ui.formatterprofiles.version=17 -spelling_locale_initialized=true -useAnnotationsPrefPage=true -useQuickDiffPrefPage=true diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs deleted file mode 100644 index 67b1d96..0000000 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.m2e.discovery.pref.projects= diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs deleted file mode 100644 index e16d845..0000000 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs +++ /dev/null @@ -1,5 +0,0 @@ -TASKS_FILTERS_MIGRATE=true -eclipse.preferences.version=1 -platformState=1730367768667 -quickStart=false -tipsAndTricks=true diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs deleted file mode 100644 index 08076f2..0000000 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -showIntro=false diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs deleted file mode 100644 index aa3dc02..0000000 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs +++ /dev/null @@ -1,3 +0,0 @@ -//org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false -PLUGINS_NOT_ACTIVATED_ON_STARTUP=;org.eclipse.m2e.discovery; -eclipse.preferences.version=1 diff --git a/.metadata/.plugins/org.eclipse.e4.ui.workbench.swt/dialog_settings.xml b/.metadata/.plugins/org.eclipse.e4.ui.workbench.swt/dialog_settings.xml deleted file mode 100644 index 23798ac..0000000 --- a/.metadata/.plugins/org.eclipse.e4.ui.workbench.swt/dialog_settings.xml +++ /dev/null @@ -1,10 +0,0 @@ - -
-
- - - - - -
-
diff --git a/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi deleted file mode 100644 index 445997b..0000000 --- a/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi +++ /dev/null @@ -1,1784 +0,0 @@ - - - - activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration - ModelMigrationProcessor.001 - - - - - - - - topLevel - - - Minimized - MinimizedByZoom - - - persp.actionSet:org.eclipse.ui.cheatsheets.actionSet - persp.actionSet:org.eclipse.search.searchActionSet - persp.actionSet:org.eclipse.text.quicksearch.actionSet - persp.actionSet:org.eclipse.ui.edit.text.actionSet.annotationNavigation - persp.actionSet:org.eclipse.ui.edit.text.actionSet.navigation - persp.actionSet:org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo - persp.actionSet:org.eclipse.ui.externaltools.ExternalToolsSet - persp.actionSet:org.eclipse.ui.actionSet.keyBindings - persp.actionSet:org.eclipse.ui.actionSet.openFiles - persp.newWizSC:org.eclipse.ui.wizards.new.folder - persp.newWizSC:org.eclipse.ui.wizards.new.file - persp.viewSC:org.eclipse.ui.navigator.ProjectExplorer - persp.viewSC:org.eclipse.ui.views.BookmarkView - persp.viewSC:org.eclipse.ui.views.ContentOutline - persp.viewSC:org.eclipse.ui.views.PropertySheet - persp.viewSC:org.eclipse.ui.views.ProblemView - persp.viewSC:org.eclipse.ui.views.ProgressView - persp.viewSC:org.eclipse.ui.views.TaskList - persp.actionSet:org.eclipse.ui.NavigateActionSet - persp.viewSC:org.eclipse.pde.runtime.LogView - persp.newWizSC:org.eclipse.ui.editors.wizards.UntitledTextFileWizard - persp.showIn:org.eclipse.ui.navigator.ProjectExplorer - persp.perspSC:org.eclipse.team.ui.TeamSynchronizingPerspective - persp.showIn:org.eclipse.team.ui.GenericHistoryView - persp.perspSC:org.eclipse.wst.xml.ui.perspective - persp.perspSC:org.eclipse.jdt.ui.JavaPerspective - persp.perspSC:org.eclipse.jdt.ui.JavaBrowsingPerspective - persp.viewSC:org.eclipse.ant.ui.views.AntView - - - - org.eclipse.e4.primaryNavigationStack - - View - categoryTag:General - - - View - categoryTag:General - - - View - categoryTag:General - - - - org.eclipse.e4.secondaryNavigationStack - - View - categoryTag:General - - - View - categoryTag:General - - - View - categoryTag:Ant - - - - - - - org.eclipse.e4.secondaryDataStack - - View - categoryTag:General - - - - - - - - active - Maximized - - View - categoryTag:Help - - - View - categoryTag:General - - - View - categoryTag:Help - - - - - - - View - categoryTag:Help - - - - - - View - categoryTag:General - active - activeOnClose - - ViewMenu - menuContribution:menu - - - - - - - View - categoryTag:Help - - - - org.eclipse.e4.primaryDataStack - EditorStack - - - - - - - View - categoryTag:General - - ViewMenu - menuContribution:menu - - - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - - View - categoryTag:General - - ViewMenu - menuContribution:menu - - - - - - - - View - categoryTag:General - - ViewMenu - menuContribution:menu - - - - - - - View - categoryTag:General - - - - - View - categoryTag:Ant - - - - toolbarSeparator - - - - Draggable - - - - toolbarSeparator - - - - Draggable - - - toolbarSeparator - - - - Draggable - - - Draggable - - - toolbarSeparator - - - - Draggable - - - - toolbarSeparator - - - - toolbarSeparator - - - - Draggable - - - stretch - SHOW_RESTORE_MENU - - - Draggable - HIDEABLE - SHOW_RESTORE_MENU - - - - - stretch - - - Draggable - - - Draggable - - - - - TrimStack - Draggable - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - platform:win32 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - platform:win32 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Editor - removeOnHide - - - - - View - categoryTag:Ant - - - - - View - categoryTag:Gradle - - - - - View - categoryTag:Gradle - - - - - View - categoryTag:Debug - - - - - View - categoryTag:Debug - - - - - View - categoryTag:Debug - - - - - View - categoryTag:Debug - - - - - View - categoryTag:Debug - - - - - View - categoryTag:Debug - - - - - View - categoryTag:Debug - - - - - View - categoryTag:Help - - - - - View - categoryTag:Debug - - - - - View - categoryTag:Java - - - - - View - categoryTag:Java - - - - - View - categoryTag:Java - - - - - View - categoryTag:Java Browsing - - - - - View - categoryTag:Java Browsing - - - - - View - categoryTag:Java Browsing - - - - - View - categoryTag:Java Browsing - - - - - View - categoryTag:Java - - - - - View - categoryTag:General - - - - - View - categoryTag:Java - - - - - View - categoryTag:Java - - - - - View - categoryTag:Maven - - - - - View - categoryTag:Maven - - - - - View - categoryTag:API Tools - - - - - View - categoryTag:Plug-in Development - - - - - View - categoryTag:Plug-in Development - - - - - View - categoryTag:Plug-in Development - - - - - View - categoryTag:Plug-in Development - - - - - View - categoryTag:Plug-in Development - - - - - View - categoryTag:Plug-in Development - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:Team - - - - - View - categoryTag:Team - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:Help - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:General - - - - - View - categoryTag:XML - - - - - View - categoryTag:XML - - - - glue - move_after:PerspectiveSpacer - SHOW_RESTORE_MENU - - - move_after:Spacer Glue - HIDEABLE - SHOW_RESTORE_MENU - - - glue - move_after:SearchField - SHOW_RESTORE_MENU - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache b/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache deleted file mode 100644 index 593f4708db84ac8fd0f5cc47c634f38c013fe9e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4 LcmZQzU|;|M00aO5 diff --git a/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache b/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache deleted file mode 100644 index 593f4708db84ac8fd0f5cc47c634f38c013fe9e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4 LcmZQzU|;|M00aO5 diff --git a/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache b/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache deleted file mode 100644 index 593f4708db84ac8fd0f5cc47c634f38c013fe9e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4 LcmZQzU|;|M00aO5 diff --git a/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat b/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat deleted file mode 100644 index 3de398e8f2856ff30f4c5dd9cf8cfd66b137fcc8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 129 zcmX|&TMB?66hudR2o)`+B_tP8G)3*({qG_l;QblSnYjQs`iT}o2g*j>tPn$^7-S`m py>^9ybE%pMoBm#v^5ZO3G2cM$*bk0n6(Ils diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml b/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml deleted file mode 100644 index a4ee3cb..0000000 --- a/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml b/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml deleted file mode 100644 index 9e390f5..0000000 --- a/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml b/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml deleted file mode 100644 index c7ed1df..0000000 --- a/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml +++ /dev/null @@ -1,15 +0,0 @@ - -
-
- - - - - - - - - - -
-
diff --git a/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml b/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml deleted file mode 100644 index 2bb0a95..0000000 --- a/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.metadata/version.ini b/.metadata/version.ini deleted file mode 100644 index c2fa041..0000000 --- a/.metadata/version.ini +++ /dev/null @@ -1,3 +0,0 @@ -#Thu Oct 31 11:42:50 IST 2024 -org.eclipse.core.runtime=2 -org.eclipse.platform=4.13.0.v20190916-1045 From 0756fb8617c42b41de7538683a9298a1a2dff7b9 Mon Sep 17 00:00:00 2001 From: Keren Reshef Date: Tue, 26 Nov 2024 09:42:18 +0200 Subject: [PATCH 06/24] Delete .idea directory --- .idea/.name | 1 - .idea/misc.xml | 6 ----- .idea/modules.xml | 8 ------ .idea/vcs.xml | 6 ----- .idea/workspace.xml | 66 --------------------------------------------- 5 files changed, 87 deletions(-) delete mode 100644 .idea/.name delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 3a8819b..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -bundle \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index cefb937..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index eff096c..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 5096ad1..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1730633343811 - - - - - - - true - - \ No newline at end of file From 6fe31dcf1a7ea3f2a7763be4a253ef291a0a4ceb Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Wed, 27 Nov 2024 09:29:29 +0200 Subject: [PATCH 07/24] no build errors --- bundle/pom.xml | 2 +- .../configuration/PreferenceConstants.java | 3 ++ .../configuration/TestConnectionButton.java | 28 ++++++++++--------- .../ide/eclipse/scan/NpmScanManager.java | 2 +- .../ide/eclipse/scan/ScanManagersFactory.java | 9 ++++-- .../ui/issues/ComponentIssueTable.java | 15 ++-------- 6 files changed, 29 insertions(+), 30 deletions(-) diff --git a/bundle/pom.xml b/bundle/pom.xml index e257322..7b641d5 100644 --- a/bundle/pom.xml +++ b/bundle/pom.xml @@ -27,7 +27,7 @@ - 1.5.2 + 1.6.1 diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java index 6e01160..5ff05e7 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java @@ -17,4 +17,7 @@ public class PreferenceConstants { public static final String GRADLE_PLUGIN_QUALIFIER = "org.eclipse.buildship.core"; public static final String GRADLE_DISTRIBUTION = "gradle.distribution"; + // Default exluded paths pattern + public static final String DEFAULT_EXCLUSIONS = "**/*{.idea,test,node_modules}*"; + } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java index b89542d..30b8529 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java @@ -13,14 +13,13 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; //import org.jfrog.client.http.model.ProxyConfig; TODO: delete if works -import org.jfrog.build.client.ProxyConfiguration; import org.osgi.framework.FrameworkUtil; import com.jfrog.ide.common.utils.XrayConnectionUtils; import com.jfrog.xray.client.Xray; -import com.jfrog.xray.client.impl.XrayClient; import com.jfrog.xray.client.impl.XrayClientBuilder; import com.jfrog.xray.client.services.system.Version; +import com.jfrog.ide.eclipse.log.Logger; /** * Button in the configuration panel for testing connection with Xray. @@ -83,17 +82,18 @@ public int getNumberOfControls() { } private Xray createXrayClient() { - String url = urlEditor.getStringValue(); - ProxyConfiguration proxyConfig = XrayServerConfigImpl.getInstance().getProxyConfForTargetUrl(url); - return (Xray) new XrayClientBuilder() + String url = this.urlEditor.getStringValue(); + XrayServerConfigImpl serverConfig = XrayServerConfigImpl.getInstance(); + + return (Xray) new XrayClientBuilder() .setUrl(url) - .setUserName(usernameEditor.getStringValue()) - .setPassword(passwordEditor.getStringValue()) + .setUserName(this.usernameEditor.getStringValue()) + .setPassword(this.passwordEditor.getStringValue()) .setUserAgent(USER_AGENT) .setInsecureTls(false) .setSslContext(serverConfig.getSslContext()) - .setProxyConfiguration(proxyConfig) - .setLog(Logger.getInstance()) + .setProxyConfiguration(serverConfig.getProxyConfForTargetUrl(url)) + .setLog(Logger.getInstance()) .build(); } @@ -102,11 +102,13 @@ private class ButtonSelection extends SelectionAdapter { public void widgetSelected(SelectionEvent e) { try { connectionResults.setText("Connecting to Xray..."); -// String url = urlEditor.getStringValue(); +// String url = urlEditor.getStringValue(); TODO: delete if works // ProxyConfiguration proxyConfig = XrayServerConfigImpl.getInstance().getProxyConfForTargetUrl(url); - - Xray xrayClient = XrayClient.create(url, usernameEditor.getStringValue(), - passwordEditor.getStringValue(), USER_AGENT, false, proxyConfig); + + Xray xrayClient = createXrayClient(); + +// Xray client = XrayClient.create(url, usernameEditor.getStringValue(), TODO: delete +// passwordEditor.getStringValue(), USER_AGENT, false, proxyConfig); Version xrayVersion = xrayClient.system().version(); if (!XrayConnectionUtils.isXrayVersionSupported(xrayVersion)) { diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java index e5857cc..98aadd7 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java @@ -29,6 +29,6 @@ void refreshDependencies(IProgressMonitor monitor) throws IOException { @Override void buildTree() throws CoreException, JsonProcessingException, IOException { - setScanResults(npmTreeBuilder.buildTree(getLog())); + setScanResults(npmTreeBuilder.buildTree(getLog(), false)); } } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java index 8a9b08a..eff2593 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java @@ -16,7 +16,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Sets; -import com.jfrog.ide.common.utils.Utils; +import com.jfrog.ide.common.utils.PackageFileFinder; import com.jfrog.ide.eclipse.log.Logger; import com.jfrog.ide.eclipse.npm.NpmProject; import com.jfrog.ide.eclipse.scheduling.ScanJob; @@ -24,6 +24,7 @@ import com.jfrog.ide.eclipse.ui.issues.IssuesTree; import com.jfrog.ide.eclipse.ui.licenses.ComponentLicenseDetails; import com.jfrog.ide.eclipse.ui.licenses.LicensesTree; +import com.jfrog.ide.eclipse.configuration.PreferenceConstants; /** * @author yahavi @@ -99,6 +100,7 @@ public void refreshScanManagers(Composite parent) { IProject[] projects = iworkspace.getRoot().getProjects(); if (projects.length > 0) { try { + // refresh Maven and Gradle managers Set paths = Sets.newHashSet(); for (IProject project : projects) { if (!project.isOpen()) { @@ -113,7 +115,10 @@ public void refreshScanManagers(Composite parent) { } paths.add(project.getLocation().toFile().toPath()); } - Set packageJsonDirs = Utils.findPackageJsonDirs(paths); + + // refresh Npm manager + PackageFileFinder packageFileFinder = new PackageFileFinder(paths, PreferenceConstants.DEFAULT_EXCLUSIONS, Logger.getInstance()); + Set packageJsonDirs = packageFileFinder.getNpmPackagesFilePairs(); for (String dir : packageJsonDirs) { IProject npmProject = new NpmProject(dir, iworkspace); scanManagers.add(new NpmScanManager(npmProject)); diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java index 106ef43..70f36e6 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java @@ -127,23 +127,12 @@ public void updateIssuesTable(List selectedNodes) { Set issuesSet = Sets.newHashSet(); FilterManager filterManager = FilterManagerSingleton.getInstance(); ScanManagersFactory.getInstance().getScanManagers().forEach(scanManager -> { - issuesSet.addAll(scanManager.getFilteredScanIssues(filterManager, selectedNodes)); + issuesSet.addAll(filterManager.getFilteredScanIssues(selectedNodes)); }); tableViewer.setInput( issuesSet.stream().sorted(Comparator.comparing(issue -> ((Issue) issue).getSeverity()).reversed()) .collect(Collectors.toList())); } + } - -/** - * Return filtered issues according to the selected component and user filters. - * - * @param selectedNodes - Selected tree nodes that the user chose from the ui. - * @return filtered issues according to the selected component and user filters. - */ -public Set getFilteredScanIssues(FilterManager filterManager, List selectedNodes) { - Set filteredIssues = Sets.newHashSet(); - selectedNodes.forEach(node -> filteredIssues.addAll(filterManager.filterIssues(node.getIssues()))); - return filteredIssues; -} \ No newline at end of file From 1c800a34c1ef537b5799c8b8d41643ea3de28aa6 Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Thu, 28 Nov 2024 21:12:42 +0200 Subject: [PATCH 08/24] connected to Xray server successfully --- .../configuration/TestConnectionButton.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java index 30b8529..d5703cb 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java @@ -12,7 +12,6 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; -//import org.jfrog.client.http.model.ProxyConfig; TODO: delete if works import org.osgi.framework.FrameworkUtil; import com.jfrog.ide.common.utils.XrayConnectionUtils; @@ -82,13 +81,14 @@ public int getNumberOfControls() { } private Xray createXrayClient() { - String url = this.urlEditor.getStringValue(); + String url = urlEditor.getStringValue(); + String xrayUrl = url.endsWith("/") ? url + "xray" : url + "/xray"; XrayServerConfigImpl serverConfig = XrayServerConfigImpl.getInstance(); return (Xray) new XrayClientBuilder() - .setUrl(url) - .setUserName(this.usernameEditor.getStringValue()) - .setPassword(this.passwordEditor.getStringValue()) + .setUrl(xrayUrl) + .setUserName(usernameEditor.getStringValue()) + .setPassword(passwordEditor.getStringValue()) .setUserAgent(USER_AGENT) .setInsecureTls(false) .setSslContext(serverConfig.getSslContext()) @@ -102,13 +102,8 @@ private class ButtonSelection extends SelectionAdapter { public void widgetSelected(SelectionEvent e) { try { connectionResults.setText("Connecting to Xray..."); -// String url = urlEditor.getStringValue(); TODO: delete if works -// ProxyConfiguration proxyConfig = XrayServerConfigImpl.getInstance().getProxyConfForTargetUrl(url); Xray xrayClient = createXrayClient(); - -// Xray client = XrayClient.create(url, usernameEditor.getStringValue(), TODO: delete -// passwordEditor.getStringValue(), USER_AGENT, false, proxyConfig); Version xrayVersion = xrayClient.system().version(); if (!XrayConnectionUtils.isXrayVersionSupported(xrayVersion)) { From 74ceacb55cb1df91ef2513969f1ef999d8532642 Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Sun, 1 Dec 2024 19:20:57 +0200 Subject: [PATCH 09/24] scan is working - critical severity is shown --- .../ide/eclipse/configuration/TestConnectionButton.java | 8 +++++--- .../ide/eclipse/configuration/XrayServerConfigImpl.java | 8 ++++---- .../main/java/com/jfrog/ide/eclipse/scan/ScanManager.java | 1 - .../java/com/jfrog/ide/eclipse/ui/issues/IssuesTree.java | 2 -- .../com/jfrog/ide/eclipse/ui/licenses/LicensesTree.java | 1 - 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java index d5703cb..059bfe3 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java @@ -1,5 +1,7 @@ package com.jfrog.ide.eclipse.configuration; +import static com.jfrog.ide.common.utils.XrayConnectionUtils.createXrayClientBuilder; + import java.io.IOException; import org.apache.commons.lang3.tuple.Pair; @@ -16,6 +18,7 @@ import com.jfrog.ide.common.utils.XrayConnectionUtils; import com.jfrog.xray.client.Xray; +import org.jfrog.build.client.ProxyConfiguration; import com.jfrog.xray.client.impl.XrayClientBuilder; import com.jfrog.xray.client.services.system.Version; import com.jfrog.ide.eclipse.log.Logger; @@ -92,7 +95,7 @@ private Xray createXrayClient() { .setUserAgent(USER_AGENT) .setInsecureTls(false) .setSslContext(serverConfig.getSslContext()) - .setProxyConfiguration(serverConfig.getProxyConfForTargetUrl(url)) + .setProxyConfiguration(serverConfig.getProxyConfForTargetUrl(xrayUrl)) .setLog(Logger.getInstance()) .build(); } @@ -102,8 +105,7 @@ private class ButtonSelection extends SelectionAdapter { public void widgetSelected(SelectionEvent e) { try { connectionResults.setText("Connecting to Xray..."); - - Xray xrayClient = createXrayClient(); + Xray xrayClient = createXrayClient(); Version xrayVersion = xrayClient.system().version(); if (!XrayConnectionUtils.isXrayVersionSupported(xrayVersion)) { diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java index 82d723d..7f1e759 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java @@ -14,7 +14,6 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.preferences.IPreferencesService; import org.jfrog.build.client.ProxyConfiguration; -//import org.jfrog.client.http.model.ProxyConfig; import com.jfrog.ide.common.configuration.ServerConfig; @@ -57,7 +56,7 @@ private String getValue(String key) { public ProxyConfiguration getProxyConfForTargetUrl(String xrayUrl) { xrayUrl = StringUtils.defaultIfBlank(xrayUrl, getUrl()); IProxyService service = ProxyManager.getProxyManager(); - IProxyData[] proxyData = service.select(URI.create(xrayUrl)); + IProxyData[] proxyData = service.select(URI.create(xrayUrl)); // TODO: check why we get error msg: WinHttp.GetProxyForUrl for pac failed with error 'The handle is invalid. if (ArrayUtils.isEmpty(proxyData)) { return null; } @@ -98,8 +97,9 @@ public SSLContext getSslContext() { @Override public String getXrayUrl() { - // TODO Auto-generated method stub - return null; + String url = getUrl(); + String xrayUrl = url.endsWith("/") ? url + "xray" : url + "/xray"; + return xrayUrl; } @Override diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java index 7583332..a4efbac 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java @@ -134,7 +134,6 @@ private void setScanResults() { if (!getScanResults().isLeaf()) { filterManager.collectsFiltersInformation(scanResults); -// addFilterManagerLicenses(filterManager); TODO: delete if code works } issuesTree.addScanResults(getProjectName(), scanResults); diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTree.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTree.java index e7c0627..589654d 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTree.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/IssuesTree.java @@ -52,8 +52,6 @@ public void setComponentIssueTable(ComponentIssueTable componentIssueTable) { public void applyFilters(ProjectKey projectKey) { DependencyTree project = projects.get(projectKey); if (project != null) { -// DependencyTree filteredRoot = (DependencyTree) project.clone(); TODO: delete if code works -// filteredRoot.getIssues().clear(); FilterManager filterManager = FilterManagerSingleton.getInstance(); DependencyTree filteredRoot = filterManager.applyFilters(project); filteredRoot.setIssues(filteredRoot.processTreeIssues()); diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/LicensesTree.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/LicensesTree.java index 8ec7853..6cbc72c 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/LicensesTree.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/licenses/LicensesTree.java @@ -41,7 +41,6 @@ protected void onClick(DependencyTree selection) { public void applyFilters(ProjectsMap.ProjectKey projectName) { DependencyTree project = projects.get(projectName); if (project != null) { -// DependencyTree filteredRoot = (DependencyTree) project.clone(); TODO: delete if code works FilterManager filterManager = FilterManagerSingleton.getInstance(); DependencyTree filteredRoot = filterManager.applyFilters(project); root.add(filteredRoot); From 2045a21d37faff51b99819d8330e9168a6109847 Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Mon, 2 Dec 2024 09:45:04 +0200 Subject: [PATCH 10/24] updated default exclusions --- .../jfrog/ide/eclipse/configuration/PreferenceConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java index 5ff05e7..5274426 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java @@ -18,6 +18,6 @@ public class PreferenceConstants { public static final String GRADLE_DISTRIBUTION = "gradle.distribution"; // Default exluded paths pattern - public static final String DEFAULT_EXCLUSIONS = "**/*{.idea,test,node_modules}*"; + public static final String DEFAULT_EXCLUSIONS = "**/*{.git,test,node_modules,target}*"; } From 702411c9979285c99a1edb59cbc505cfef26089e Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Tue, 3 Dec 2024 16:43:15 +0200 Subject: [PATCH 11/24] progress --- .../jfrog/ide/eclipse/configuration/TestConnectionButton.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java index 059bfe3..c7de58d 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java @@ -1,7 +1,5 @@ package com.jfrog.ide.eclipse.configuration; -import static com.jfrog.ide.common.utils.XrayConnectionUtils.createXrayClientBuilder; - import java.io.IOException; import org.apache.commons.lang3.tuple.Pair; @@ -18,7 +16,6 @@ import com.jfrog.ide.common.utils.XrayConnectionUtils; import com.jfrog.xray.client.Xray; -import org.jfrog.build.client.ProxyConfiguration; import com.jfrog.xray.client.impl.XrayClientBuilder; import com.jfrog.xray.client.services.system.Version; import com.jfrog.ide.eclipse.log.Logger; From f0b735cd57bf4ac007c9b7676a396ee63d3662bb Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Sun, 22 Dec 2024 15:51:55 +0200 Subject: [PATCH 12/24] maven scan repaired --- .../jfrog/ide/eclipse/scan/MavenScanManager.java | 16 ++++++++++++---- .../com/jfrog/ide/eclipse/scan/ScanManager.java | 6 +++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java index 26fc9e3..90de2ee 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java @@ -18,7 +18,9 @@ import org.eclipse.swt.widgets.Composite; import org.jfrog.build.extractor.scan.DependencyTree; import org.jfrog.build.extractor.scan.GeneralInfo; +import org.jfrog.build.extractor.scan.Scope; +import com.google.common.collect.Sets; import com.jfrog.ide.common.scan.ComponentPrefix; import com.jfrog.ide.eclipse.log.Logger; import com.jfrog.ide.eclipse.scheduling.ScanJob; @@ -38,6 +40,7 @@ public MavenScanManager(IProject project, Composite parent) throws IOException { super(project, ComponentPrefix.GAV); getLog().info("Found Maven project: " + getProjectName()); this.parent = parent; + } public static boolean isApplicable(IProject project) { @@ -67,12 +70,12 @@ void buildTree() throws CoreException { if (mavenProject == null) { return; } - DependencyTree rootNode = new DependencyTree(mavenProject.getName()); + DependencyTree rootNode = new DependencyTree(mavenProject.getName()); + populateScanTreeNode(rootNode, mavenDependenciesRoot); GeneralInfo generalInfo = new GeneralInfo().groupId(mavenProject.getGroupId()) .artifactId(mavenProject.getArtifactId()).version(mavenProject.getVersion()); rootNode.setGeneralInfo(generalInfo); - populateScanTreeNode(rootNode, mavenDependenciesRoot); - setScanResults(rootNode); + setScanResults(rootNode); } /** @@ -83,7 +86,12 @@ private void populateScanTreeNode(DependencyTree scanTreeNode, DependencyNode de dependencyNode.getChildren().forEach(dependencyChild -> { String componentId = getComponentId(dependencyChild); DependencyTree child = new DependencyTree(componentId); - child.setGeneralInfo(new GeneralInfo(componentId, "", "", "Maven")); + String componentName = dependencyChild.getArtifact().getArtifactId(); + child.setGeneralInfo(new GeneralInfo(componentId, componentName, "", "Maven")); + // set dependency scope + String componentScope = dependencyChild.getDependency().getScope(); + child.setScopes(Sets.newHashSet(new Scope(componentScope))); + scanTreeNode.add(child); populateScanTreeNode(child, dependencyChild); }); diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java index a4efbac..0c4e455 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java @@ -120,7 +120,7 @@ public void run(IProgressMonitor monitor) throws CoreException { } ProgressIndicator indicator = new ProgressIndicatorImpl("Xray Scan - " + getProjectName(), monitor); scanAndCacheArtifacts(indicator, quickScan); - addXrayInfoToTree(getScanResults()); + addXrayInfoToTree(getScanResults()); // TODO: check why not getting inside setScanResults(); } catch (IOException e) { Logger.getInstance().error(e.getMessage(), e); @@ -132,11 +132,11 @@ private void setScanResults() { FilterManager filterManager = FilterManagerSingleton.getInstance(); DependencyTree scanResults = getScanResults(); - if (!getScanResults().isLeaf()) { + if (!scanResults.isLeaf()) { filterManager.collectsFiltersInformation(scanResults); } - issuesTree.addScanResults(getProjectName(), scanResults); + issuesTree.addScanResults(getProjectName(), scanResults); licensesTree.addScanResults(getProjectName(), scanResults); if (isDisposed()) { return; From 1a050be068f5c44c143b381150e5d49f29b2758c Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Sun, 22 Dec 2024 18:23:07 +0200 Subject: [PATCH 13/24] gradle scan works for basic project --- .../jfrog/ide/eclipse/scan/GradleScanManager.java | 13 ++++++++++--- .../jfrog/ide/eclipse/scan/ScanManagersFactory.java | 5 ++++- .../com/jfrog/ide/eclipse/utils/ProjectsMap.java | 2 ++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java index 8b5f557..0e73dd5 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java @@ -29,6 +29,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.Sets; import com.jfrog.ide.common.scan.ComponentPrefix; +import com.jfrog.ide.common.gradle.GradleTreeBuilder; import com.jfrog.ide.eclipse.configuration.PreferenceConstants; import com.jfrog.ide.eclipse.utils.GradleArtifact; @@ -37,6 +38,7 @@ public class GradleScanManager extends ScanManager { private static final String TASK_NAME = "generateDependenciesGraphAsJson"; public static final String GRADLE_INIT_SCRIPT = "dependencies.gradle"; public static final String GRADLESCRIPTDIR = "gradleScript"; + private final GradleTreeBuilder gradleTreeBuilder; private static ObjectMapper objectMapper = new ObjectMapper(); private GradleArtifact gradleArtifact; @@ -45,6 +47,7 @@ public class GradleScanManager extends ScanManager { public GradleScanManager(IProject project) throws IOException { super(project, ComponentPrefix.GAV); getLog().info("Found Gradle project: " + getProjectName()); + gradleTreeBuilder = new GradleTreeBuilder(project.getLocation().toFile().toPath(), System.getenv()); } public static boolean isApplicable(IProject project) { @@ -79,7 +82,7 @@ void refreshDependencies(IProgressMonitor monitor) throws IOException { } @Override - void buildTree() { + void buildTree() throws IOException { DependencyTree rootNode = new DependencyTree(getProjectName()); GeneralInfo generalInfo = new GeneralInfo(); generalInfo.groupId(gradleArtifact.getGroupId()).artifactId(gradleArtifact.getArtifactId()) @@ -89,7 +92,7 @@ void buildTree() { if (ArrayUtils.isNotEmpty(dependencies)) { populateDependenciesTree(rootNode, dependencies); } - setScanResults(rootNode); + setScanResults(gradleTreeBuilder.buildTree(getLog())); } public GradleArtifact getGradleArtifact() { @@ -115,7 +118,11 @@ private void populateDependenciesTree(DependencyTree scanTreeNode, GradleArtifac for (GradleArtifact artifact : gradleArtifacts) { String componentId = getComponentId(artifact); DependencyTree child = new DependencyTree(componentId); - child.setGeneralInfo(new GeneralInfo(componentId, "", "", "Maven")); + String componentName = artifact.getArtifactId(); + child.setGeneralInfo(new GeneralInfo(componentId, componentName, "", "Gradle")); + // set dependency scope +// String componentScope = dependencyChild.getDependency().getScope(); TODO: get scope info +// child.setScopes(Sets.newHashSet(new Scope(componentScope))); scanTreeNode.add(child); populateDependenciesTree(child, artifact.getDependencies()); } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java index eff2593..b78eec0 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java @@ -4,6 +4,7 @@ import java.nio.file.Path; import java.util.Collection; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; @@ -87,6 +88,7 @@ public void startScan(Composite parent, boolean quickScan) { scanManager.scanAndUpdateResults(quickScan, issuesTree, licensesTree, parent); } } + /** * Initialize scan managers list. @@ -100,8 +102,9 @@ public void refreshScanManagers(Composite parent) { IProject[] projects = iworkspace.getRoot().getProjects(); if (projects.length > 0) { try { - // refresh Maven and Gradle managers Set paths = Sets.newHashSet(); + + // refresh Maven and Gradle managers for (IProject project : projects) { if (!project.isOpen()) { Logger.getInstance().info("Project is closed: " + project.getName()); diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java b/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java index 49117f8..983e23f 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java @@ -7,6 +7,8 @@ import org.jfrog.build.extractor.scan.DependencyTree; import org.jfrog.build.extractor.scan.GeneralInfo; +import com.google.common.base.Objects; + /** * Map of projects. Used in the UI to show the projects sorted by project name * and path. From a1a9950e12e94b32dcb8de84936647599fcca753 Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Mon, 23 Dec 2024 22:47:29 +0200 Subject: [PATCH 14/24] add try-catch for gradle and npm scans --- .../ide/eclipse/scan/GradleScanManager.java | 59 +++++++++---------- .../ide/eclipse/scan/NpmScanManager.java | 9 ++- .../jfrog/ide/eclipse/scan/ScanManager.java | 2 +- .../ide/eclipse/scan/ScanManagersFactory.java | 1 - .../jfrog/ide/eclipse/utils/ProjectsMap.java | 1 - 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java index 0e73dd5..dc6debf 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java @@ -31,6 +31,7 @@ import com.jfrog.ide.common.scan.ComponentPrefix; import com.jfrog.ide.common.gradle.GradleTreeBuilder; import com.jfrog.ide.eclipse.configuration.PreferenceConstants; +import com.jfrog.ide.eclipse.log.Logger; import com.jfrog.ide.eclipse.utils.GradleArtifact; public class GradleScanManager extends ScanManager { @@ -60,39 +61,36 @@ public static boolean isApplicable(IProject project) { @Override void refreshDependencies(IProgressMonitor monitor) throws IOException { - this.monitor = monitor; - String rootProjectDir = project.getLocation().toPortableString(); - if (project.getLocation().toFile().isDirectory()) { - rootProjectDir = project.getLocation().addTrailingSeparator().toPortableString(); - } - - String gradleFileNameFullPath = "/gradle/" + GRADLE_INIT_SCRIPT; - ClassLoader classLoader = GradleScanManager.class.getClassLoader(); - // classLoader.getResourceAsStream(gradleFileNameFullPath) will work on all the - // OSes - try (InputStream res = classLoader.getResourceAsStream(gradleFileNameFullPath)) { - String gradleFile = createGradleFile(res); - if (StringUtils.isBlank(gradleFile)) { - getLog().warn("Gradle init script wasn't created."); - return; - } - generateDependenciesGraphAsJsonTask(rootProjectDir, gradleFile); - parseJsonResult(); - } +// this.monitor = monitor; +// String rootProjectDir = project.getLocation().toPortableString(); +// if (project.getLocation().toFile().isDirectory()) { +// rootProjectDir = project.getLocation().addTrailingSeparator().toPortableString(); +// } +// +// String gradleFileNameFullPath = "/gradle/" + GRADLE_INIT_SCRIPT; +// ClassLoader classLoader = GradleScanManager.class.getClassLoader(); +// // classLoader.getResourceAsStream(gradleFileNameFullPath) will work on all the +// // OSes +// try (InputStream res = classLoader.getResourceAsStream(gradleFileNameFullPath)) { +// String gradleFile = createGradleFile(res); +// if (StringUtils.isBlank(gradleFile)) { +// getLog().warn("Gradle init script wasn't created."); +// return; +// } +// generateDependenciesGraphAsJsonTask(rootProjectDir, gradleFile); +// parseJsonResult(); +// } } @Override - void buildTree() throws IOException { - DependencyTree rootNode = new DependencyTree(getProjectName()); - GeneralInfo generalInfo = new GeneralInfo(); - generalInfo.groupId(gradleArtifact.getGroupId()).artifactId(gradleArtifact.getArtifactId()) - .version(gradleArtifact.getVersion()); - rootNode.setGeneralInfo(generalInfo); - GradleArtifact[] dependencies = gradleArtifact.getDependencies(); - if (ArrayUtils.isNotEmpty(dependencies)) { - populateDependenciesTree(rootNode, dependencies); + void buildTree() throws IOException { + try { + setScanResults(gradleTreeBuilder.buildTree(getLog())); + } + catch (IOException ex) { + Logger.getInstance().error("Could not scan project: " + getProjectName() + ". Reason is: " + ex.getMessage()); } - setScanResults(gradleTreeBuilder.buildTree(getLog())); + } public GradleArtifact getGradleArtifact() { @@ -120,9 +118,6 @@ private void populateDependenciesTree(DependencyTree scanTreeNode, GradleArtifac DependencyTree child = new DependencyTree(componentId); String componentName = artifact.getArtifactId(); child.setGeneralInfo(new GeneralInfo(componentId, componentName, "", "Gradle")); - // set dependency scope -// String componentScope = dependencyChild.getDependency().getScope(); TODO: get scope info -// child.setScopes(Sets.newHashSet(new Scope(componentScope))); scanTreeNode.add(child); populateDependenciesTree(child, artifact.getDependencies()); } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java index 98aadd7..6436f18 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.jfrog.ide.common.npm.NpmTreeBuilder; import com.jfrog.ide.common.scan.ComponentPrefix; +import com.jfrog.ide.eclipse.log.Logger; /** * @author yahavi @@ -29,6 +30,12 @@ void refreshDependencies(IProgressMonitor monitor) throws IOException { @Override void buildTree() throws CoreException, JsonProcessingException, IOException { - setScanResults(npmTreeBuilder.buildTree(getLog(), false)); + try { + setScanResults(npmTreeBuilder.buildTree(getLog(), false)); + } + catch (IOException ex) { + Logger.getInstance().error("Could not scan project: " + getProjectName() + ". Reason is: " + ex.getMessage()); + } } + } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java index 0c4e455..fd6da0d 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java @@ -120,7 +120,7 @@ public void run(IProgressMonitor monitor) throws CoreException { } ProgressIndicator indicator = new ProgressIndicatorImpl("Xray Scan - " + getProjectName(), monitor); scanAndCacheArtifacts(indicator, quickScan); - addXrayInfoToTree(getScanResults()); // TODO: check why not getting inside + addXrayInfoToTree(getScanResults()); setScanResults(); } catch (IOException e) { Logger.getInstance().error(e.getMessage(), e); diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java index b78eec0..b4152c2 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java @@ -4,7 +4,6 @@ import java.nio.file.Path; import java.util.Collection; import java.util.List; -import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java b/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java index 983e23f..e350fe6 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java @@ -7,7 +7,6 @@ import org.jfrog.build.extractor.scan.DependencyTree; import org.jfrog.build.extractor.scan.GeneralInfo; -import com.google.common.base.Objects; /** * Map of projects. Used in the UI to show the projects sorted by project name From 8d30cd3a751c080c020faf06542365ef0d87402f Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Tue, 24 Dec 2024 13:56:26 +0200 Subject: [PATCH 15/24] updated severity icons --- bundle/icons/critical.png | Bin 0 -> 425 bytes bundle/icons/default.png | Bin 207 -> 425 bytes bundle/icons/high.png | Bin 271 -> 396 bytes bundle/icons/low.png | Bin 271 -> 290 bytes bundle/icons/medium.png | Bin 273 -> 417 bytes bundle/icons/normal.png | Bin 286 -> 435 bytes bundle/icons/unknown.png | Bin 277 -> 426 bytes .../ide/eclipse/scan/GradleScanManager.java | 21 +----------------- 8 files changed, 1 insertion(+), 20 deletions(-) create mode 100644 bundle/icons/critical.png diff --git a/bundle/icons/critical.png b/bundle/icons/critical.png new file mode 100644 index 0000000000000000000000000000000000000000..9e61d5cad9abd144bb94bad9859007be6b33a408 GIT binary patch literal 425 zcmV;a0apHrP)Px$V@X6oR5%f(ld(<$VGPIHf|@8|faqY1VRg_!Cyf{e7JLU+6BFM-UI14{AHZGR zHJUiO5C<1yqER^vU~7P%Fs2#Ki2Xq&G)>5UAN?LEi>KbUzV z#M_ym$u-)nRLXKWN+AFc;eISmxzL_?x?bth3>4&TP7rh%l8uJD5Y&}bkLun%*m|lt zOkH6JW^>9e+z)9|D61aT`&T)$x?Ym+EeGL|S{RS*HGcgwA!0t`)GkH_|5f+~@h*8S TxIe-Q00000NkvXXu0mjf+n=<( literal 0 HcmV?d00001 diff --git a/bundle/icons/default.png b/bundle/icons/default.png index b02ac09dce1a7b6a8d3d176031424f43b039f270..9e61d5cad9abd144bb94bad9859007be6b33a408 100755 GIT binary patch literal 425 zcmV;a0apHrP)Px$V@X6oR5%f(ld(<$VGPIHf|@8|faqY1VRg_!Cyf{e7JLU+6BFM-UI14{AHZGR zHJUiO5C<1yqER^vU~7P%Fs2#Ki2Xq&G)>5UAN?LEi>KbUzV z#M_ym$u-)nRLXKWN+AFc;eISmxzL_?x?bth3>4&TP7rh%l8uJD5Y&}bkLun%*m|lt zOkH6JW^>9e+z)9|D61aT`&T)$x?Ym+EeGL|S{RS*HGcgwA!0t`)GkH_|5f+~@h*8S TxIe-Q00000NkvXXu0mjf+n=<( literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucLCF%=h?3y^w370~qEv>0#LT=By}Z;C1rt33 zJwwyG3IF_oitIgI978mMlYjjGZ+|$Bjcva;50CwSV}_j$JW0(*9EuV=XRuhYoitQ< v?Q&efk}XH*#EcD0O<@8hDs}n)(is>kxvTyjne6)jXcU8|tDnm{r-UW|oIX9W diff --git a/bundle/icons/high.png b/bundle/icons/high.png index ef73c610cd6e158b0088daf74841b765e7b97895..14dfcb9e3e13cbba2886f680a7ee549e2315503d 100755 GIT binary patch literal 396 zcmV;70dxL|P)Px$MoC0LR5%f(Q?W_|K@go;_D%?-Ol1*8%YYvsSctV&V(&Kywug{H$T#F4Of43H z_z70AxWdXt6a>A?jx%?=>t?+LAp^(m%)IwzZg&=7L&KO)w}<`jPq^a5Dd+ZWen|kc zyayA!UVMa{HG!%)IyR=BGGG{jf_wj9RVC7!j*DZvCaK z?JXeOb%M0M$S~_XAMR=91!Th5DPs|3U{EO<#Bsq|&hO!DG)PiGCQBwv)WuI&8BU>K q{*0}EOfnnxsu-7iOo>AO5B~r{EOQ>uxVc>b0000f4u@pObhHwBu4M$1`kk47*5n0T@ zAdn8ijO#AEo&gk;EOCt}3C>R|DNig)WhgH%*UQYyE>2D?NY%?PN}v7CMhd8?$J50z zL}KdPenY-P20X6wb=O_qGSRA(VXJTfmjx%Yt%$LZxI)QO4MXphlP+}HNB+03KmB2S z)A!sD`*i>MW=8aciyA(d@oUmnQ{VQR$#FM!3cS1T^Vv#zdgRwhZrm1@<_xt(Sru1H z|1%$3#CRa#%z^Y!S%cft6fXFldz<(#D#ZUlHLFV3oW|Qx+g9c)-j( m!NNh|mBfOq4N?pO2@EoMP7k7_DmMcC!{F)a=d#Wzp$Py#(`+vQ literal 271 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u@pObhHwBu4M$1`kk47*5n0T@ zAdn8ijO#AEo&gk;EOCt}3C>R|DNig)WhgH%*UQYyE>2D?NY%?PN}v7CMhd8?$J50z zL}KdPenX)q0|D3jX*qj&MGFr(ES=}%m$a~b)3FDJHZ3zQ9bq~$BjD%m|M&0TjrpSq)om-x!+)ryO#8su1#}mK Mr>mdKI;Vst0IarW!~g&Q diff --git a/bundle/icons/medium.png b/bundle/icons/medium.png index 2aae8b9154a9c27e6e85d7e3fb26930256cbcc09..05c75df774323a58e9727cef33083303d0498dcd 100755 GIT binary patch literal 417 zcmV;S0bc%zP)Px$TS-JgR5%f}Qok=mK@k3y3lbD6G#sH(h(sZmD-?QBC`3bZoe;HXNT@Dxe}F$i zLZkDe5S@fdualRkoa8dT+4pwe?!9}J*yO#P@0)LCXJ!}p&m|8yk~<{wi0!g-OqoOO zu>ipf{S_D_7{t6;!DqL=ubc2#aAAX$5RBm)C*BtrJu6_z>*(Mr(5cyBElZ}3*N`t% zAa59;w3&(a%qklITKxLSYgN%IBw&{ZRLn&x2Lx-J&4z=zM+xK!4;(t|6Y$QL+3l`#*xjINcfoYTgYV-R6UzAn%-rIa z<20hihjh!t)fD>w2(R^AkqzKrwisOZ?%cR!x0{4FIpwV#&TKI~QE=+%*cc|%!4AbV zk+7~d_A8kqDF~DhG$?BH^rikUeIyX={hFstmP(6`AEvKy5`SI4!In@|jnkLi00000 LNkvXXu0mjf75cm~ literal 273 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u@pObhHwBu4M$1`kk47*5n0T@ zAdn8ijO#AEo&gk;EOCt}3C>R|DNig)WhgH%*UQYyE>2D?NY%?PN}v7CMhd8?&(p;* zL}KdP{*8i%3Px$ZAnByR5%f(Q@ct-K@gqUB&LWWiXw=RB7#+ZKzx8CZPHu%4St5-;15`t!b(Ih zc9voxn8HF!MZ_YxxjW9;%`Ul@1R-uSyR+wMLiI^d+%vrzF(>`Q&a$d*X$_0)z>#2hIkv+2?VgSOz#y_X)5!gNY+TVa@Zh% zKF15;Wt(Li_5Jd(sV=s{%SE!DU%>Gx=#WGKlG=#m>MgOmlnvGqc99G$GxuPf045Br zfx|B^l4ZkW8W~u}QE(iZc?T&L5tD@p%SRF-8e2cgaSGv$5d>)bOxkDdf@>8DhMcE; drofxq{sJG4sD5q1|4#q_002ovPDHLkV1n6{z&`*0 literal 286 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u@pObhHwBu4M$1`kk47*5n0T@ zz;^_M8K-LVNdpBXOI#yLg7ec#$`gxH8OqDc^)mCai<1)zQuXqS(r3T3kpe23?djqe zA~Ci1+(F(Z2Z7dy^)M+TeFYPv{6X(_M<$8D#f`D45$5` zFeEUzl?q?%ZLeRH9Pux$N^;d)&xW)n+gSNGwrd{k;hVzogk_6E_p6Jg-Cs+~>&{f< apWxPx$WJyFpR5%f(k~>brKoEv^HV7m{kSJ-ONSg!D!UgCkDeN+W*nv|Zh#gQ$yP%{@ zjiBWKsSph`lt>ARcx8wEZSTslV<}QnWXHQR-@JYymi$pMzTdywn0}8urD$KjHHmng zS-fa_P~W0U*LBDFm>B?qf4@f0g2i^;$=D?5Ro2Kk@tp^ACymkT-R`tnN1syAg}E!9 zEO=KbzP}0L1M`*ukeUB}p2BYIpPsp)B=U_z@nmLFQ;wr3s^cvIpy#A)rMe42bS2{t zKDU5uU}-W9xxR`#R3fD8q?hG?B097HZ8Y;Pia7wp>o`F*gc}xsRpkM&0YN)e5Iu^C z1!Q|JGBhQf2_SO@JG20849d~jO~qiP8{RYyeB2|22uP U3;lcf4u@pObhHwBu4M$1`kk47*5n0T@ zz;^_M8K-LVNdpBXOI#yLg7ec#$`gxH8OqDc^)mCai<1)zQuXqS(r3T3kpe23%XpTzdKX z<-dboPxj7;d_3p1Yl^*lb4Q8cv5g&R*DBuYANcnA!j$5?V6Sl2f^%QFg$^96u4f5o zSe4fqa>U*yyYPo%RP0^G%S|QWSDgiudy>!XWIcBvdEVqz@0>Wci@vX|VBGDlAn>t+ Rp$zCc22WQ%mvv4FO#pHEWpMxi diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java index dc6debf..cbb4200 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java @@ -11,7 +11,6 @@ import java.util.Set; import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; import org.eclipse.buildship.core.GradleDistribution; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; @@ -61,25 +60,6 @@ public static boolean isApplicable(IProject project) { @Override void refreshDependencies(IProgressMonitor monitor) throws IOException { -// this.monitor = monitor; -// String rootProjectDir = project.getLocation().toPortableString(); -// if (project.getLocation().toFile().isDirectory()) { -// rootProjectDir = project.getLocation().addTrailingSeparator().toPortableString(); -// } -// -// String gradleFileNameFullPath = "/gradle/" + GRADLE_INIT_SCRIPT; -// ClassLoader classLoader = GradleScanManager.class.getClassLoader(); -// // classLoader.getResourceAsStream(gradleFileNameFullPath) will work on all the -// // OSes -// try (InputStream res = classLoader.getResourceAsStream(gradleFileNameFullPath)) { -// String gradleFile = createGradleFile(res); -// if (StringUtils.isBlank(gradleFile)) { -// getLog().warn("Gradle init script wasn't created."); -// return; -// } -// generateDependenciesGraphAsJsonTask(rootProjectDir, gradleFile); -// parseJsonResult(); -// } } @Override @@ -112,6 +92,7 @@ private String getComponentId(GradleArtifact gradleArtifact) { * Populate root modules DependencyTree with issues, licenses and general info * from the scan cache. */ + @SuppressWarnings("unused") private void populateDependenciesTree(DependencyTree scanTreeNode, GradleArtifact[] gradleArtifacts) { for (GradleArtifact artifact : gradleArtifacts) { String componentId = getComponentId(artifact); From 316fd0730a04c2eaea2f4d01cbfd54d57d83e088 Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Tue, 24 Dec 2024 15:41:58 +0200 Subject: [PATCH 16/24] revert .classpath file --- bundle/.classpath | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/bundle/.classpath b/bundle/.classpath index 03dbd71..0d72691 100644 --- a/bundle/.classpath +++ b/bundle/.classpath @@ -1,22 +1,16 @@ - + - - - - - - - - - + + + - + \ No newline at end of file From 23023ce1d0ae1f73f4d4f8c7e2fac9a33938dd24 Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Tue, 24 Dec 2024 16:58:42 +0200 Subject: [PATCH 17/24] change tycho version to 1.6.0 --- bundle/pom.xml | 4 ---- jfrog-eclipse-plugin.iml | 9 --------- pom.xml | 4 ++-- 3 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 jfrog-eclipse-plugin.iml diff --git a/bundle/pom.xml b/bundle/pom.xml index 7b641d5..901e25e 100644 --- a/bundle/pom.xml +++ b/bundle/pom.xml @@ -20,10 +20,6 @@ releases https://releases.jfrog.io/artifactory/oss-releases - - eclipse-p2-releases - https://download.eclipse.org/tools/tycho/releases/ - diff --git a/jfrog-eclipse-plugin.iml b/jfrog-eclipse-plugin.iml deleted file mode 100644 index 48426fc..0000000 --- a/jfrog-eclipse-plugin.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 3dd15af..45cce3c 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ pom - 3.0.3 + 1.6.0 UTF-8 @@ -41,7 +41,7 @@ target-platform-configuration ${tycho.version} - consider + ${configuration-pomDependencies} com.jfrog.ide.eclipse.releng From 75a1e7328ef7f38650ca51506000bfaa96c4b72b Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Tue, 24 Dec 2024 17:50:17 +0200 Subject: [PATCH 18/24] tycho v1.3.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 45cce3c..5a03e43 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ pom - 1.6.0 + 1.3.0 UTF-8 @@ -41,7 +41,7 @@ target-platform-configuration ${tycho.version} - ${configuration-pomDependencies} + consider com.jfrog.ide.eclipse.releng From 7c6a123515eed189d0169ae9f884396dfdf7e18c Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Wed, 25 Dec 2024 13:55:58 +0200 Subject: [PATCH 19/24] remove comment --- .../jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java index 7f1e759..2b56ebf 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java @@ -56,7 +56,7 @@ private String getValue(String key) { public ProxyConfiguration getProxyConfForTargetUrl(String xrayUrl) { xrayUrl = StringUtils.defaultIfBlank(xrayUrl, getUrl()); IProxyService service = ProxyManager.getProxyManager(); - IProxyData[] proxyData = service.select(URI.create(xrayUrl)); // TODO: check why we get error msg: WinHttp.GetProxyForUrl for pac failed with error 'The handle is invalid. + IProxyData[] proxyData = service.select(URI.create(xrayUrl)); if (ArrayUtils.isEmpty(proxyData)) { return null; } From ea528b95e3c84df7a8fafb19f2582517cc7938a2 Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Thu, 26 Dec 2024 11:10:57 +0200 Subject: [PATCH 20/24] fixes from cr --- .../configuration/XrayServerConfigImpl.java | 24 +++++++++---------- .../jfrog/ide/eclipse/scan/ScanManager.java | 2 +- .../ide/eclipse/scan/ScanManagersFactory.java | 1 - .../ui/issues/ComponentIssueTable.java | 1 - .../jfrog/ide/eclipse/utils/ProjectsMap.java | 1 - 5 files changed, 12 insertions(+), 17 deletions(-) diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java index 2b56ebf..54ed541 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java @@ -71,40 +71,38 @@ public ProxyConfiguration getProxyConfForTargetUrl(String xrayUrl) { return proxyConfig; } + @Override + public String getXrayUrl() { + String url = getUrl(); + String xrayUrl = url.endsWith("/") ? url + "xray" : url + "/xray"; + return xrayUrl; + } + @Override public String getArtifactoryUrl() { - // TODO Auto-generated method stub - return null; + String url = getUrl(); + String artifactoryUrl = url.endsWith("/") ? url + "artifactory" : url + "/artifactory"; + return artifactoryUrl; } @Override public int getConnectionRetries() { - // TODO Auto-generated method stub return 0; } @Override public int getConnectionTimeout() { - // TODO Auto-generated method stub return 0; } @Override public SSLContext getSslContext() { - // TODO Auto-generated method stub return null; } - @Override - public String getXrayUrl() { - String url = getUrl(); - String xrayUrl = url.endsWith("/") ? url + "xray" : url + "/xray"; - return xrayUrl; - } - @Override public boolean isInsecureTls() { - // TODO Auto-generated method stub return false; } + } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java index fd6da0d..fae4d74 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java @@ -136,7 +136,7 @@ private void setScanResults() { filterManager.collectsFiltersInformation(scanResults); } - issuesTree.addScanResults(getProjectName(), scanResults); + issuesTree.addScanResults(getProjectName(), scanResults); licensesTree.addScanResults(getProjectName(), scanResults); if (isDisposed()) { return; diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java index b4152c2..910d390 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java @@ -88,7 +88,6 @@ public void startScan(Composite parent, boolean quickScan) { } } - /** * Initialize scan managers list. * diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java index 70f36e6..6d0890f 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java @@ -134,5 +134,4 @@ public void updateIssuesTable(List selectedNodes) { issuesSet.stream().sorted(Comparator.comparing(issue -> ((Issue) issue).getSeverity()).reversed()) .collect(Collectors.toList())); } - } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java b/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java index e350fe6..49117f8 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/utils/ProjectsMap.java @@ -7,7 +7,6 @@ import org.jfrog.build.extractor.scan.DependencyTree; import org.jfrog.build.extractor.scan.GeneralInfo; - /** * Map of projects. Used in the UI to show the projects sorted by project name * and path. From 0df8825d357f22975db5f2dc53cabed34224fedc Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Thu, 26 Dec 2024 22:20:09 +0200 Subject: [PATCH 21/24] fixes from CR --- .../eclipse/configuration/PreferenceConstants.java | 4 ++++ .../eclipse/configuration/TestConnectionButton.java | 2 +- .../eclipse/configuration/XrayServerConfigImpl.java | 6 ++++-- .../jfrog/ide/eclipse/scan/GradleScanManager.java | 9 ++------- .../jfrog/ide/eclipse/scan/MavenScanManager.java | 2 +- .../com/jfrog/ide/eclipse/scan/NpmScanManager.java | 8 +------- .../com/jfrog/ide/eclipse/scan/ScanManager.java | 13 ++++--------- .../jfrog/ide/eclipse/scan/ScanManagersFactory.java | 2 +- .../ide/eclipse/ui/issues/ComponentIssueTable.java | 7 ++----- 9 files changed, 20 insertions(+), 33 deletions(-) diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java index 5274426..b65611f 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java @@ -12,6 +12,10 @@ public class PreferenceConstants { public static final String XRAY_URL = "URL"; public static final String XRAY_USERNAME = "Username"; public static final String XRAY_PASSWORD = "Password"; + + // Connection constants + public static final int CONNECTION_TIMEOUT = 60; + public static final int CONNECTION_RETRIES = 5; // Eclipse Buildship plugins public static final String GRADLE_PLUGIN_QUALIFIER = "org.eclipse.buildship.core"; diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java index c7de58d..859fb1c 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java @@ -91,7 +91,7 @@ private Xray createXrayClient() { .setPassword(passwordEditor.getStringValue()) .setUserAgent(USER_AGENT) .setInsecureTls(false) - .setSslContext(serverConfig.getSslContext()) + .setSslContext(serverConfig.getSslContext()) .setProxyConfiguration(serverConfig.getProxyConfForTargetUrl(xrayUrl)) .setLog(Logger.getInstance()) .build(); diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java index 54ed541..54d2119 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java @@ -87,21 +87,23 @@ public String getArtifactoryUrl() { @Override public int getConnectionRetries() { - return 0; + return PreferenceConstants.CONNECTION_RETRIES; } @Override public int getConnectionTimeout() { - return 0; + return PreferenceConstants.CONNECTION_TIMEOUT; } @Override public SSLContext getSslContext() { + // TODO: implement return null; } @Override public boolean isInsecureTls() { + // TODO: implement return false; } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java index cbb4200..6e9ea64 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/GradleScanManager.java @@ -58,17 +58,13 @@ public static boolean isApplicable(IProject project) { } } - @Override - void refreshDependencies(IProgressMonitor monitor) throws IOException { - } - @Override void buildTree() throws IOException { try { setScanResults(gradleTreeBuilder.buildTree(getLog())); } catch (IOException ex) { - Logger.getInstance().error("Could not scan project: " + getProjectName() + ". Reason is: " + ex.getMessage()); + Logger.getInstance().warn("Could not scan project: " + getProjectName() + ". Reason is: " + ex.getMessage()); } } @@ -97,8 +93,7 @@ private void populateDependenciesTree(DependencyTree scanTreeNode, GradleArtifac for (GradleArtifact artifact : gradleArtifacts) { String componentId = getComponentId(artifact); DependencyTree child = new DependencyTree(componentId); - String componentName = artifact.getArtifactId(); - child.setGeneralInfo(new GeneralInfo(componentId, componentName, "", "Gradle")); + child.setGeneralInfo(new GeneralInfo(componentId, artifact.getArtifactId(), "", "Gradle")); scanTreeNode.add(child); populateDependenciesTree(child, artifact.getDependencies()); } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java index 90de2ee..7e837d7 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java @@ -51,7 +51,6 @@ public static boolean isApplicable(IProject project) { } } - @Override void refreshDependencies(IProgressMonitor monitor) throws CoreException { IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry().getProject(project); if (facade == null) { @@ -67,6 +66,7 @@ void refreshDependencies(IProgressMonitor monitor) throws CoreException { @Override void buildTree() throws CoreException { + refreshDependencies(getMonitor()); if (mavenProject == null) { return; } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java index 6436f18..1dacb42 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/NpmScanManager.java @@ -4,7 +4,6 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; import com.fasterxml.jackson.core.JsonProcessingException; import com.jfrog.ide.common.npm.NpmTreeBuilder; @@ -24,10 +23,6 @@ public class NpmScanManager extends ScanManager { npmTreeBuilder = new NpmTreeBuilder(project.getFullPath().toFile().toPath(), System.getenv()); } - @Override - void refreshDependencies(IProgressMonitor monitor) throws IOException { - } - @Override void buildTree() throws CoreException, JsonProcessingException, IOException { try { @@ -36,6 +31,5 @@ void buildTree() throws CoreException, JsonProcessingException, IOException { catch (IOException ex) { Logger.getInstance().error("Could not scan project: " + getProjectName() + ". Reason is: " + ex.getMessage()); } - } - + } } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java index fae4d74..a0a1c6e 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java @@ -43,14 +43,6 @@ public abstract class ScanManager extends ScanManagerBase { Files.createDirectories(HOME_PATH); } - /** - * Refresh project dependencies. - * - * @throws IOException - * @throws CoreException - */ - abstract void refreshDependencies(IProgressMonitor monitor) throws IOException, CoreException; - /** * Collect and return {@link Components} to be scanned by JFrog Xray. * Implementation should be project type specific. @@ -77,6 +69,10 @@ public IProject getIProject() { public void setMonitor(IProgressMonitor monitor) { this.monitor = monitor; } + + public IProgressMonitor getMonitor(){ + return monitor; + } /** * Schedule a dependency scan. @@ -113,7 +109,6 @@ public void run(IProgressMonitor monitor) throws CoreException { } getLog().info("Performing scan for " + getProjectName()); try { - refreshDependencies(monitor); buildTree(); if (isDisposed() || getScanResults() == null) { return; diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java index 910d390..bbba777 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java @@ -87,7 +87,7 @@ public void startScan(Composite parent, boolean quickScan) { scanManager.scanAndUpdateResults(quickScan, issuesTree, licensesTree, parent); } } - + /** * Initialize scan managers list. * diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java index 6d0890f..7ff44a8 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java @@ -26,7 +26,6 @@ import org.jfrog.build.extractor.scan.Severity; import com.jfrog.ide.common.filter.FilterManager; -import com.jfrog.ide.eclipse.scan.ScanManagersFactory; import com.jfrog.ide.eclipse.ui.FilterManagerSingleton; import com.jfrog.ide.eclipse.ui.IconManager; import com.jfrog.ide.eclipse.ui.Panel; @@ -126,10 +125,8 @@ private TableViewerColumn createTableViewerColumn(String title, int weight, Colu public void updateIssuesTable(List selectedNodes) { Set issuesSet = Sets.newHashSet(); FilterManager filterManager = FilterManagerSingleton.getInstance(); - ScanManagersFactory.getInstance().getScanManagers().forEach(scanManager -> { - issuesSet.addAll(filterManager.getFilteredScanIssues(selectedNodes)); - }); - + issuesSet.addAll(filterManager.getFilteredScanIssues(selectedNodes)); + tableViewer.setInput( issuesSet.stream().sorted(Comparator.comparing(issue -> ((Issue) issue).getSeverity()).reversed()) .collect(Collectors.toList())); From e8d1e4a37c8b5394ba7a322997ab6f5572159e25 Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Sun, 29 Dec 2024 15:37:58 +0200 Subject: [PATCH 22/24] CR fixes --- bundle/pom.xml | 4 ++++ .../jfrog/ide/eclipse/configuration/TestConnectionButton.java | 2 -- .../jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java | 2 +- .../java/com/jfrog/ide/eclipse/scan/MavenScanManager.java | 1 - .../src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java | 1 - .../com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java | 1 - 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/bundle/pom.xml b/bundle/pom.xml index 901e25e..6e45a7d 100644 --- a/bundle/pom.xml +++ b/bundle/pom.xml @@ -20,6 +20,10 @@ releases https://releases.jfrog.io/artifactory/oss-releases + + gradle + https://repo.gradle.org/gradle/libs-releases + diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java index 859fb1c..0411671 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/TestConnectionButton.java @@ -90,8 +90,6 @@ private Xray createXrayClient() { .setUserName(usernameEditor.getStringValue()) .setPassword(passwordEditor.getStringValue()) .setUserAgent(USER_AGENT) - .setInsecureTls(false) - .setSslContext(serverConfig.getSslContext()) .setProxyConfiguration(serverConfig.getProxyConfForTargetUrl(xrayUrl)) .setLog(Logger.getInstance()) .build(); diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java index 54d2119..718365a 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java @@ -97,7 +97,7 @@ public int getConnectionTimeout() { @Override public SSLContext getSslContext() { - // TODO: implement + // This plugin does not use SSL connection return null; } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java index 7e837d7..9d7a6ba 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/MavenScanManager.java @@ -40,7 +40,6 @@ public MavenScanManager(IProject project, Composite parent) throws IOException { super(project, ComponentPrefix.GAV); getLog().info("Found Maven project: " + getProjectName()); this.parent = parent; - } public static boolean isApplicable(IProject project) { diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java index a0a1c6e..c23b3f9 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManager.java @@ -130,7 +130,6 @@ private void setScanResults() { if (!scanResults.isLeaf()) { filterManager.collectsFiltersInformation(scanResults); } - issuesTree.addScanResults(getProjectName(), scanResults); licensesTree.addScanResults(getProjectName(), scanResults); if (isDisposed()) { diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java index 7ff44a8..31acb9a 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/ui/issues/ComponentIssueTable.java @@ -126,7 +126,6 @@ public void updateIssuesTable(List selectedNodes) { Set issuesSet = Sets.newHashSet(); FilterManager filterManager = FilterManagerSingleton.getInstance(); issuesSet.addAll(filterManager.getFilteredScanIssues(selectedNodes)); - tableViewer.setInput( issuesSet.stream().sorted(Comparator.comparing(issue -> ((Issue) issue).getSeverity()).reversed()) .collect(Collectors.toList())); From 7ddae208fdbaa305f097590a35ed065431b91084 Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Sun, 29 Dec 2024 18:18:07 +0200 Subject: [PATCH 23/24] CR fixes --- .../jfrog/ide/eclipse/configuration/PreferenceConstants.java | 4 ---- .../java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java index b65611f..27ecab8 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java @@ -20,8 +20,4 @@ public class PreferenceConstants { // Eclipse Buildship plugins public static final String GRADLE_PLUGIN_QUALIFIER = "org.eclipse.buildship.core"; public static final String GRADLE_DISTRIBUTION = "gradle.distribution"; - - // Default exluded paths pattern - public static final String DEFAULT_EXCLUSIONS = "**/*{.git,test,node_modules,target}*"; - } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java index bbba777..06abd06 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java @@ -118,7 +118,7 @@ public void refreshScanManagers(Composite parent) { } // refresh Npm manager - PackageFileFinder packageFileFinder = new PackageFileFinder(paths, PreferenceConstants.DEFAULT_EXCLUSIONS, Logger.getInstance()); + PackageFileFinder packageFileFinder = new PackageFileFinder(paths, "", Logger.getInstance()); Set packageJsonDirs = packageFileFinder.getNpmPackagesFilePairs(); for (String dir : packageJsonDirs) { IProject npmProject = new NpmProject(dir, iworkspace); From 02cbd22f6ca0a13d1e3a465a60565299542ff7e0 Mon Sep 17 00:00:00 2001 From: kerenr-jfrog Date: Tue, 31 Dec 2024 12:08:09 +0200 Subject: [PATCH 24/24] final fixes from CR --- .../ide/eclipse/configuration/PreferenceConstants.java | 2 +- .../ide/eclipse/configuration/XrayServerConfigImpl.java | 6 +++--- .../com/jfrog/ide/eclipse/scan/ScanManagersFactory.java | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java index 27ecab8..4672d5a 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/PreferenceConstants.java @@ -14,7 +14,7 @@ public class PreferenceConstants { public static final String XRAY_PASSWORD = "Password"; // Connection constants - public static final int CONNECTION_TIMEOUT = 60; + public static final int CONNECTION_TIMEOUT_MILLISECONDS = 300 * 1000; public static final int CONNECTION_RETRIES = 5; // Eclipse Buildship plugins diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java index 718365a..ef442a4 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/configuration/XrayServerConfigImpl.java @@ -92,18 +92,18 @@ public int getConnectionRetries() { @Override public int getConnectionTimeout() { - return PreferenceConstants.CONNECTION_TIMEOUT; + return PreferenceConstants.CONNECTION_TIMEOUT_MILLISECONDS; } @Override public SSLContext getSslContext() { - // This plugin does not use SSL connection + // This method is not used by the plug-in. return null; } @Override public boolean isInsecureTls() { - // TODO: implement + // This method is not used by the plug-in. return false; } diff --git a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java index 06abd06..8b0b8f2 100644 --- a/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java +++ b/bundle/src/main/java/com/jfrog/ide/eclipse/scan/ScanManagersFactory.java @@ -24,7 +24,6 @@ import com.jfrog.ide.eclipse.ui.issues.IssuesTree; import com.jfrog.ide.eclipse.ui.licenses.ComponentLicenseDetails; import com.jfrog.ide.eclipse.ui.licenses.LicensesTree; -import com.jfrog.ide.eclipse.configuration.PreferenceConstants; /** * @author yahavi