Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.m2e.core/src')
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java2
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties1
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java7
3 files changed, 10 insertions, 0 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java
index 18f0df12..0bc02560 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java
@@ -90,6 +90,8 @@ public class Messages extends NLS {
public static String LocalProjectScanner_task_scanning;
+ public static String LocalProjectScanner_missingArtifactId;
+
public static String MavenExternalRuntime_error_cannot_parse;
public static String MavenExternalRuntime_exc_unsupported;
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties
index 6dbbb3d9..d091a3a7 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties
@@ -37,6 +37,7 @@ ProjectConfiguratorToRunAfterNotAvailable={0} is missing required configurator "
ProjectConfigurationUpdateRequired=Project configuration is not up-to-date with pom.xml. Select: Maven->Update Project... from the project context menu or use Quick Fix.
LocalProjectScanner_accessDeniedFromFolder=Can not access files from ''{0}''
LocalProjectScanner_task_scanning=Scanning folders
+LocalProjectScanner_missingArtifactId=Cannot import "{0}" without artifactId.
MavenExternalRuntime_error_cannot_parse=Can't parse m2.conf
MavenExternalRuntime_exc_unsupported=Unsupported m2.conf element
MavenExternalRuntime_unknown=UNKNOWN
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java
index da30c18a..983d2246 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/project/LocalProjectScanner.java
@@ -22,6 +22,8 @@ import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.osgi.util.NLS;
@@ -142,6 +144,11 @@ public class LocalProjectScanner extends AbstractProjectScanner<MavenProjectInfo
String pomName = modulePath + "/" + IMavenConstants.POM_FILE_NAME; //$NON-NLS-1$
+ if(model.getArtifactId() == null) {
+ throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID,
+ NLS.bind(Messages.LocalProjectScanner_missingArtifactId, pomName)));
+ }
+
MavenProjectInfo projectInfo = newMavenProjectInfo(pomName, pomFile, model, parentInfo);
//We only want to optionally rename the base directory not any sub directory
if(parentInfo == null) {

Back to the top