Skip to content
This repository was archived by the owner on Nov 10, 2017. It is now read-only.

Modifies EclipseAndroidWorkspace to treat misconfigured workspace pro… #370

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@

package me.gladwell.eclipse.m2e.android.project;

import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;

import me.gladwell.eclipse.m2e.android.configuration.DependencyNotFoundInWorkspace;
import me.gladwell.eclipse.m2e.android.configuration.ProjectConfigurationException;

import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.StringUtils;
import org.eclipse.core.resources.IProject;
Expand All @@ -24,6 +22,9 @@
import com.google.inject.Inject;
import com.google.inject.Singleton;

import me.gladwell.eclipse.m2e.android.Log;
import me.gladwell.eclipse.m2e.android.configuration.DependencyNotFoundInWorkspace;

@Singleton
public class EclipseAndroidWorkspace implements AndroidWorkspace {

Expand Down Expand Up @@ -53,7 +54,13 @@ public IDEAndroidProject findOpenWorkspaceDependency(Dependency dependency) {
try {
mavenProject = mavenModelManager.readMavenProject(androidProject.getPom(), null);
} catch (CoreException e) {
throw new ProjectConfigurationException(e);
// This indicates that another project is malformed in some way - best to log and move on
Log.warn(MessageFormat.format("Exception while reading project {0}", project.getName()), e);
continue;
} catch(NullPointerException e) {
// This specifically occurs when the pom.xml file for a Maven-feature project is missing
Log.warn(MessageFormat.format("Exception while reading project {0}", project.getName()), e);
continue;
}

if (StringUtils.equals(dependency.getName(), project.getName())
Expand Down