mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Maven: do not try to index local repository if it doesn't exist
This commit is contained in:
+10
-6
@@ -132,12 +132,16 @@ public class Maven2ServerIndexerImpl extends MavenRemoteObject implements MavenS
|
||||
|
||||
try {
|
||||
if (isLocal(index)) {
|
||||
indicator.setIndeterminate(true);
|
||||
try {
|
||||
myIndexer.scan(index, new MyScanningListener(indicator), false);
|
||||
}
|
||||
finally {
|
||||
indicator.setIndeterminate(false);
|
||||
File repository = index.getRepository();
|
||||
|
||||
if (repository != null && repository.exists()) {
|
||||
indicator.setIndeterminate(true);
|
||||
try {
|
||||
myIndexer.scan(index, new MyScanningListener(indicator), false);
|
||||
}
|
||||
finally {
|
||||
indicator.setIndeterminate(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -84,6 +84,13 @@ public class MavenIndicesTest extends MavenIndicesTestCase {
|
||||
assertUnorderedElementsAreEqual(i.getGroupIds(), "junit");
|
||||
}
|
||||
|
||||
public void testCreatingAndUpdatingLocalWhenNoDirectory() throws Exception {
|
||||
MavenIndex i = myIndices.add("id", myRepositoryHelper.getTestDataPath("do_not_exist"), MavenIndex.Kind.LOCAL);
|
||||
myIndices.updateOrRepair(i, true, getMavenGeneralSettings(), EMPTY_MAVEN_PROCESS);
|
||||
|
||||
assertUnorderedElementsAreEqual(i.getGroupIds());
|
||||
}
|
||||
|
||||
public void testCreatingSeveral() throws Exception {
|
||||
MavenIndex i1 = myIndices.add("id1", myRepositoryHelper.getTestDataPath("local1"), MavenIndex.Kind.LOCAL);
|
||||
MavenIndex i2 = myIndices.add("id2", myRepositoryHelper.getTestDataPath("local2"), MavenIndex.Kind.LOCAL);
|
||||
|
||||
Reference in New Issue
Block a user