Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.m2e.core.ui/src/org/eclipse')
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/Messages.java2
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties1
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java10
3 files changed, 12 insertions, 1 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/Messages.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/Messages.java
index c21c20b2..53dccf56 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/Messages.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/Messages.java
@@ -159,6 +159,8 @@ public class Messages extends NLS {
public static String LocalArchetypeCatalogDialog_dialog_title;
+ public static String LocalArchetypeCatalogDialog_error;
+
public static String LocalArchetypeCatalogDialog_error_empty;
public static String LocalArchetypeCatalogDialog_error_exist;
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties
index 5eceb792..917af0b0 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/messages.properties
@@ -98,6 +98,7 @@ LifecycleMappingPropertyPage_invalidPom=Can not read pom.xml
LifecycleMappingsViewer_trclmnSource_text=Source
LocalArchetypeCatalogDialog_btnBrowse=&Browse...
LocalArchetypeCatalogDialog_dialog_title=Select Archetype catalog
+LocalArchetypeCatalogDialog_error=Archetype catalog can not be loaded: {0}
LocalArchetypeCatalogDialog_error_empty=Archetype catalog is empty
LocalArchetypeCatalogDialog_error_exist=Archetype catalog does not exist
LocalArchetypeCatalogDialog_error_no_location=Archetype catalog location is required
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java
index 66195071..13fc2d74 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java
@@ -16,11 +16,13 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -217,7 +219,13 @@ public class LocalArchetypeCatalogDialog extends TitleAreaDialog {
}
LocalCatalogFactory factory = new LocalCatalogFactory(location, null, true);
- ArchetypeCatalog archetypeCatalog = factory.getArchetypeCatalog();
+ ArchetypeCatalog archetypeCatalog;
+ try {
+ archetypeCatalog = factory.getArchetypeCatalog();
+ } catch(CoreException ex) {
+ setMessage(NLS.bind(Messages.LocalArchetypeCatalogDialog_error, ex.getMessage()), IStatus.ERROR);
+ return false;
+ }
@SuppressWarnings("unchecked")
List<Archetype> archetypes = archetypeCatalog.getArchetypes();
if(archetypes == null || archetypes.size() == 0) {

Back to the top