Author: snjeza
Date: 2012-05-09 15:15:33 -0400 (Wed, 09 May 2012)
New Revision: 40883
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/wizard/ConfigureMavenRepositoriesWizardPage.java
Log:
JBIDE-11793 - Repository Configurator Wizard should ignore local maven repository during
search
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/wizard/ConfigureMavenRepositoriesWizardPage.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/wizard/ConfigureMavenRepositoriesWizardPage.java 2012-05-09
19:10:10 UTC (rev 40882)
+++
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/wizard/ConfigureMavenRepositoriesWizardPage.java 2012-05-09
19:15:33 UTC (rev 40883)
@@ -10,6 +10,7 @@
import java.util.List;
import org.apache.maven.cli.MavenCli;
+import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.settings.Activation;
import org.apache.maven.settings.Profile;
import org.apache.maven.settings.Repository;
@@ -76,6 +77,8 @@
private List<Repository> selectedIncludedRepositories = new
ArrayList<Repository>();
private List<Repository> selectedAvailableRepositories = new
ArrayList<Repository>();
private ListViewer availableRepositoriesViewer;
+
+ private String localRepository;
public ConfigureMavenRepositoriesWizardPage() {
super(PAGE_NAME);
@@ -89,6 +92,26 @@
}
}
+ private String getLocalRepository() {
+ if (localRepository == null) {
+ String userSettings = getUserSettings();
+ String globalSettings = MavenPlugin.getMavenRuntimeManager()
+ .getGlobalSettingsFile();
+ try {
+ Settings settings = maven.buildSettings(globalSettings,
+ userSettings);
+ localRepository = settings.getLocalRepository();
+ if (localRepository == null) {
+ localRepository = RepositorySystem.defaultUserLocalRepository
+ .getAbsolutePath();
+ }
+ } catch (CoreException e) {
+ Activator.log(e);
+ }
+ }
+ return localRepository;
+ }
+
public void createControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(1, false));
@@ -398,6 +421,10 @@
private void searchDir(List<Repository> list, File directory, int depth,
IProgressMonitor monitor) {
+ String localRepository = getLocalRepository();
+ if (localRepository != null &&
localRepository.trim().equals(directory.getAbsolutePath())) {
+ return;
+ }
monitor.setTaskName("Searching " + directory.getAbsolutePath());
File comFile = new File(directory, "com");
if (comFile.isDirectory()) { //$NON-NLS-1$
Show replies by date